Skip to content

Commit d1b2ead

Browse files
committed
Use .data rather than .values to check the underlying array in the xarray dataset
1 parent 5a4a4f1 commit d1b2ead

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

huracanpy/diags/track_stats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def ace_by_point(wind, threshold=34 * units("knots"), wind_units="m s-1"):
8484
# TODO - extend preprocess_and_wrap to include this if it is needed for more
8585
# functions
8686
if isinstance(ace_values, xr.DataArray) and isinstance(
87-
ace_values.values, pint.Quantity
87+
ace_values.data, pint.Quantity
8888
):
8989
ace_values = ace_values.metpy.dequantify()
9090

tests/test_diags/test_track_stats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def test_ace(tracks_csv):
88

99
np.testing.assert_allclose(ace, np.array([3.03623809, 2.21637375, 4.83686787]))
1010

11-
assert isinstance(ace.values, np.ndarray)
11+
assert isinstance(ace.data, np.ndarray)
1212

1313

1414
def test_duration():

0 commit comments

Comments
 (0)