-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed qual_base Removed load and attrs, moved it to model, package and simulation.
- Loading branch information
1 parent
7d4c1a2
commit 21a55b7
Showing
9 changed files
with
113 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,8 @@ | ||
# autogenerated file, do not modify | ||
from os import PathLike, curdir | ||
from typing import Union | ||
|
||
from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator | ||
from flopy.mf6 import mfpackage | ||
from flopy.mf6 import mfmodel | ||
{# avoid circular import; some pkgs (e.g. mfnam) are used by mfsimbase.py #} | ||
{% if base == "MFSimulationBase" %} | ||
from flopy.mf6 import mfsimbase | ||
{% include "simulation.py.jinja" %} | ||
{% elif base == "MFModel" %} | ||
{% include "model.py.jinja" %} | ||
{% else %} | ||
{% include "package.py.jinja" %} | ||
{% endif %} | ||
|
||
class {% if base == "MFSimulationBase" %}MF{% else %}Modflow{% endif %}{{ name.title.title() }}({{ qual_base }}): | ||
{% include "docstring.jinja" %} | ||
|
||
{% include "attrs.py.jinja" %} | ||
|
||
{% include "init.py.jinja" %} | ||
|
||
{% include "load.py.jinja" %} | ||
|
||
{# TODO: cleaner way to filter out hpc subpkg? #} | ||
{% if "ref" in meta and name.r != "hpc" %} | ||
{% include "container.py.jinja" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,4 @@ def __init__( | |
**kwargs, | ||
): | ||
{{ init_body }} | ||
{% if base == "MFPackage" %} | ||
self._init_complete = True | ||
{% endif %} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from os import PathLike, curdir | ||
from typing import Union | ||
|
||
from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator | ||
from flopy.mf6.mfmodel import MFModel | ||
|
||
|
||
class Modflow{{ name.title.title() }}(MFModel): | ||
{% include "docstring.jinja" %} | ||
|
||
model_type = "{{ name.title }}" | ||
|
||
{% include "init.py.jinja" %} | ||
|
||
@classmethod | ||
def load( | ||
cls, | ||
simulation, | ||
structure, | ||
modelname="NewModel", | ||
model_nam_file="modflowtest.nam", | ||
version="mf6", | ||
exe_name="mf6", | ||
strict=True, | ||
model_rel_path=curdir, | ||
load_only=None, | ||
): | ||
return MFModel.load_base( | ||
cls, | ||
simulation, | ||
structure, | ||
modelname, | ||
model_nam_file, | ||
"{{ name.title }}6", | ||
version, | ||
exe_name, | ||
strict, | ||
model_rel_path, | ||
load_only, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from os import PathLike, curdir | ||
from typing import Union | ||
|
||
from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator | ||
from flopy.mf6.mfpackage import MFPackage, MFChildPackages | ||
|
||
class Modflow{{ name.title.title() }}(MFPackage): | ||
{% include "docstring.jinja" %} | ||
|
||
{%- for item in class_attrs %} | ||
{{ item }} | ||
{%- endfor %} | ||
package_abbr = "{{ '' if name.l in ["sln", "sim", "exg", none] else name.l }}{{ name.r }}" | ||
_package_type = "{{ name.r }}" | ||
dfn_file_name = "{{ name.l | default('sim', true) }}-{{ name.r }}.dfn" | ||
dfn = {{ dfn|pprint|indent(10) }} | ||
|
||
{% include "init.py.jinja" %} | ||
self._init_complete = True | ||
|
||
{# TODO: cleaner way to filter out hpc subpkg? #} | ||
{% if "ref" in meta and name.r != "hpc" %} | ||
{% include "container.py.jinja" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from os import PathLike, curdir | ||
from typing import Union | ||
|
||
from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator | ||
from flopy.mf6.mfsimbase import MFSimulationBase | ||
|
||
class MF{{ name.title.title() }}(MFSimulationBase): | ||
{% include "docstring.jinja" %} | ||
|
||
{% include "init.py.jinja" %} | ||
|
||
@classmethod | ||
def load( | ||
cls, | ||
sim_name="modflowsim", | ||
version="mf6", | ||
exe_name: Union[str, PathLike] = "mf6", | ||
sim_ws: Union[str, PathLike] = curdir, | ||
strict=True, | ||
verbosity_level=1, | ||
load_only=None, | ||
verify_data=False, | ||
write_headers=True, | ||
lazy_io=False, | ||
use_pandas=True, | ||
): | ||
return MFSimulationBase.load( | ||
cls, | ||
sim_name, | ||
version, | ||
exe_name, | ||
sim_ws, | ||
strict, | ||
verbosity_level, | ||
load_only, | ||
verify_data, | ||
write_headers, | ||
lazy_io, | ||
use_pandas, | ||
) |