Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
60f0cfb
ci(release): update version to 3.10.0.dev2
wpbonelli Feb 12, 2025
f6e69e9
Merge pull request #2452 from modflowpy/post-release-3.9.2-reset
wpbonelli Feb 12, 2025
ca3adb3
fix(resolve_exe): typecast exe name to string before passing to _reso…
martclanor Feb 20, 2025
39d8d32
fix(HeadFile,CellBudgetFile): fix tdis reversal (#2460)
wpbonelli Feb 25, 2025
91717dc
chore(deps): bump dawidd6/action-download-artifact from 8 to 9 (#2461)
dependabot[bot] Feb 28, 2025
c850476
chore: rename (#2463)
wpbonelli Mar 3, 2025
c61643f
refactor(resolve_exe): also fix tests (#2464)
mwtoews Mar 3, 2025
61e52f0
fix(output_util.py): trap grb in MF6Output (#2468)
wpbonelli Mar 7, 2025
96f3b49
chore: drop python 3.9 (#2467)
wpbonelli Mar 7, 2025
c5b5a41
refactor(createpackages): use jinja for mf6 module code generation (#…
wpbonelli Mar 7, 2025
20829b7
update(Mf6Splitter): change how node mapping is stored and loaded (#2…
jlarsen-usgs Mar 14, 2025
3cf92c1
chore: update python support policy in dev docs (#2470)
wpbonelli Mar 15, 2025
02ab7f1
fix(binaryfile): tdis in head/budget reversal methods (#2475)
wpbonelli Mar 18, 2025
37c5483
baseline writing fully gridded aux variables
Mar 11, 2025
378684f
support reading strings from grb file
Mar 20, 2025
932bdcc
feat(modeltime): add from_headers and reverse methods (#2481)
wpbonelli Mar 29, 2025
48f46fb
refactor(gridutil): improve arg handling in get_disu_kwargs (#2480)
wpbonelli Apr 1, 2025
0eba4ba
fix(binaryfile): fix head/budget file reversal (#2483)
wpbonelli Apr 1, 2025
1026362
Merge pull request #2478 from mjreno/grb_string
mjreno Apr 8, 2025
46af22b
assign read_as_arrays based on dfn specification
Apr 11, 2025
d8048a8
feat: add the angldegx to the kw dictionary produced by the get_disu_…
Manangka Apr 14, 2025
e2af433
load gridded aux variables
Apr 14, 2025
eb91c4d
Merge pull request #2471 from mjreno/auxvar_grid
mjreno Apr 15, 2025
227c162
baseline handling for optional evt fields
Apr 17, 2025
91d4344
add baseline tests
Apr 18, 2025
9434323
additional testing
Apr 21, 2025
214293b
add missing check
Apr 21, 2025
bf02be0
fix(flopy/utils/sfroutputfile.py::SfrFile.get_results): refactor depr…
aleaf Apr 21, 2025
e546a2c
chore: format test_sfr.py (#2492)
wpbonelli Apr 21, 2025
674f343
add additional helper
Apr 22, 2025
838b37c
fix(model_splitter.py): add trap for obs packages in bc packages (#2493)
jlarsen-usgs Apr 22, 2025
dcba9cf
fix(evt): optional field mishandling (#2490)
mjreno Apr 23, 2025
1b9d606
Revert "fix(evt): optional field mishandling (#2490)"
mjreno Apr 24, 2025
30be039
Merge pull request #2494 from modflowpy/revert-2490-evt_opt_fields
mjreno Apr 24, 2025
761db60
chore(deps): bump astral-sh/setup-uv from 5 to 6 (#2495)
dependabot[bot] Apr 25, 2025
7eb7c88
restore build_type_list overrides indexing
Apr 25, 2025
4783839
Merge pull request #2496 from mjreno/evt_opt_fields
mjreno Apr 26, 2025
2e452ba
ci: pin meson to 1.3.0 in requirements.mf6.txt (#2499)
wpbonelli Apr 30, 2025
4d1c9d2
chore: fix conda environment.yml syntax (#2500)
wpbonelli May 5, 2025
82d9806
chore: use python>=3.10 in conda env, fix map plot example (#2501)
wpbonelli May 5, 2025
998f833
ci: multiple fixes (#2503)
wpbonelli May 6, 2025
0d9c914
fix: update numpy array comparisons to use isin (#2504)
emmanuel-ferdman May 6, 2025
1464053
update(model_splitter.py): support for SSM and ATS (#2505)
jlarsen-usgs May 8, 2025
351c5b7
fix(column lengths): autoscale array write to ncol for structured mul…
jlarsen-usgs May 12, 2025
69f6e09
refactor(codegen): move dfn utils from devtools (#2508)
wpbonelli May 13, 2025
8fab8af
ci(release): set version to 3.9.3, update components from DFN files, …
github-actions[bot] May 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .docs/Notebooks/mf6_complex_model_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@
0.5,
0.3,
0.1,
None,
)
evt = flopy.mf6.ModflowGwfevt(
gwf,
Expand Down
66 changes: 66 additions & 0 deletions .docs/Notebooks/mf6_parallel_model_splitting_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,3 +768,69 @@ def string2geom(geostring, conversion=None):
sa = np.array(seg)
ax.plot(sa[:, 0], sa[:, 1], "b-")
# -

# ### Save node mapping data
#
# The `save_node_mapping()` method allows users to save a HDF5 representation of model splitter information that can be reloaded and used to reconstruct arrays at a later time

# +
filename = workspace / "node_mapping.hdf5"
mfsplit.save_node_mapping(filename)
# -

# ### reloading node mapping data
#
# The `load_node_mapping()` method allows the user to instantiate a Mf6Splitter object from a hdf5 node mapping file for reconstructing output arrays

# +
mfs = Mf6Splitter.load_node_mapping(filename)
# -

# Reconstruct heads using the `Mf6Splitter` object we just created

# +
model_names = list(new_sim.model_names)
head_dict = {}
for modelname in model_names:
mnum = int(modelname.split("_")[-1])
head = new_sim.get_model(modelname).output.head().get_alldata()[-1]
head_dict[mnum] = head

ra_heads = mfs.reconstruct_array(head_dict)
ra_watertable = flopy.utils.postprocessing.get_water_table(ra_heads)
# -

# +
with styles.USGSMap():
fig, axs = plt.subplots(nrows=3, figsize=(8, 12))
diff = ra_heads - heads
hv = [ra_heads, heads, diff]
titles = ["Multiple models", "Single model", "Multiple - single"]
for idx, ax in enumerate(axs):
ax.set_aspect("equal")
ax.set_title(titles[idx])

if idx < 2:
levels = contours
vmin = hmin
vmax = hmax
else:
levels = None
vmin = None
vmax = None

pmv = flopy.plot.PlotMapView(modelgrid=gwf.modelgrid, ax=ax, layer=0)
h = pmv.plot_array(hv[idx], vmin=vmin, vmax=vmax)
if levels is not None:
c = pmv.contour_array(
hv[idx], levels=levels, colors="white", linewidths=0.75, linestyles=":"
)
plt.clabel(c, fontsize=8)
pmv.plot_inactive()
plt.colorbar(h, ax=ax, shrink=0.5)

ax.plot(bp[:, 0], bp[:, 1], "r-")
for seg in segs:
sa = np.array(seg)
ax.plot(sa[:, 0], sa[:, 1], "b-")
# -
2 changes: 1 addition & 1 deletion .docs/Notebooks/plot_map_view_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
sim_name = "freyberg"

# Set the paths
tempdir = TemporaryDirectory(delete=False)
tempdir = TemporaryDirectory()
modelpth = Path(tempdir.name)

# Check if we are in the repository and define the data path.
Expand Down
12 changes: 7 additions & 5 deletions .docs/md/generate_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

MODFLOW 6 input continues to evolve as new models, packages, and options are developed, updated, and supported. All MODFLOW 6 input is described by DFN (definition) files, which are simple text files that describe the blocks and keywords in each input file. These definition files are used to build the input and output guide for MODFLOW 6. These definition files are also used to automatically generate FloPy classes for creating, reading and writing MODFLOW 6 models, packages, and options. FloPy and MODFLOW 6 are kept in sync by these DFN (definition) files, and therefore, it may be necessary for a user to update FloPy using a custom set of definition files, or a set of definition files from a previous release.

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):
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.

**Note**: to use this functionality, the `codegen` optional dependency group must be installed.

```bash
$ python -m flopy.mf6.utils.generate_classes
Expand All @@ -19,9 +21,9 @@ $ python -m flopy.mf6.utils.generate_classes

************************************************************************
Updating the flopy MODFLOW 6 classes
Updating the MODFLOW 6 classes using MODFLOW-USGS/modflow6/master
Downloading MODFLOW 6 repository from https://github.com/MODFLOW-USGS/modflow6/archive/master.zip
Downloading https://github.com/MODFLOW-USGS/modflow6/archive/master.zip
Updating the MODFLOW 6 classes using MODFLOW-ORG/modflow6/master
Downloading MODFLOW 6 repository from https://github.com/MODFLOW-ORG/modflow6/archive/master.zip
Downloading https://github.com/MODFLOW-ORG/modflow6/archive/master.zip
file size: 15,821,180 bytes

total download time: 0.88 seconds
Expand Down Expand Up @@ -65,7 +67,7 @@ user.

options:
-h, --help show this help message and exit
--owner OWNER GitHub repository owner; default is 'MODFLOW-USGS'.
--owner OWNER GitHub repository owner; default is 'MODFLOW-ORG'.
--repo REPO Name of GitHub repository; default is 'modflow6'.
--ref REF Branch name, tag, or commit hash to use to update the
definition; default is 'master'.
Expand Down
2 changes: 1 addition & 1 deletion .docs/md/get_modflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Other auto-select options are only available if the current user can write files

## Selecting a distribution

By default the distribution from the [`MODFLOW-USGS/executables` repository](https://github.com/MODFLOW-USGS/executables) is installed. This includes the MODFLOW 6 binary `mf6` and over 20 other related programs. The utility can also install from the main [MODFLOW 6 repo](https://github.com/MODFLOW-USGS/modflow6) or the [nightly build](https://github.com/MODFLOW-USGS/modflow6-nightly-build) distributions, which contain only:
By default the distribution from the [`MODFLOW-ORG/executables` repository](https://github.com/MODFLOW-ORG/executables) is installed. This includes the MODFLOW 6 binary `mf6` and over 20 other related programs. The utility can also install from the main [MODFLOW 6 repo](https://github.com/MODFLOW-ORG/modflow6) or the [nightly build](https://github.com/MODFLOW-ORG/modflow6-nightly-build) distributions, which contain only:

- `mf6`
- `mf5to6`
Expand Down
2 changes: 1 addition & 1 deletion .docs/md/optional_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Dependencies for optional features are listed below. These may be installed with
| `.resample_to_grid()` in `flopy.utils.rasters` | **scipy.interpolate** |
| `.interpolate()` in `flopy.mf6.utils.reference` `StructuredSpatialReference` class | **scipy.interpolate** |
| `.get_authority_crs()` in `flopy.utils.crs` | **pyproj** >= 2.2.0 |
| `.generate_classes()` in `flopy.mf6.utils` | [**modflow-devtools**](https://github.com/MODFLOW-USGS/modflow-devtools) |
| `.generate_classes()` in `flopy.mf6.utils` | [**modflow-devtools**](https://github.com/MODFLOW-ORG/modflow-devtools) |
| `GridIntersect()` in `flopy.utils.gridintersect` | **shapely** |
| `GridIntersect().plot_polygon()` in `flopy.utils.gridintersect` | **shapely** and **descartes** |
| `Raster()` in `flopy.utils.Raster` | **rasterio**, **rasterstats**, **affine**, and **scipy** |
Expand Down
29 changes: 29 additions & 0 deletions .docs/md/version_changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
# Changelog
### Version 3.9.3

#### New features

* [feat(modeltime)](https://github.com/modflowpy/flopy/commit/932bdcc8c07a10148cf733c02ba9190167239066): Add from_headers and reverse methods (#2481). Committed by wpbonelli on 2025-03-29.
* [feat](https://github.com/modflowpy/flopy/commit/d8048a868b51d75039f0c3c097429144c6d44714): Add the angldegx to the kw dictionary produced by the get_disu_kwargs method (#2484). Committed by Sunny Titus on 2025-04-14.

#### Bug fixes

* [fix(resolve_exe)](https://github.com/modflowpy/flopy/commit/ca3adb34031285bc795b58fa42c4965d67278adc): Typecast exe name to string before passing to _resolve (#2457). Committed by martclanor on 2025-02-20.
* [fix(HeadFile,CellBudgetFile)](https://github.com/modflowpy/flopy/commit/39d8d32625151979d78b82e709fa46ca4f5f7d9f): Fix tdis reversal (#2460). Committed by wpbonelli on 2025-02-25.
* [fix(output_util.py)](https://github.com/modflowpy/flopy/commit/61e52f03ff69ec50b03a17c863738ad4a3c1dc4b): Trap grb in MF6Output (#2468). Committed by wpbonelli on 2025-03-07.
* [fix(binaryfile)](https://github.com/modflowpy/flopy/commit/02ab7f1ff18a5c03f06d98fe1b35d6d6f7ad12df): Tdis in head/budget reversal methods (#2475). Committed by wpbonelli on 2025-03-18.
* [fix(binaryfile)](https://github.com/modflowpy/flopy/commit/0eba4babad994a7cd73a3853714b9ff3bb326c90): Fix head/budget file reversal (#2483). Committed by wpbonelli on 2025-04-01.
* [fix(flopy/utils/sfroutputfile.py::SfrFile.get_results)](https://github.com/modflowpy/flopy/commit/bf02be00ded034d2765948c7d7b075bf9d6ed4f1): Refactor deprecated DataFrame.append() call to pandas.concat() (#2491). Committed by aleaf on 2025-04-21.
* [fix(model_splitter.py)](https://github.com/modflowpy/flopy/commit/838b37cc999c713aa7e71c4215f7535c5c9df27b): Add trap for obs packages in bc packages (#2493). Committed by Joshua Larsen on 2025-04-22.
* [fix(evt)](https://github.com/modflowpy/flopy/commit/dcba9cf5ca1d8b946b568748f713a6dcf21e2bc3): Optional field mishandling (#2490). Committed by mjreno on 2025-04-23.
* [fix](https://github.com/modflowpy/flopy/commit/0d9c91489a6a9df2c2c51c962e59cb5e9dd4ff2b): Update numpy array comparisons to use isin (#2504). Committed by Emmanuel Ferdman on 2025-05-06.
* [fix(column lengths)](https://github.com/modflowpy/flopy/commit/351c5b72401b5de52d230ef9f0897f58e4edf475): Autoscale array write to ncol for structured multi-model simulations (#2507). Committed by Joshua Larsen on 2025-05-12.

#### Refactoring

* [refactor(resolve_exe)](https://github.com/modflowpy/flopy/commit/c61643fd8d61e6e4866527104324a6c468eb0e41): Also fix tests (#2464). Committed by Mike Taves on 2025-03-03.
* [refactor(createpackages)](https://github.com/modflowpy/flopy/commit/c5b5a41f626ad24d8f0e564a83ab8dc673cc9b7b): Use jinja for mf6 module code generation (#2333). Committed by wpbonelli on 2025-03-07.
* [refactor(Mf6Splitter)](https://github.com/modflowpy/flopy/commit/20829b704b20be5175119fcd685fe808c55d51b6): Change how node mapping is stored and loaded (#2465). Committed by Joshua Larsen on 2025-03-14.
* [refactor(gridutil)](https://github.com/modflowpy/flopy/commit/48f46fb87a1a23bc13a41be881f3852fdab7d682): Improve arg handling in get_disu_kwargs (#2480). Committed by wpbonelli on 2025-04-01.
* [refactor(model_splitter.py)](https://github.com/modflowpy/flopy/commit/14640530dd46598d8d76417b6b640db0850cbf80): Support for SSM and ATS (#2505). Committed by Joshua Larsen on 2025-05-08.
* [refactor(codegen)](https://github.com/modflowpy/flopy/commit/69f6e09a8bea004454e9a83b76e5b37f8c0a7810): Move dfn utils from devtools (#2508). Committed by wpbonelli on 2025-05-13.

### Version 3.9.2

#### New features
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
Expand All @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -80,13 +80,16 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
cache-dependency-glob: "**/pyproject.toml"

- name: Install FloPy
run: uv sync

- name: Install seaborn
run: uv pip install seaborn

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
ref: ["develop", "master", "6.4.1", "4458f9f", "4458f9f7a6244182e6acc2430a6996f9ca2df367"]
defaults:
run:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
enable-cache: false

Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
enable-cache: false

Expand All @@ -71,14 +71,14 @@ jobs:
shell: bash
timeout-minutes: 10
env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: '3.10'

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
cache-dependency-glob: "**/pyproject.toml"

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
Expand All @@ -127,7 +127,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
Expand All @@ -34,7 +34,9 @@ jobs:
powershell

- name: Install FloPy
run: pip install .
run: |
pip install .
pip install ".[codegen]"

- name: OpenGL workaround on Linux
if: runner.os == 'Linux'
Expand Down
Loading