Route param.* keys from porespy dicts into network params#3046
Merged
ma-sadeghi merged 1 commit intodevfrom Apr 28, 2026
Merged
Route param.* keys from porespy dicts into network params#3046ma-sadeghi merged 1 commit intodevfrom
param.* keys from porespy dicts into network params#3046ma-sadeghi merged 1 commit intodevfrom
Conversation
`network.update(net)` bypasses `Network.__setitem__`, so any `param.*` entries in the porespy dict landed as raw items instead of being routed into `_params`. That broke project save/load round-trips. Pop them out first and assign individually so they go through the proper code path.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3046 +/- ##
=======================================
+ Coverage 87.7% 87.8% +0.1%
=======================================
Files 151 151
Lines 8879 8882 +3
=======================================
+ Hits 7792 7804 +12
+ Misses 1087 1078 -9 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When loading a porespy network dict via
network_from_porespy, thenetwork.update(net)call bypassesNetwork.__setitem__, so anyparam.*entries land as raw dict items instead of being routed into_params. That breaks project save/load round-trips: pickle re-invokes__setitem__on load, which tries to write to_paramsbefore__init__has set it up.Fix is to pop
param.*keys beforeupdate()and assign them individually so they go through the proper code path.This pairs with PMEAL/porespy#1165, which starts emitting
param.voxel_sizeandparam.ndimfrom network extraction so they can be used downstream (e.g., forrescale_network).