Skip to content

refactor(interface): clean up interface usage #2513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion flopy/export/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __init__(
self.global_attributes = {}
self.global_attributes["namefile"] = self.model.namefile
self.global_attributes["model_ws"] = self.model.model_ws
self.global_attributes["exe_name"] = self.model.exe_name
self.global_attributes["exe_name"] = self.model.exename
self.global_attributes["modflow_version"] = self.model.version

self.global_attributes["create_hostname"] = socket.gethostname()
Expand Down
11 changes: 10 additions & 1 deletion flopy/export/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,16 @@ def transient2d_export(f: Union[str, os.PathLike], t2d, fmt=None, **kwargs):

array = t2d.array
with np.errstate(invalid="ignore"):
if array.dtype not in [int, np.int32, np.int64]:
from numpy import dtype

if array.dtype not in [
int,
np.int32,
np.int64,
dtype("float64"),
dtype("int64"),
dtype("int32"),
]:
if mask is not None:
array[:, 0, mask] = np.nan
array[array <= min_valid] = np.nan
Expand Down
7 changes: 7 additions & 0 deletions flopy/mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ def update_modelgrid(self):
)
self._mg_resync = True

@property
@abc.abstractmethod
def modeltime(self):
raise NotImplementedError(
"must define modeltime in child class to use this base class"
)

@property
@abc.abstractmethod
def modelgrid(self):
Expand Down
2 changes: 2 additions & 0 deletions flopy/modflow/mf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def __init__(
if self.version == "mf2k":
self.glo = ModflowGlobal(self)

self._exename = exe_name

self.lst = ModflowList(self, unitnumber=listunit)
# -- check if unstructured is specified for something
# other than mfusg is specified
Expand Down
Loading