Skip to content

allow graphView to be pickled and unpickled#232

Merged
JoOkuma merged 2 commits intomainfrom
pickling
Dec 11, 2025
Merged

allow graphView to be pickled and unpickled#232
JoOkuma merged 2 commits intomainfrom
pickling

Conversation

@TeunHuijben
Copy link
Copy Markdown
Contributor

Previously, (un)pickling the graphView gave problems, because the _edge_from_{from/to}_root bidict got duplicated and was no longer coupled.

In this PR, we add getstate/setstate methods to the GraphView and mappedGraphMixin to make the bidict picklable.

@TeunHuijben
Copy link
Copy Markdown
Contributor Author

Two questions for @JoOkuma:

  • is it okay that the tests only run for GraphView backend, and not for the standard graphs? Shouldn't we be able to pickle any graph?
  • the problem with pickling the other graphs, is that the graph_backend fixture adds the _add_node_with_index methodsto the class, which gives problems during unpickling

@TeunHuijben TeunHuijben requested a review from JoOkuma December 11, 2025 18:54
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.37%. Comparing base (f14aaa4) to head (c1268b4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   88.40%   88.37%   -0.04%     
==========================================
  Files          55       55              
  Lines        3873     3940      +67     
  Branches      674      690      +16     
==========================================
+ Hits         3424     3482      +58     
- Misses        267      276       +9     
  Partials      182      182              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@JoOkuma
Copy link
Copy Markdown
Member

JoOkuma commented Dec 11, 2025

Hi @TeunHuijben, I did my review as PR in #233 , can you check if you agree with them?

* improving testing

* removing old comment
@JoOkuma JoOkuma merged commit daba108 into main Dec 11, 2025
7 checks passed
@JoOkuma JoOkuma deleted the pickling branch December 11, 2025 20:29
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.

3 participants