You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a standard install of sagemath 10.4, run the following code.
G = Graph(1, data_structure="dense")
H = loads(dumps(G))
print(G == H) # True
print(isinstance(G._backend, sage.graphs.base.dense_graph.DenseGraphBackend)) # True
print(isinstance(H._backend, sage.graphs.base.sparse_graph.SparseGraphBackend)) # True
On my system, I get
True
True
True
Expected Behavior
The backend data structure of a graph is preserved upon pickling and unpickling.
Actual Behavior
The backend is not preserved and falls back to the default (sparse) backend.
Additional Information
This is a bug, as I want to use process-level parallelism in some loops that generate graphs. With standard tools such as joblib, multiprocessing, concurrent.futures, this requires some pickling and unpickling. But my code needs the backends of the graphs to be the DenseGraph implementation and this bug prevents me from using these tools.
Environment
OS: MacOS Sequoia 15.0.1
Sage Version: 10.4 (binary distribution from 3-manifolds project)
Checklist
I have searched the existing issues for a bug report that matches the one I want to file, without success.
I have read the documentation and troubleshoot guide
The text was updated successfully, but these errors were encountered:
Steps To Reproduce
In a standard install of sagemath 10.4, run the following code.
On my system, I get
Expected Behavior
The backend data structure of a graph is preserved upon pickling and unpickling.
Actual Behavior
The backend is not preserved and falls back to the default (sparse) backend.
Additional Information
This is a bug, as I want to use process-level parallelism in some loops that generate graphs. With standard tools such as joblib, multiprocessing, concurrent.futures, this requires some pickling and unpickling. But my code needs the backends of the graphs to be the DenseGraph implementation and this bug prevents me from using these tools.
Environment
Checklist
The text was updated successfully, but these errors were encountered: