Skip to content

Commit 558b466

Browse files
Update parcels/_core/utils/time.py
Co-authored-by: Nick Hodgskin <[email protected]>
1 parent 161ad9c commit 558b466

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

parcels/_core/utils/time.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def __init__(self, left: T, right: T) -> None:
4545
self.left = left
4646
self.right = right
4747

48+
def __contains__(self, item: T) -> bool:
49+
return self.left <= item <= self.right
50+
4851
def is_all_time_in_interval(self, time):
4952
item = np.atleast_1d(time)
5053
return (self.left <= item).all() and (item <= self.right).all()

0 commit comments

Comments
 (0)