Skip to content

Conversation

@github-actions
Copy link
Contributor

FloPy 3.9.4

The release can be approved by merging this pull request into master. This will trigger a final job to publish the release to PyPI.

wpbonelli and others added 30 commits May 13, 2025 07:42
Address issue #2477:

    improve parsing of itmp header lines in pakbase
    mfusgwel: add support for wellbot keyword / stress period data
fix(model_splitter.py): origin should be taken from base model for unstructured grids
* update forgive return value to None, None for consistency
Testing example scripts directly instead of notebooks in CI makes it easier to see what the error message is when they fail. Also update deprecated pyvista syntax in vtk_pathlines_example.py
No need for the new file added in #2517
Simplify the generate_classes.py script. Remove the backup and exclude functionality — this can be done manually if needed in the future. Improve the console output by showing lists in columns.

Also, one of the old commits we tested had some funky variable definitions in gwf-evta.dfn, which I think we can safely assume are no longer part of the spec. This was breaking the codegen CI tests.
#2520)

Instead of re-reading DFNs from disk in a Jinja filter, attach the legacy DFN format to the context passed into the template for now. See #2385 (comment) for why we need to do such a thing in the first place. This step will let us remove DFNs from version control, coming shortly to follow.
…2521)

..and update generate_classes.py to do all its work in a temporary directory
feat(readarray): initial support for readarraylayer and readarraygrid options
There is no more use for this script as we no longer store DFNs in this repository
Patch #2531. Exporting stress_period_data still breaks if use_pandas=False but since the default is True and I know of no use case to set it False I am going to leave this fractally expanding terrain for followup work
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Reconsider the error which is the subject of #2533. Probably not the final word here, but rasterio.from_user_input() will raise an error if it can't parse the CRS string. Is this sufficient?
For the previous release (3.9.3) we copied over some utilities needed for the new code generation module from modflow-devtools. We did this because we were blocked from releasing devtools at the time. Pull these back out and import them.
* trap for SFR cells not connected to GWF model
* fix boundname mapping in external files for splitting observation packages
* fix timeseries remapping and move code block to support Advanced packages
- use dataclass
- add type hints and update some docstrings
- coerce input arrays to the expected dtype with astype
- fix an issue where the default tsmult value was int, not float
- support passing scalars to the initializer for a single stress period
- implement eq. we can't use the one from dataclass, lists play nice with == but not numpy arrays, and dataclasses.field doesn't let you override the comparator. but attrs does and we could make ModelTime an attrs class when we bring that dependency in, as planned for 4.x
* Add ignore to avoid pushing vs related files.

* Ensure that loop over files only runs if array was initialized with paths. This check prevents the function to throw TypeError: "NoneType" object is not iterable.

* Skip comment lines in all GMG dataset reads

* Moves visual studio gitignore reference under #IDE files

* Running lint (ruff) on mfgmg.py after solver datasets comment lines skipping.

---------

Co-authored-by: Paulo Casado <pcasado@waterloohydrogeologic.com>
Co-authored-by: Paulo Casado <pcasado@waterloohydrogeologic.com>
Simulation and model TOML DFN files are now named without -nam, but flopy still assumes that naming in some places. Just workaround it until 4.x
While the TOML DFN stuff in devtools evolves rapidly for our flopy prototyping needs, pin it.
dependabot bot and others added 28 commits August 12, 2025 07:36
* fix issues related to old temporal reference

* fix test errors in flow problems, and start working on transport tests

* Resolve conflits arose from merge changes to mfusg #1

* Resolve conflicts arose from changes mfusg

* Resolve all conflicts arise from mfusg changes made by hzhang4

* Ruff linting ...

* linting with Ruff ..

* use flopy_oi in mbase

* Address PR comments and use relpath_safe

* Run Ruff after addressing  PR comments

* minor Ruff linting ..

* Remove redundant files and apply minor Ruff linting ..

* Remove redundant files ..

* remove docx file ..
Pytest parametrization was set up for a few tests such that collection triggered generation of test cases. This presented as a failure to find binaries needed to generate test models.

Test cases (models/etc) should only be created when tests are run. At collection time only case names are needed.

This should make flopy play nice with VSCode and other IDEs' integrated test runners.
This PR only modifies whitespace with no other refactors. Some of these are identified with a local pre-commit configuration.

- Convert the line-endings of a few .py files from CRLF (\r\n on Windows) to CR (\n on Unix), which is the norm for git repos; usually these auto-convert to CRLF on repo cones on Windows
- Use trailing-whitespace to clip lines with trailing whitespace (which is harmless, just inconsistent)
- Use end-of-file-fixer to makes sure files end in a newline
Co-authored-by: mjreno <mjreno@IGSAAA071L01144.gs.doi.net>
This applies a few sets of Pylint rules available with Ruff:

* Convention (PLC), except PLC0415
* Error (PLE)
* A few from Refactor (PLR), enforcing PLR0402 and PLR2044. A subset of fixes from PLR6201 are applied, but not enforced.
* Warning (PLW), except PLW1641 and PLW2901
This refactor is mostly related to PathLike and curdir from the os module.

- Import these items to use as (e.g.) PathLike or os.PathLike
- Try to make docstrings related to these more consistent
- Replace typing Optional[Union[...]] with Union[..., None]
This makes base mf6 classes and in the jinja codegen template docstrings more consistent, among other changes detailed here:

