Skip to content

Commit

Permalink
Merge pull request #1352 from dopplershift/fix-build
Browse files Browse the repository at this point in the history
Fix build
  • Loading branch information
dopplershift authored Apr 16, 2020
2 parents 3bf3608 + c377b2d commit fd319f5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ platform = any
keywords = meteorology, weather
classifiers =
Development Status :: 5 - Production/Stable
Framework :: Matplotlib
Programming Language :: Python
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Expand Down Expand Up @@ -52,7 +53,7 @@ where = src

[options.extras_require]
dev = ipython[all]>=3.1
doc = sphinx>=2.1; sphinx-gallery>=0.4; doc8; m2r; netCDF4
doc = sphinx<3.0; sphinx-gallery>=0.4; doc8; m2r; netCDF4
examples = cartopy>=0.15.0; matplotlib>=2.2.0; pyproj>=1.9.4,!=2.0.0
test = pytest>=2.4; pytest-mpl; pytest-flake8; cartopy>=0.16.0; flake8>3.2.0; flake8-builtins!=1.4.0; flake8-comprehensions; flake8-copyright; flake8-docstrings; flake8-import-order; flake8-mutable; flake8-pep3101; flake8-print; flake8-quotes; flake8-rst-docstrings; pep8-naming; netCDF4; pyproj>=1.9.4,!=2.0.0

Expand Down Expand Up @@ -93,7 +94,6 @@ markers = mpl_image_compare
norecursedirs = build docs .idea
doctest_optionflags = NORMALIZE_WHITESPACE
mpl-results-path = test_output
log_print = False

[coverage:run]
omit = src/metpy/io/_nexrad_msgs/parse_spec.py,src/metpy/io/metar_parser.py
Expand Down
2 changes: 0 additions & 2 deletions src/metpy/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ def check_and_drop_units(actual, desired):
except DimensionalityError:
raise AssertionError('Units are not compatible: {} should be {}'.format(
actual.units, getattr(desired, 'units', 'dimensionless')))
except AttributeError:
pass

if hasattr(actual, 'magnitude'):
actual = actual.magnitude
Expand Down
2 changes: 1 addition & 1 deletion tests/calc/test_cross_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_distances_from_cross_section_given_xy(test_cross_xy):
def test_distances_from_cross_section_given_bad_coords(test_cross_xy):
"""Ensure an AttributeError is raised when the cross section lacks neeed coordinates."""
with pytest.raises(AttributeError):
distances_from_cross_section(test_cross_xy['u_wind'].drop_vars('x'))
distances_from_cross_section(test_cross_xy['u_wind'].drop('x'))


def test_latitude_from_cross_section_given_lat(test_cross_lonlat):
Expand Down
3 changes: 2 additions & 1 deletion tests/calc/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,10 @@ def data_4d():
data = xr.open_dataset(get_test_data('irma_gfs_example.nc', False))
data = data.metpy.parse_cf()
data['Geopotential_height_isobaric'].attrs['units'] = 'm'
subset = data.drop_vars((
subset = data.drop((
'LatLon_361X720-0p25S-180p00E', 'Vertical_velocity_pressure_isobaric', 'isobaric1',
'Relative_humidity_isobaric', 'reftime'

)).sel(
latitude=[46., 44., 42., 40.],
longitude=[262., 267., 272., 277.],
Expand Down
Binary file modified tests/plots/baseline/test_declarative_sfc_obs_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_skewt_default_aspect_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_skewt_tight_bbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ def test_declarative_colored_barbs():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.022)
@pytest.mark.mpl_image_compare(remove_text=True,
tolerance={'3.1': 9.771, '2.1': 9.771}.get(MPL_VERSION, 0.))
def test_declarative_sfc_obs_full():
"""Test making a full surface observation plot."""
data = pd.read_csv(get_test_data('SFC_obs.csv', as_file_obj=False),
Expand Down
4 changes: 2 additions & 2 deletions tests/plots/test_skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_skewt_default_aspect_empty():
return fig


@pytest.mark.skipif(matplotlib.__version__ < '3' or matplotlib.__version__ >= '3.2',
@pytest.mark.skipif(matplotlib.__version__ < '3.2',
reason='Matplotlib versions generate different image sizes.')
@pytest.mark.mpl_image_compare(tolerance=0., remove_text=False, style='default',
savefig_kwargs={'bbox_inches': 'tight'})
Expand Down Expand Up @@ -204,7 +204,7 @@ def test_skewt_shade_cape_cin_no_limit(test_profile):

with matplotlib.rc_context({'axes.autolimit_mode': 'data'}):
fig = plt.figure(figsize=(9, 9))
skew = SkewT(fig)
skew = SkewT(fig, aspect='auto')
skew.plot(p, t, 'r')
skew.plot(p, tp, 'k')
skew.shade_cape(p, t, tp)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_var_multidim_full(test_ds):
@pytest.fixture
def test_var_multidim_no_xy(test_var_multidim_full):
"""Provide a variable with multidimensional lat/lon coords but without x/y coords."""
return test_var_multidim_full.drop_vars(['y', 'x'])
return test_var_multidim_full.drop(['y', 'x'])


def test_projection(test_var):
Expand Down Expand Up @@ -474,7 +474,7 @@ def test_coordinates_identical_true(test_ds_generic):

def test_coordinates_identical_false_number_of_coords(test_ds_generic):
"""Test coordinates identical method when false due to number of coordinates."""
other_ds = test_ds_generic.drop_vars('e')
other_ds = test_ds_generic.drop('e')
assert not test_ds_generic['test'].metpy.coordinates_identical(other_ds['test'])


Expand Down

0 comments on commit fd319f5

Please sign in to comment.