Skip to content

Commit

Permalink
Remove TemporalReference, replaced functionality with ModelTime
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarsen-usgs committed Nov 13, 2024
1 parent e77e4cb commit 0a85cc1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 52 deletions.
17 changes: 2 additions & 15 deletions flopy/mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ def __getattr__(self, item):
Returns
-------
object, str, int or None
Package object of type :class:`flopy.pakbase.Package`,
:class:`flopy.utils.reference.TemporalReference`, str, int or None.
Package object of type :class:`flopy.pakbase.Package`, str, int, or None
Raises
------
Expand All @@ -701,12 +700,6 @@ def __getattr__(self, item):
if item == "output_packages" or not hasattr(self, "output_packages"):
raise AttributeError(item)

if item == "tr":
if self.dis is not None:
return self.dis.tr
else:
return None

if item == "nper":
# most subclasses have a nper property, but ModflowAg needs this
if self.dis is not None:
Expand Down Expand Up @@ -1346,16 +1339,10 @@ def __setattr__(self, key, value):
self._set_name(value)
elif key == "model_ws":
self.change_model_ws(value)
elif key == "tr":
assert isinstance(value, discretization.reference.TemporalReference)
if self.dis is not None:
self.dis.tr = value
else:
raise Exception("cannot set TemporalReference - ModflowDis not found")
elif key == "start_datetime":
if self.dis is not None:
self.dis.start_datetime = value
self.tr.start_datetime = value
self.modeltime.set_start_datetime(value)
else:
raise Exception("cannot set start_datetime - ModflowDis not found")
else:
Expand Down
3 changes: 0 additions & 3 deletions flopy/mfusg/mfusgdisu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from ..discretization.unstructuredgrid import UnstructuredGrid
from ..pakbase import Package
from ..utils import Util2d, Util3d, read1d
from ..utils.reference import TemporalReference
from .mfusg import MfUsg

ITMUNI = {"u": 0, "s": 1, "m": 2, "h": 3, "d": 4, "y": 5}
Expand Down Expand Up @@ -443,8 +442,6 @@ def __init__(
lenuni=self.lenuni,
)

self.tr = TemporalReference(itmuni=self.itmuni, start_datetime=start_datetime)

self.start_datetime = start_datetime

# get neighboring nodes
Expand Down
2 changes: 0 additions & 2 deletions flopy/modflow/mfdis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from ..utils import Util2d, Util3d
from ..utils.crs import get_crs
from ..utils.flopy_io import line_parse
from ..utils.reference import TemporalReference

ITMUNI = {"u": 0, "s": 1, "m": 2, "h": 3, "d": 4, "y": 5}
LENUNI = {"u": 0, "f": 1, "m": 2, "c": 3}
Expand Down Expand Up @@ -273,7 +272,6 @@ def __init__(

if start_datetime is None:
start_datetime = model._start_datetime
self.tr = TemporalReference(itmuni=self.itmuni, start_datetime=start_datetime)

self.start_datetime = start_datetime
self._totim = None
Expand Down
1 change: 0 additions & 1 deletion flopy/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
from .postprocessing import get_specific_discharge, get_transmissivities
from .rasters import Raster
from .recarray_utils import create_empty_recarray, ra_slice, recarray
from .reference import TemporalReference
from .sfroutputfile import SfrFile
from .swroutputfile import (
SwrBudget,
Expand Down
31 changes: 0 additions & 31 deletions flopy/utils/reference.py

This file was deleted.

0 comments on commit 0a85cc1

Please sign in to comment.