Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/metpy/interpolate/slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def cross_section(data, start, end, steps=100, interp_type='linear'):
"""
if isinstance(data, xr.Dataset):
# Recursively apply to dataset
return data.apply(cross_section, True, (start, end), steps=steps,
interp_type=interp_type)
return data.map(cross_section, True, (start, end), steps=steps,
interp_type=interp_type)
elif data.ndim == 0:
# This has no dimensions, so it is likely a projection variable. In any case, there
# are no data here to take the cross section with. Therefore, do nothing.
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."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not your change, but looks like we dropped a letter there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By all means put in a PR for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, it's cross sections, so the git blame is probably mine anyways!

with pytest.raises(AttributeError):
distances_from_cross_section(test_cross_xy['u_wind'].drop('x'))
distances_from_cross_section(test_cross_xy['u_wind'].drop_vars('x'))


def test_latitude_from_cross_section_given_lat(test_cross_lonlat):
Expand Down
2 changes: 1 addition & 1 deletion tests/calc/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ 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((
subset = data.drop_vars((
'LatLon_361X720-0p25S-180p00E', 'Vertical_velocity_pressure_isobaric', 'isobaric1',
'Relative_humidity_isobaric', 'reftime'

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(['y', 'x'])
return test_var_multidim_full.drop_vars(['y', 'x'])


def test_projection(test_var):
Expand Down Expand Up @@ -498,7 +498,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('e')
other_ds = test_ds_generic.drop_vars('e')
assert not test_ds_generic['test'].metpy.coordinates_identical(other_ds['test'])


Expand Down