diff --git a/flopy/mf6/mfbase.py b/flopy/mf6/mfbase.py index 1bc0e70fa..a4c07b622 100644 --- a/flopy/mf6/mfbase.py +++ b/flopy/mf6/mfbase.py @@ -461,15 +461,6 @@ def __init__(self, simulation_data): self.package_name_dict = {} self.package_filename_dict = {} - @property - def package_key_dict(self): - warnings.warn( - "package_key_dict has been deprecated, use " - "package_type_dict instead", - category=DeprecationWarning, - ) - return self.package_type_dict - @staticmethod def package_list(): """Static method that returns the list of available packages. diff --git a/flopy/mf6/mfmodel.py b/flopy/mf6/mfmodel.py index 6e813b70e..61360052a 100644 --- a/flopy/mf6/mfmodel.py +++ b/flopy/mf6/mfmodel.py @@ -240,7 +240,12 @@ def _get_data_str(self, formal): @property def package_key_dict(self): - return self._package_container.package_key_dict + warnings.warn( + "package_key_dict has been deprecated, use " + "package_type_dict instead", + category=DeprecationWarning, + ) + return self._package_container.package_type_dict @property def package_dict(self): @@ -252,6 +257,18 @@ def package_names(self): """Returns a list of package names.""" return self._package_container.package_names + @property + def package_type_dict(self): + return self._package_container.package_type_dict + + @property + def package_name_dict(self): + return self._package_container.package_name_dict + + @property + def package_filename_dict(self): + return self._package_container.package_filename_dict + @property def nper(self): """Number of stress periods. diff --git a/flopy/mf6/mfpackage.py b/flopy/mf6/mfpackage.py index 7bd0b61a8..8ca12d539 100644 --- a/flopy/mf6/mfpackage.py +++ b/flopy/mf6/mfpackage.py @@ -1993,7 +1993,12 @@ def data_list(self): @property def package_key_dict(self): - return self._package_container.package_key_dict + warnings.warn( + "package_key_dict has been deprecated, use " + "package_type_dict instead", + category=DeprecationWarning, + ) + return self._package_container.package_type_dict @property def package_names(self): @@ -2004,6 +2009,18 @@ def package_names(self): def package_dict(self): return self._package_container.package_dict + @property + def package_type_dict(self): + return self._package_container.package_type_dict + + @property + def package_name_dict(self): + return self._package_container.package_name_dict + + @property + def package_filename_dict(self): + return self._package_container.package_filename_dict + def get_package(self, name=None, type_only=False, name_only=False): """ Finds a package by package name, package key, package type, or partial diff --git a/flopy/mf6/mfsimbase.py b/flopy/mf6/mfsimbase.py index 405d177b5..ca78987b7 100644 --- a/flopy/mf6/mfsimbase.py +++ b/flopy/mf6/mfsimbase.py @@ -3,7 +3,7 @@ import os.path import sys from pathlib import Path -from typing import List, Optional, Union, cast +from typing import List, Optional, Type, Union, cast import numpy as np @@ -692,7 +692,12 @@ def exchange_files(self): @property def package_key_dict(self): - return self._package_container.package_key_dict + warnings.warn( + "package_key_dict has been deprecated, use " + "package_type_dict instead", + category=DeprecationWarning, + ) + return self._package_container.package_type_dict @property def package_dict(self): @@ -704,9 +709,21 @@ def package_names(self): """Returns a list of package names.""" return self._package_container.package_names + @property + def package_type_dict(self): + return self._package_container.package_type_dict + + @property + def package_name_dict(self): + return self._package_container.package_name_dict + + @property + def package_filename_dict(self): + return self._package_container.package_filename_dict + @staticmethod def load( - cls_child, + cls_child: Type["MFSimulationBase"], sim_name="modflowsim", version="mf6", exe_name: Union[str, os.PathLike] = "mf6", @@ -774,17 +791,14 @@ def load( """ # initialize - instance = cast( - MFSimulationBase, - cls_child( - sim_name, - version, - exe_name, - sim_ws, - verbosity_level, - write_headers=write_headers, - use_pandas=use_pandas, - ), + instance = cls_child( + sim_name, + version, + exe_name, + sim_ws, + verbosity_level, + write_headers=write_headers, + use_pandas=use_pandas, ) verbosity_level = instance.simulation_data.verbosity_level