Skip to content

Commit

Permalink
don't try to wrap datetime objects in pint
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Feb 21, 2020
1 parent df4ea68 commit cf626d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,7 @@ def wrapper(cls):
"test_index_0d_datetime",
"test_index_0d_timedelta64",
"test_0d_time_data",
"test_index_0d_not_a_time",
"test_datetime64_conversion",
"test_timedelta64_conversion",
"test_pandas_period_index",
Expand All @@ -1355,6 +1356,15 @@ def cls(dims, data, *args, **kwargs):
dims, unit_registry.Quantity(data, unit_registry.m), *args, **kwargs
)

def example_1d_objects(self):
for data in [
range(3),
0.5 * np.arange(3),
0.5 * np.arange(3, dtype=np.float32),
np.array(["a", "b", "c"], dtype=object),
]:
yield (self.cls("x", data), data)

@pytest.mark.parametrize(
"func",
(
Expand Down

0 comments on commit cf626d9

Please sign in to comment.