Skip to content

Commit

Permalink
only determine time period when more than one time step is available
Browse files Browse the repository at this point in the history
  • Loading branch information
TonioF committed Mar 19, 2021
1 parent d89dd7a commit 08aa017
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xcube/core/store/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _strip_time_from_datetime_str(datetime_str: str) -> str:


def _determine_time_period(data: xr.Dataset):
if 'time' in data and len(data['time'].values) > 0:
if 'time' in data and len(data['time'].values) > 1:
time_diff = data['time'].diff(dim=data['time'].dims[0]).values.astype(np.float64)
time_res = time_diff[0]
time_regular = np.allclose(time_res, time_diff, 1e-8)
Expand Down

0 comments on commit 08aa017

Please sign in to comment.