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
Cached methods with do_pickle=True fail for UniqueRepresentation objects #28096
Comments
Branch: u/klee/28096 |
Author: Kwankyu Lee |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
We can definitely not turn pickling on by default. See #15692. |
comment:5
This is not about turn pickling on by default. This turns on pickling only for |
comment:6
This ticket makes |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
To a reviewer: Before this ticket,
With this ticket and before the last commit,
After the last commit,
This last pickling behaviour of The last version seems preferable because it does not increase the size of a pickle to keep unnecessary information, namely cached function without the cache. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:14
After a brief look at the diff, it seems to me that there are many changes that have nothing to do with the purpose of this ticket: You remove @@ -167,9 +167,9 @@ class Manifolds(Category_over_base_ring):
TESTS::
- sage: TestSuite(Manifolds(RR).Smooth()).run()
sage: Manifolds(RR).Smooth.__module__
'sage.categories.manifolds'
+ sage: TestSuite(Manifolds(RR).Smooth()).run()
"""
return self._with_axiom('Smooth') Why? |
comment:15
Replying to @simon-king-jena:
Right. This is nothing to do with the purpose of the ticket. You know that this import statement is not necessary any more since python 2.7. It happens that as I am writing a patch for a ticket, I encounter things to be easily fixed, like obvious typos, docstrings in bad style, unnecessary imports (like the above) and so on. Sometimes I fix them. Other times I pass them. Is this bad? Do you think I should revert these small changes not related with the purpose of the ticket before I push the commits? I think if developers do not make such spontaneous fixes, improvement of the overall quality of sage code will get slower.
This (and many others like this) was related with the ticket. Without this reordering, I got doctest failures. But strangely but happily, now with 8.9.beta5, I don't have them any more even without reordering. I will revert back these changes. |
comment:17
Replying to @kwankyu:
I might be wrong, but I think this is still needed in Python 2.7, as I have recently had to add the statement in one of my own projects to solve a problem that did not exist with Python 3. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:19
Replying to @mwageringel:
Ah, I am wrong. You are right. I had somehow wrong understanding on this matter. I added back the imports. Thanks! |
comment:39
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:40
Setting a new milestone for this ticket based on a cursory review. |
comment:41
Stalled in |
comment:42
needs rebase |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Changed branch from u/klee/28096 to u/mkoeppe/28096 |
comment:47
rebased New commits:
|
comment:48
Thank you. This is long neglected, even by me. Perhaps it may need some revision. |
The decorator
@cached_method(do_pickle=True)
is used to make a method to cache the result and the cached result pickled along with the object.This fails for objects of
UniqueRepresentation
class. It is a consequence of the defective behavior ofUniqueRepresentation
object not putting its state into the pickle.This ticket solves the problem. A discussion on this issue was in
https://groups.google.com/forum/#!topic/sage-devel/n7v71cnVTmk
CC: @simon-king-jena @tscrim @nbruin
Component: pickling
Author: Kwankyu Lee
Branch/Commit: u/mkoeppe/28096 @
ab2eb86
Issue created by migration from https://trac.sagemath.org/ticket/28096
The text was updated successfully, but these errors were encountered: