diff --git a/flopy/mbase.py b/flopy/mbase.py index f0bfbdaac..203512b7d 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -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 ------ @@ -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: @@ -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: diff --git a/flopy/mfusg/mfusgdisu.py b/flopy/mfusg/mfusgdisu.py index 0c284387d..b95f2f359 100644 --- a/flopy/mfusg/mfusgdisu.py +++ b/flopy/mfusg/mfusgdisu.py @@ -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} @@ -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 diff --git a/flopy/modflow/mfdis.py b/flopy/modflow/mfdis.py index cb1c10317..20cf8d806 100644 --- a/flopy/modflow/mfdis.py +++ b/flopy/modflow/mfdis.py @@ -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} @@ -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 diff --git a/flopy/utils/__init__.py b/flopy/utils/__init__.py index 87e0b6e5c..ece1430ce 100644 --- a/flopy/utils/__init__.py +++ b/flopy/utils/__init__.py @@ -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, diff --git a/flopy/utils/reference.py b/flopy/utils/reference.py deleted file mode 100644 index ea962b591..000000000 --- a/flopy/utils/reference.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Temporal referencing for flopy model objects.""" - -__all__ = ["TemporalReference"] - - -class TemporalReference: - """ - For now, just a container to hold start time and time units files - outside of DIS package. - """ - - defaults = {"itmuni": 4, "start_datetime": "01-01-1970"} - - itmuni_values = { - "undefined": 0, - "seconds": 1, - "minutes": 2, - "hours": 3, - "days": 4, - "years": 5, - } - - itmuni_text = {v: k for k, v in itmuni_values.items()} - - def __init__(self, itmuni=4, start_datetime=None): - self.itmuni = itmuni - self.start_datetime = start_datetime - - @property - def model_time_units(self): - return self.itmuni_text[self.itmuni]