Skip to content
Merged
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
4 changes: 2 additions & 2 deletions autotest/test_modeltime.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_mf2005_modeltime():
raise AssertionError("start_datetime improperly stored")

result = modeltime.intersect("3/06/2024 23:59:59")
if result != (2, 0):
if result != (2, 1):
raise AssertionError("ModelTime intersect not working correctly")


Expand Down Expand Up @@ -317,7 +317,7 @@ def test_mf6_modeltime():
raise AssertionError("start_datetime improperly stored")

result = modeltime.intersect("3/06/2024 23:59:59")
if result != (2, 0):
if result != (2, 1):
raise AssertionError("ModelTime intersect not working correctly")


Expand Down
9 changes: 4 additions & 5 deletions flopy/discretization/modeltime.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,14 @@ def intersect(
"objects, set time units or use totim for intersection"
)

elif self.time_units == "days":
totim = timedelta.days

elif self.time_units in {"hours", "minutes", "seconds"}:
elif self.time_units in {"days", "hours", "minutes", "seconds"}:
totim = timedelta.total_seconds()
if self.time_units == "minutes":
totim /= 60
elif self.time_units == "hours":
totim /= 3600
elif self.time_units == "days":
totim /= 86400.0

else:
# years condition
Expand All @@ -647,7 +646,7 @@ def intersect(
)

timedelta = datetime_obj - dt_iyear
days = timedelta.days
days = timedelta.total_seconds() / 86400.0
yr_frac = days / ndays
totim += yr_frac

Expand Down
1 change: 0 additions & 1 deletion flopy/utils/hfb_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def make_hfb_array(modelgrid, geom):
for record in result:
node = record.cellid
ixshp = record.ixshapes
# todo: numpy array this and Transpose
coords = np.array(ixshp.coords.xy).T
x0, y0 = coords[0, 0], coords[0, 1]
x1, y1 = coords[-1, 0], coords[-1, 1]
Expand Down
Loading