Skip to content

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

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

Merged
merged 11 commits into from
Mar 14, 2025

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.15385% with 8 lines in your changes missing coverage. Please review.

Project coverage is 74.8%. Comparing base (bb9824e) to head (e6afa43).
Report is 68 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/mf6/utils/model_splitter.py 96.5% 7 Missing ⚠️
flopy/plot/map.py 50.0% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2465     +/-   ##
=========================================
+ Coverage     68.4%   74.8%   +6.4%     
=========================================
  Files          294     296      +2     
  Lines        59390   62736   +3346     
=========================================
+ Hits         40652   46977   +6325     
+ Misses       18738   15759   -2979     
Files with missing lines Coverage Δ
flopy/mf6/utils/output_util.py 74.4% <100.0%> (+2.0%) ⬆️
flopy/plot/map.py 82.1% <50.0%> (+2.0%) ⬆️
flopy/mf6/utils/model_splitter.py 74.0% <96.5%> (+15.2%) ⬆️

... and 254 files with indirect coverage changes

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

@mjr-deltares
Copy link
Contributor

@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.

Hi @jlarsen-usgs , I forgot to answer you last week but it's on my radar now. Thanks for making these changes!

@jlarsen-usgs
Copy link
Contributor Author

ssm updates included in PR. Closes #2474

@jlarsen-usgs jlarsen-usgs merged commit 20829b7 into modflowpy:develop Mar 14, 2025
30 of 32 checks passed
wpbonelli pushed a commit to MODFLOW-ORG/modflow6 that referenced this pull request Mar 18, 2025
updates for model splitter node mapping changes, corresponds to modflowpy/flopy#2465
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.

2 participants