diff --git a/.docs/code.rst b/.docs/code.rst index f2d632154..3bfeb040a 100644 --- a/.docs/code.rst +++ b/.docs/code.rst @@ -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 diff --git a/.docs/md/generate_classes.md b/.docs/md/generate_classes.md index c480b9b62..05c2300d4 100644 --- a/.docs/md/generate_classes.md +++ b/.docs/md/generate_classes.md @@ -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 @@ -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] @@ -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`. diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index e6c12ea26..07e7b73bc 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -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 diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index fdf12b12f..590a1578f 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -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 diff --git a/autotest/test_generate_classes.py b/autotest/test_generate_classes.py index 44cac88ca..db812aa40 100644 --- a/autotest/test_generate_classes.py +++ b/autotest/test_generate_classes.py @@ -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", diff --git a/docs/make_release.md b/docs/make_release.md index 568ebe763..d65c7619f 100644 --- a/docs/make_release.md +++ b/docs/make_release.md @@ -96,7 +96,7 @@ As described above, making a release manually involves the following steps: - Run `python scripts/update_version.py -v ` 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. diff --git a/docs/mf6_dev_guide.md b/docs/mf6_dev_guide.md index 60aff50bc..8f95ee9bb 100644 --- a/docs/mf6_dev_guide.md +++ b/docs/mf6_dev_guide.md @@ -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. diff --git a/flopy/mf6/utils/generate_classes.py b/flopy/mf6/utils/generate_classes.py index 2763503d3..32c1d6978 100644 --- a/flopy/mf6/utils/generate_classes.py +++ b/flopy/mf6/utils/generate_classes.py @@ -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()