- Move primary class initialization documentation from "init" to "class" (since the default for Sphinx's autoclass_content is 'class', thus class docs are rendered preferentially over init docs). Keep a short docstring for init, which does not get rendered by Spinx, but satisfies (e.g.) D107.
- Consistent case and punctuation for parameter descriptions; add defaults or tag as optional.
- Mirror parameter descriptions in base .py class and in .jinga templates, checking they also match function signatures.
- Adjust function calls to use more keyword parameters than positional to guard against API changes.
- Move static functions out of Filters (in flopy.mf6.utils.codegen.filters), since it wasn't used as an OOP class; only minor changes to the filter functions were required (e.g. renaming variables to distinguish them from functions with the same name).
- Mark TODO for a Dfn bug with "items" in the "children" filter (issue not raised yet, but will be described soon)
- Adjust generate_classes command to allow --no-verbose to turn off verbose (default remains with --verbose on).
This fixes an issue when using MfUsgCln with the default unitnumber option. Also improve docstrings for the init constructor using numpydoc format.

This fix is for the following issue taken from the docstring example (with a few mods):

import flopy
ml = flopy.mfusg.MfUsg()
node_prop = [
    [1, 1, 0, 10.0, -110.0, 1.57, 0, 0],
    [2, 1, 0, 10.0, -130.0, 1.57, 0, 0],
]
cln_gwc = [
    [1, 1, 50, 50, 0, 0, 10.0, 1.0, 0],
    [2, 2, 50, 50, 0, 0, 10.0, 1.0, 0],
]
cln_circ = [[1, 0.5, 3.23e10]]
cln = flopy.mfusg.MfUsgCln(ml, ncln=1, iclnnds=-1, nndcln=2,
    nclngwc=2, node_prop=node_prop, cln_gwc=cln_gwc, cln_circ=cln_circ)

    Traceback (most recent call last):
    File "", line 12, in
    cln = flopy.mfusg.MfUsgCln(ml, ncln=1, iclnnds=-1, nndcln=2,
    nclngwc=2, node_prop=node_prop, cln_gwc=cln_gwc, cln_circ=cln_circ)
    File "/home/mtoews/src/FloPy/flopy/flopy/mfusg/mfusgcln.py", line 235, in init
    setattr(self, f"i{attr}", int(unitnumber[idx + 1]))
This PR keeps the codebase on-top of preview changes from ruff check --preview (now at v0.13.0).

Also addresses upstream change MODFLOW-ORG/modflow-devtools#236

The "statistics" of preview issues before this PR is:

$ ruff check --preview --statistics
383	PLW1514	[ ] unspecified-encoding
 70	RUF031 	[*] incorrectly-parenthesized-tuple-in-subscript
 65	PLC1901	[ ] compare-to-empty-string
 26	E266   	[*] multiple-leading-hashes-for-block-comment
 25	PLC2801	[ ] unnecessary-dunder-call
 19	RUF047 	[*] needless-else
 14	E262   	[*] no-space-after-inline-comment
 13	RUF052 	[ ] used-dummy-variable
 11	C419   	[ ] unnecessary-comprehension-in-call
  9	PLW3201	[ ] bad-dunder-method-name
  6	RUF039 	[ ] unraw-re-pattern
  4	C409   	[ ] unnecessary-literal-within-tuple-call
  3	PLC2701	[ ] import-private-name
  1	PLW0108	[ ] unnecessary-lambda
Found 649 errors.
[*] 134 fixable with the `--fix` option (414 hidden fixes can be enabled with the `--unsafe-fixes` option).

This is PR is a combination of automated fixes and manual fixes.
Add a parameter 'variable' to the CellBudgetFile.get_ts() method defaulting to "q"
#2574 was evidently not sufficient to fix all pyvista notebook issues in CI. for some reason pyvista now can't be found on mac and windows. problem does not occur on linux. just skip the pyvista notebook on mac and windows
#2604)

Accommodate 'prerelease' attribute recently added to some MF6 DFNs. Add a `--releasemode` option to the codegen tool. By default everything is included, release mode filters out prerelease variables.

Also just print summaries by default. Make verbose mode opt-in
set attrs to None if not provided to initializer

    self.cuzinf
    self.cuzet
    self.cgwet
* update(optimize_splitting_mask): add `active_only` flag

Closes #2576
Fix #2599. Recarray columns were missing. Now mfgwegwe.py looks OK. Hopefully didn't break anything else.
Also pin syrupy < 5.0.0 as they have changed some things (e.g. snapshot naming conventions) that break tests.
Fix #2233. Comments were not preserved in external files with the pandas list impl. The old mflist impl supports comments. Add pre_data_comments machinery to the pandas list impl, coping some code verbatim. Awkward but seems to work.
prep for release with mf6. other than upstream options modifications, no changes besides docstring improvements
Fix #2170, support mf6 models with dis and disv grids, no disu yet
…ks in docs and tests (#2617)

* create get_anglex method

* rename notebooks for tests

* use MfUsgBas which has richards attribute

* use MfUsgBas which has richards attribute

* update some of the lpf dostring

* set structured to false if disu is used

* fix path autotest

* read con file differently

* fix pfas example

* some extra comments for clarity

* fix missing file

* revert changes to lake nb

* ignore failing notebooks

* update tutorials.rst

---------

Co-authored-by: wpbonelli <wbonelli@ucar.edu>
@wpbonelli wpbonelli marked this pull request as ready for review September 29, 2025 20:31
@wpbonelli wpbonelli merged commit ebfef0e into master Sep 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.