sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.47k stars 488 forks source link

Chart: Implement pickling via __getstate__/__setstate__ #31901

Open mkoeppe opened 3 years ago

mkoeppe commented 3 years ago

In this ticket, we implement the pickling protocol using __getstate__ and __setstate__

Depends on #31894

CC: @egourgoulhon @tscrim @mjungmath

Component: manifolds

Work Issues: redo on top of #31894

Branch/Commit: u/mkoeppe/chartno_longer_use_uniquerepresentation_implementgetstate___setstate @ 30a5d0b

Issue created by migration from https://trac.sagemath.org/ticket/31901

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

bf62543Merge branch 't/32089/conditionset__conditionset_callable_symbolic_expression' into t/32009/eliminate_direct_use_of_the_chart__domain_attribute
2f47485Merge #32009
21297f3Merge #32009
deace83Chart: Replace _init_coordinates by _parse_coordinates
4db4995Chart: Fix up `__classcall__` and _parse_coordinates by avoiding unhashable things
fc59c9dChart.__classcall__: Add doctest
1742fdcMerge #32009
9ac1834src/sage/manifolds/chart.py: Add raw string marker
d7f9d17Merge #32116
30a5d0bChart: WIP getstate/setstate, no UniqueRepresentation
mkoeppe commented 3 years ago

Changed dependencies from #31688, #32112, #32102 to #31894

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,8 +1,2 @@
-Because of the method `add_restrictions` (which changes `self` by adding codomain restrictions), `Chart` needs to be considered as a mutable class. The current pickling based on `UniqueRepresentation` therefore cannot work correctly. 
+In this ticket, we implement the pickling protocol using `__getstate__` and `__setstate__`

-In this ticket,
-- we implement the pickling protocol using `__getstate__` and `__setstate__`
-- we implement the mutability protocol
-
-This is also preparation for #31894.
-
mkoeppe commented 3 years ago

Changed work issues from redo without mutability on top of #32102 to redo on top of #31894