Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "united" as meaning "having units" #2432

Merged
merged 1 commit into from
Jun 2, 2022
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
2 changes: 1 addition & 1 deletion src/metpy/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def check_and_drop_units(actual, desired):
actual = units.Quantity(actual, 'dimensionless')
actual = actual.to(desired.units)
# Otherwise, the desired result has no units. Convert the actual result to
# dimensionless units if it is a united quantity.
# dimensionless units if it is a quantity.
else:
if hasattr(actual, 'units'):
actual = actual.to('dimensionless')
Expand Down
6 changes: 3 additions & 3 deletions src/metpy/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@


def pandas_dataframe_to_unit_arrays(df, column_units=None):
"""Attach units to data in pandas dataframes and return united arrays.
"""Attach units to data in pandas dataframes and return quantities.

Parameters
----------
Expand All @@ -85,7 +85,7 @@ def pandas_dataframe_to_unit_arrays(df, column_units=None):

Returns
-------
Dictionary containing united arrays with keys corresponding to the dataframe
Dictionary containing `Quantity` instances with keys corresponding to the dataframe
column names.

"""
Expand All @@ -107,7 +107,7 @@ def pandas_dataframe_to_unit_arrays(df, column_units=None):


def concatenate(arrs, axis=0):
r"""Concatenate multiple values into a new unitized object.
r"""Concatenate multiple values into a new quantity.

This is essentially a scalar-/masked array-aware version of `numpy.concatenate`. All items
must be able to be converted to the same units. If an item has no units, it will be given
Expand Down
8 changes: 4 additions & 4 deletions tests/plots/test_skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def test_hodograph_api():

@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.6 if MPL_VERSION == '3.3' else 0.)
def test_hodograph_units():
"""Test passing unit-ed quantities to Hodograph."""
"""Test passing quantities to Hodograph."""
fig = plt.figure(figsize=(9, 9))
ax = fig.add_subplot(1, 1, 1)
hodo = Hodograph(ax)
Expand Down Expand Up @@ -402,7 +402,7 @@ def test_skewt_barb_no_default_unit_conversion():
@pytest.mark.parametrize('u,v', [(np.array([3]) * units('m/s'), np.array([3])),
(np.array([3]), np.array([3]) * units('m/s'))])
def test_skewt_barb_unit_conversion_exception(u, v):
"""Test that errors are raise if unit conversion is requested on un-united data."""
"""Test that an error is raised if unit conversion is requested on plain arrays."""
p_wind = np.array([500]) * units.hPa

fig = plt.figure(figsize=(9, 9))
Expand Down Expand Up @@ -496,8 +496,8 @@ def test_hodograph_wind_vectors():
return fig


def test_united_hodograph_range():
"""Tests making a hodograph with a united ranged."""
def test_hodograph_range_with_units():
"""Tests making a hodograph with a range with units."""
fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(1, 1, 1)
Hodograph(ax, component_range=60. * units.knots)
4 changes: 2 additions & 2 deletions tests/plots/test_station_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def test_barb_no_default_unit_conversion():
@pytest.mark.parametrize('u,v', [(np.array([3]) * units('m/s'), np.array([3])),
(np.array([3]), np.array([3]) * units('m/s'))])
def test_barb_unit_conversion_exception(u, v):
"""Test that errors are raise if unit conversion is requested on un-united data."""
"""Test that an error is raised if unit conversion is requested on plain arrays."""
x_pos = np.array([0])
y_pos = np.array([0])

Expand Down Expand Up @@ -451,7 +451,7 @@ def test_stationplot_unit_conversion():


def test_scalar_unit_conversion_exception():
"""Test that errors are raise if unit conversion is requested on un-united data."""
"""Test that an error is raised if unit conversion is requested on plain arrays."""
x_pos = np.array([0])
y_pos = np.array([0])

Expand Down
2 changes: 1 addition & 1 deletion tests/units/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_pandas_units_on_dataframe():


@pytest.mark.filterwarnings("ignore:Pandas doesn't allow columns to be created")
def test_pandas_units_on_dataframe_not_all_united():
def test_pandas_units_on_dataframe_not_all_with_units():
"""Unit attachment with units attribute with a column with no units."""
df = pd.DataFrame(data=[[1, 4], [2, 5], [3, 6]], columns=['cola', 'colb'])
df.units = {'cola': 'kilometers'}
Expand Down