Skip to content

Commit 45dc999

Browse files
committed
try to coerce to int in time subset
1 parent 0ecea51 commit 45dc999

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nctoolkit/subset.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ def select_timesteps(self, times=None):
413413
if not isinstance(times, list):
414414
times = [times]
415415

416+
# coerce to int
417+
try:
418+
times = [int(x) for x in times]
419+
except:
420+
pass
421+
416422
for tt in times:
417423
if not isinstance(tt, int):
418424
raise TypeError(f"{tt} is not an int")

0 commit comments

Comments
 (0)