diff --git a/autotest/test_modeltime.py b/autotest/test_modeltime.py index 966d21d6b..fbdb54e33 100644 --- a/autotest/test_modeltime.py +++ b/autotest/test_modeltime.py @@ -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") @@ -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") diff --git a/flopy/discretization/modeltime.py b/flopy/discretization/modeltime.py index f072d1107..2056c0110 100644 --- a/flopy/discretization/modeltime.py +++ b/flopy/discretization/modeltime.py @@ -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 @@ -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 diff --git a/flopy/utils/hfb_util.py b/flopy/utils/hfb_util.py index 97d6c8398..036d33c87 100644 --- a/flopy/utils/hfb_util.py +++ b/flopy/utils/hfb_util.py @@ -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]