Skip to content
Closed
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 nc_time_axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def convert(cls, value, unit, axis):
shape = None
if isinstance(value, np.ndarray):
# Don't do anything with numeric types.
if value.dtype != np.object:
if value.dtype != object:
return value
shape = value.shape
value = value.reshape(-1)
Expand Down
4 changes: 2 additions & 2 deletions nc_time_axis/tests/unit/test_NetCDFTimeConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ def test_cftime_raw_date(self):

def test_cftime_np_array_CalendarDateTime(self):
val = np.array([CalendarDateTime(cftime.datetime(2012, 6, 4),
'360_day')], dtype=np.object)
'360_day')], dtype=object)
result = NetCDFTimeConverter().convert(val, None, None)
self.assertEqual(result, np.array([4473.]))

def test_cftime_np_array_raw_date(self):
val = np.array([cftime.Datetime360Day(2012, 6, 4)], dtype=np.object)
val = np.array([cftime.Datetime360Day(2012, 6, 4)], dtype=object)
result = NetCDFTimeConverter().convert(val, None, None)
self.assertEqual(result, np.array([4473.]))

Expand Down