Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(Mf6Splitter): change how node mapping is stored and loaded #2465

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

jlarsen-usgs
Copy link
Contributor

@jlarsen-usgs jlarsen-usgs commented Mar 5, 2025

  • save_node_mapping now writes a compressed hdf5 file and stores additional modelgrid reconstruction information for original and split model representations
  • load_node_mapping changed to a static method that returns a Mf6Splitter object that can be used for array reconstruction
  • updated autotests
  • added example usage to mf6_parallel_model_splitting_example.py
  • json node mapping files no longer supported, user must rewrite node mapping files as hdf5 files.
  • bugfix for observation file naming convention on remapped obs files

* `save_node_mapping` now writes a compressed `hdf5` file and stores additional modelgrid reconstruction information for original and split model representations
* `load_node_mapping` changed to a static method that returns a Mf6Splitter object that can be used for array reconstruction
* updated autotests
* added example usage to `mf6_parallel_model_splitting_example.py`
* json node mapping files no longer supported, user must rewrite node mapping files as hdf5 files.
@jlarsen-usgs
Copy link
Contributor Author

@mjr-deltares, here are the updates to the model splitter for more efficient storage and loading of the "node mapping" files. If you'd like to give them a test, usage is as follows

mfs = Mf6Splitter(my_sim)
new_sim = mfs.split_model(array)

node_map_file = "my_node_map.h5"
mfs.save_node_mapping(node_map_file)

mfs2 = Mf6Splitter.load_node_mapping(node_map_file)

I tested this on the average annual long island model and HDF5 file processing and write time was ~5 seconds, read and reconstruction time was ~1.5 seconds, and HDF5 file size was about 63 MB, which includes information to reconstruct the original and split model grids, and the mappings to link these together.

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 96.84211% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.3%. Comparing base (bb9824e) to head (e583173).
Report is 64 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/mf6/utils/model_splitter.py 96.8% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2465     +/-   ##
=========================================
+ Coverage     68.4%   74.3%   +5.8%     
=========================================
  Files          294     293      -1     
  Lines        59390   62092   +2702     
=========================================
+ Hits         40652   46135   +5483     
+ Misses       18738   15957   -2781     
Files with missing lines Coverage Δ
flopy/mf6/utils/output_util.py 74.4% <100.0%> (+2.0%) ⬆️
flopy/mf6/utils/model_splitter.py 73.8% <96.8%> (+15.1%) ⬆️

... and 251 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant