Skip to content

Modflow-setup v0.6.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 06 Jan 17:11

Changes in this Release:

0.6.0 (2025-01-06)

Features

  • Add support for local grid refinement models that only occupy some layers of the enclosing parent model (e227abd; 915af2b)
  • wells.py::setup_wel_data: add layer assignment from screen top/botm to wells: dictionary input option to facilitate easier testing. LGR parent models, remove wells with >50% of their open interval within the LGR child area; LGR child models, remove wells with <50% of their open interval within the LGR child area. This ensures that pumping wells aren't included twice in a partial vertical LGR case (due to the automated well rellocation routines). Add any dropped wells to dropped_wells_file. (29c0793)
  • grid.rasterize; shapefile source data: add exclude_features option to include all features in a shapefile except for those specified (5fc8852)
  • initial conditions/strt array setup: add option to explicitly set starting heads from parent starting heads (3acaff3)
  • Lake Package: direct flux input by lake and by period (4874e68)

Bug Fixes

  • ci::test_mf6_shellmound.py::test_rch_setup: relative pct difference issue on osx (de23952)
  • discretization.py:fill_empty_layers: get_next_above() was not actually returning the next layer above because of incorrect sorting. Include the model top when filling missing layers, in case there are all nans in the botm array; introducing nans into the top can cause issues with partical vertical LGR. (f299aac)
  • equality.py: add support for Flopy mf6.mfbase.PackageContainer class (d90e2ac)
  • equality.py::package_eq: skip packages within packages to avoid RecursionError in Flopy < 3.9 (79f5f79)
  • fileio.py: uint overflow error that was occuring on macos CI with python 3.10 (recast unit arrays to int) (e2b094a)
  • fileio.py::flopy_mfsimulation_load: _package_container AttributeError for Flopy<3.9 (4eee111)
  • fileio.py::set_cfg_paths_to_absolute: don't touch file paths within the 'lgr': 'cfg' sub-block (when LGR inset configuration is supplied in the same file; this is mostly done in a test context). (6224038)
  • grid.py: more fixes to logic for snapping grid to parent model, esp. for grids based on buffers around features (4f7a616)
  • grid.py::setup_structured_grid: when snapping to parent grid, snap lower left corner to nearest vertex, since lower left is what is typically specified (previously was snapping upper left corner to upper left vertex, which could lead to unexpected results if lower left y was specified slighly greater than the bottom edge of the desired parent cell). Fix potential inconsistency with lower left and upper left corners by recalculating after grid is snapped. (d4ab2b2)
  • ic.py: handle cases where there is no strt source data configuration or default parent model source data. Add error trap for invalid strt source data and additional testing of strt input options. (d519aac)
  • initial conditions/strt array setup: add option to explicitly specify strt: from_model_top in source_data: block; needed in the case where there is a parent model and default_source_data is set to True. In this case, the default behavior was to set strt from the strt array in the parent model. (30c7437)
  • lakes.py::get_flux_variable_from_config: support direct flux input (precip, evap., etc) by lake; for MODFLOW 6 models, more direct flux input to perioddata: sub-block (c3f4e4d)
  • MF6model._set_idomain: Don't inactivate Lake BCs for MF6 models (f73ac5d)
  • mf6model.write_input: handle cases of single model or multi-model LGR simulation by working with the simulation-level model dictionary to implement model write functionality that is not included in the simulation-level write_simulation(). Previously, BCs were presumably not getting removed from inactive cells, auxillary header information such as modflow-setup and model version were not getting written to child model package files, and child model SFR packagedata was not getting written to an external file. (59d16e2)
  • MF6model.write_input: don't check for mover package if mover is in the SFR options block (not clear that this check is needed). Previously was not passing mover option if simulation-level mover package not found. (f9cc793)
  • MF6model.write_input: handle case of single obs package (b805399)
  • mfsetup/fileio.py: refactor flopy_mfsimulation_load() and flopy_mf6model_load() for compatibility with flopy f378f84a5677b99191ce178bb1c5b67ac1d1bd66 (2db8803)
  • mfsetup/tmr.py: geopandas.sjoin 'op' arg to 'predicate' (cdbe9e2)
  • mover.py::get_sfr_package_connections: refactor to use GWFGWF exchanges and a threshold distance to determine SFR Package connections between a parent and inset/child LGR model. This fixes previous issue where SFR streams meandering in and out of the inset model were not getting connected to the parent model (due to SFRmaker connecting the segments within either model). (e63abdc)
  • mover.py::get_sfr_package_connections: when two outlets are connected across a LGR model interface and the connection threshold distance is large, a circular or double connection going both ways between the two models may result, which can prevent the Mover Package from converging in the simulation. This issue was fixed by adding a check for double connections, and then only retaining the connection with the smallest distance (which should always be correct if the flowline input to the SFR Package was digitized correctly). (fbe1bb1)
  • partial vertical LGR: remove hard-coding in sourcedata.py::setup_array that was causing vertical gaps between LGR inset and parent models with horizontal refinments other than 5. (870c0b7)
  • pyproject.toml: add tomli; python_version < 3.11 to requires; potential fix for pip install issue (missing setup.cfg) that seems to occur with python<3.11. Re-add python 3.10 to test.yaml matrix; bump checkout action to v4 (ae98587)
  • SFR Package water mover setup for LGR models: apparently the mover package file reference was not getting written to the GWFGWF Exchange file in at least some cases. Integrate GWFGWF and Mover setup; pass gwfgwf object instance to ModflowMvr constructor and add test for reference in gwfgwf file. (cd9deb7)
  • sourcedata.py: when setting up the bottom array(s), only make edits to the model top if the lake package is being built, and a lake bathymetry raster was supplied (to be subtracted from the initial model top, which presumably represents a typical lake surface elevation, so that the model top is set at the lake bottom. (1a5a87e)
  • sourcedata.py; MFnwtModel: add _drop_thin_cells=False attribute to MFnwtModel for consistency with MF6model; only expand thin cells to the minimum thickness if drop_thin_cells=False; otherwise rounding errors can lead to inconsistent cell pinchouts (afa9b2a)
  • sourcedata.py::setup_array: for LGR inset models with default_source_data=True, don't copy idomain from parent (which will result in all inactive cells in the inset model). (818c192)
  • sourcedata.py::setup_array: only make adjustments involving the original model top in a model creation context (not when working with a loaded model) (99de146)
  • tdis.py::aggregate_xarray_to_stress_period: copy period_stat input so that it doesn't get modified by multiple function calls; this affected instances where list input to a period_stats sub-block was supplied for one period in an multi-stress period model (causing it to be repeated), or to multiple periods. (abcd43c)

Build Systems

  • deps: bump actions/checkout from 3 to 4 (6476c53)
  • deps: bump JamesIves/github-pages-deploy-action (52d0ecb)
  • deps: bump JamesIves/github-pages-deploy-action (8108bec)
  • deps: bump JamesIves/github-pages-deploy-action (db22f22)

Documentation

  • config-file: add note about whitespace-delimited dictionary input in YAML (07a215e)
  • Add page on initial conditions setup; with example script for updating starting heads from a previous run (b93bb18)
  • remove html_theme_path; deprecated in Sphinx>=8 (e0c82cb)
  • update release notes and readme (c8fbf85)

Code Refactoring

  • bcs.py:setup_basic_stress_data: for models with LGR, drop non-well BCs within LGR areas. (assumes that CHD, DRN, GHB, and RIV cells all represent surface or near-surface features that should be represented in the LGR child model(s) and not the parent model). (cd7ae9e)
  • discretization.fill_cells_vertically): only return bottom array, since top shouldn't be modified; refactor(sourcedata.setup_array: move resetting of model top to branch where the top modified by supplied lake bathymetry (since this should be the only situation where this is needed) (089e51c)
  • discretization.make_lgr_domain: add error trap for LGR grid corners outside of the parent model grid (a2a514c)
  • grid.py: relax requirement that parent and inset model grids must exactly align when snap_to_parent=True. For example, we may want a model that is aligned, but only every n cells, because of grid size considerations. (09777da)
  • mfmodel; fileio.load_cfg): non-conprehensive pathlib conversions; tests(conftest.py: convert path fixtures to pathlib objects (077972d)
  • mfmodel.py: add error trap for missing setup_grid input; fix error message in mf6model.py (e1f64ef)
  • Pleasant_lake_lgr_example.ipynb: center example parent model around inset model after changes to grid-snapping; include lake connections in layer 0 (default for MF6 is now to keep layer 1 active and simulate lake above layer 1) (907a0b3)

Continuous Integration

  • test_environment.yaml: pin numpy<2.1 for now, to avoid this shapely error: shapely/shapely#2098 (9cc21cb)
  • test.yaml: turn off fail-fast (f974ec3)
  • add GitHub dependabot for ci dependency management (965640f)
  • revert to mamba-org/setup-micromamba@v1 (9f1f7d2)
  • switch to setup-micromamba@v2; try removing init-shell arg; not clear that this was ever needed (e02d088)
  • release.yml: setup automated releases from PRs (d683dd0)