Skip to content

Route param.* keys from porespy dicts into network params#3046

Merged
ma-sadeghi merged 1 commit intodevfrom
fix/route-param-keys-from-porespy
Apr 28, 2026
Merged

Route param.* keys from porespy dicts into network params#3046
ma-sadeghi merged 1 commit intodevfrom
fix/route-param-keys-from-porespy

Conversation

@ma-sadeghi
Copy link
Copy Markdown
Member

@ma-sadeghi ma-sadeghi commented Apr 26, 2026

When loading a porespy network dict via network_from_porespy, the network.update(net) call bypasses Network.__setitem__, so any param.* 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 _params before __init__ has set it up.

Fix is to pop param.* keys before update() and assign them individually so they go through the proper code path.

This pairs with PMEAL/porespy#1165, which starts emitting param.voxel_size and param.ndim from network extraction so they can be used downstream (e.g., for rescale_network).

`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
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.8%. Comparing base (78a83c8) to head (d057aee).
⚠️ Report is 5 commits behind head on dev.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ma-sadeghi ma-sadeghi merged commit 40e90db into dev Apr 28, 2026
13 checks passed
@ma-sadeghi ma-sadeghi deleted the fix/route-param-keys-from-porespy branch April 28, 2026 11:36
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