Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Oct 1, 2024
1 parent 689ebc2 commit 7203258
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .docs/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ Contents:
.. toctree::
:maxdepth: 4

./source/flopy.mf6.createpackages.rst
./source/flopy.mf6.generate_classes.rst
./source/flopy.mf6.utils.createpackages.rst
./source/flopy.mf6.utils.generate_classes.rst


Previous Versions of MODFLOW
Expand Down
12 changes: 6 additions & 6 deletions .docs/md/generate_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MODFLOW 6 input continues to evolve as new models, packages, and options are dev
The FloPy classes for MODFLOW 6 are largely generated by a utility which converts DFN files in a modflow6 repository on GitHub or on the local machine into Python source files in your local FloPy install. For instance (output much abbreviated):

```bash
$ python -m flopy.mf6.generate_classes
$ python -m flopy.mf6.utils.generate_classes



Expand Down Expand Up @@ -55,7 +55,7 @@ Similar functionality is available within Python, e.g.:
The `generate_classes()` function has several optional parameters.

```bash
$ python -m flopy.mf6.generate_classes -h
$ python -m flopy.mf6.utils.generate_classes -h
usage: generate_classes.py [-h] [--owner OWNER] [--repo REPO] [--ref REF]
[--dfnpath DFNPATH] [--no-backup]

Expand All @@ -79,19 +79,19 @@ options:

For example, use the develop branch instead:
```bash
$ python -m flopy.mf6.generate_classes --ref develop
$ python -m flopy.mf6.utils.generate_classes --ref develop
```
use a fork of modflow6:
```bash
$ python -m flopy.mf6.generate_classes --owner your-username --ref your-branch
$ python -m flopy.mf6.utils.generate_classes --owner your-username --ref your-branch
```
maybe your fork has a different name:
```bash
$ python -m flopy.mf6.generate_classes --owner your-username --repo your-modflow6 --ref your-branch
$ python -m flopy.mf6.utils.generate_classes --owner your-username --repo your-modflow6 --ref your-branch
```
local copy of the repo:
```bash
$ python -m flopy.mf6.generate_classes --dfnpath ../your/dfn/path
$ python -m flopy.mf6.utils.generate_classes --dfnpath ../your/dfn/path
```

Branch names, commit hashes, or tags may be provided to `ref`.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
subset: triangle

- name: Update package classes
run: python -m flopy.mf6.generate_classes --ref develop --no-backup
run: python -m flopy.mf6.utils.generate_classes --ref develop --no-backup

- name: Run tests
working-directory: autotest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
subset: triangle

- name: Update FloPy packages
run: python -m flopy.mf6.generate_classes --ref develop --no-backup
run: python -m flopy.mf6.utils.generate_classes --ref develop --no-backup

- name: Run example tests
working-directory: autotest
Expand Down
2 changes: 1 addition & 1 deletion autotest/test_generate_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_generate_classes_from_github_refs(
out, err, ret = run_cmd(
str(python),
"-m",
"flopy.mf6.generate_classes",
"flopy.mf6.utils.generate_classes",
"--owner",
owner,
"--repo",
Expand Down
2 changes: 1 addition & 1 deletion docs/make_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ As described above, making a release manually involves the following steps:

- Run `python scripts/update_version.py -v <semver>` to update the version number stored in `version.txt` and `flopy/version.py`. For an approved release use the `--approve` flag.

- Update MODFLOW 6 dfn files in the repository and MODFLOW 6 package classes by running `python -m flopy.mf6.generate_classes --ref master --no-backup`
- Update MODFLOW 6 dfn files in the repository and MODFLOW 6 package classes by running `python -m flopy.mf6.utils.generate_classes --ref master --no-backup`

- Run `ruff check .` and `ruff format .` from the project root.

Expand Down
2 changes: 1 addition & 1 deletion docs/mf6_dev_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file provides an overview of how FloPy for MODFLOW 6 (FPMF6) works under th
Package Meta-Data and Package Files
-----------------------------------------------

FPMF6 uses meta-data files located in flopy/mf6/data/dfn to define the model and package types supported by MODFLOW 6. When additional model and package types are added to MODFLOW 6, additional meta-data files can be added to this folder and flopy/mf6/createpackages.py can be run to add new packages to the FloPy library. createpackages.py uses flopy/mf6/data/mfstructure.py to read meta-data files (*.dfn) and use that meta-data to create the package files found in flopy/mf6/modflow (do not directly modify any of the files in this folder, they are all automatically generated). The automatically generated package files contain an interface for accessing package data and data documentation generated from the meta-data files. Additionally, meta-data describing package data types and shapes is stored in the dfn attribute. flopy/mf6/data/mfstructure.py can load structure information using the dfn attribute (instead of loading it from the meta-data files). This allows for flopy to be installed without the dfn files.
FPMF6 uses meta-data files located in flopy/mf6/data/dfn to define the model and package types supported by MODFLOW 6. When additional model and package types are added to MODFLOW 6, additional meta-data files can be added to this folder and flopy/mf6/utils/createpackages.py can be run to add new packages to the FloPy library. createpackages.py uses flopy/mf6/data/mfstructure.py to read meta-data files (*.dfn) and use that meta-data to create the package files found in flopy/mf6/modflow (do not directly modify any of the files in this folder, they are all automatically generated). The automatically generated package files contain an interface for accessing package data and data documentation generated from the meta-data files. Additionally, meta-data describing package data types and shapes is stored in the dfn attribute. flopy/mf6/data/mfstructure.py can load structure information using the dfn attribute (instead of loading it from the meta-data files). This allows for flopy to be installed without the dfn files.

All meta-data can be accessed from the flopy.mf6.data.mfstructure.MFStructure class. This is a singleton class, meaning only one instance of this class can be created. The class contains a sim_struct attribute (which is a flopy.mf6.data.mfstructure.MFSimulationStructure object) which contains all of the meta-data for all package files. Meta-data is stored in a structured format. MFSimulationStructure contains MFModelStructure and MFInputFileStructure objects, which contain the meta-data for each model type and each "simulation-level" package (tdis, ims, ...). MFModelStructure contains model specific meta-data and a MFInputFileStructure object for each package in that model. MFInputFileStructure contains package specific meta-data and a MFBlockStructure object for each block contained in the package file. MFBlockStructure contains block specific meta-data and a MFDataStructure object for each data structure defined in the block, and MFDataStructure contains data structure specific meta-data and a MFDataItemStructure object for each data item contained in the data structure. Data structures define the structure of data that is naturally grouped together, for example, the data in a numpy recarray. Data item structures define the structure of specific pieces of data, for example, a single column of a numpy recarray. The meta-data defined in these classes provides all the information FloPy needs to read and write MODFLOW 6 package and name files, create the Flopy interface, and check the data for various constraints.

Expand Down
2 changes: 1 addition & 1 deletion flopy/mf6/utils/generate_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@ def cli_main():


if __name__ == "__main__":
"""Run command-line with: python -m flopy.mf6.generate_classes"""
"""Run command-line with: python -m flopy.mf6.utils.generate_classes"""
cli_main()

0 comments on commit 7203258

Please sign in to comment.