-
-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chart: Implement pickling via __getstate__/__setstate__ #31901
Comments
This comment has been minimized.
This comment has been minimized.
Replying to @mkoeppe:
This would be nice! In the early stages of the manifold project, I did not manage to do it simply, i.e. without changing Sage's preparser, since
would generate |
comment:3
Some thought: if |
comment:4
Replying to @egourgoulhon:
Ah! That's of course a problem, I didn't realize this |
This comment has been minimized.
This comment has been minimized.
comment:6
Maybe a chart should become immutable "upon first use"? |
New commits:
|
This comment has been minimized.
This comment has been minimized.
Commit: |
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
Dependencies: #31688 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
The last obstacle is this code which tries to hash a chart when it is still mutable.
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Replying to @mkoeppe:
This is the approach that I have been trying out in this branch.
because So perhaps an API change is needed, after all... |
comment:15
In the current branch, In the code of
an unnecessary limitation? |
comment:16
A possible option to get rid of the 2-stages construction of a chart (i.e. to get rid of the requirement of invoking
or equivalently
Then we could get rid of the method |
comment:17
Replying to @egourgoulhon:
Yes, this part is not finished. I started with One can still have a fast path for equality using id, and fast lookup in sets etc. via a fast hash. |
comment:18
Replying to @egourgoulhon:
I don't really, it was just an attempt to keep the current API (initialization, followed by |
comment:19
When discussing a possible redesign of chart initialization, I think a relevant issue is the current use of the symbolic assumptions facility for the coordinates. Are two charts with a different tuple of variables allowed to share some variables? If yes, does the shared variable have to have the same global assumptions and periodicity? Also I note that creating a |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:23
Replying to @egourgoulhon:
There is already a context manager The tricky bit is when two charts are involved with overlapping variables. Then some renaming may have to be done first. A possible route is through #32089. |
comment:24
I have opened #32102 ( |
comment:25
Replying to @egourgoulhon:
I suppose we can go through a new method |
comment:26
Replying to @mkoeppe:
The issue here is that on real manifolds (by far the most used ones), the symbolic variables are created with the extra parameter
I don't like strings either, but I would prefer this to a 2-stage declaration involving
Yes. |
comment:27
Replying to @mkoeppe:
I don't see why: two computations on two distinct charts can set different assumptions on the same variable. There is no ambiguity as long as assumptions are tied to charts. |
comment:28
Replying to @egourgoulhon:
A follow-up question on this:
Clearly something went wrong here. |
comment:29
Replying to @egourgoulhon:
How about something like |
comment:31
Replying to @mkoeppe:
Good catch!
No, the above is actually a bug in |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Work Issues: redo without mutability on top of #32102 |
comment:36
Replying to @egourgoulhon:
I've opened #32120 (Chart-wise assumptions) for this. |
comment:37
Replying to @egourgoulhon:
I was thinking of computations with coordinate changes here, which involve two charts simultaneously. |
comment:38
Replying to @egourgoulhon:
We already have a meta-ticket for this, #31958 (Use the SymPy assumptions facility). I was surprised that SymPy's assumptions are not really well connected to SymPy's sets (for which I have been building some glue code in #31926). |
comment:39
Given that #32102 is making mutability unnecessary, it seems we can keep I'm setting the ticket to "sage-wishlist" for this reason. |
comment:40
Replying to @mkoeppe:
There should not by any issue with coordinate changes: a coordinate change |
comment:41
Thanks for the explanation, that's good news. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
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/chart__no_longer_use_uniquerepresentation__implement___getstate_____setstate__ @
30a5d0b
Issue created by migration from https://trac.sagemath.org/ticket/31901
The text was updated successfully, but these errors were encountered: