Skip to content
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

Pickling of Functors #10460

Closed
simon-king-jena opened this issue Dec 10, 2010 · 10 comments
Closed

Pickling of Functors #10460

simon-king-jena opened this issue Dec 10, 2010 · 10 comments

Comments

@simon-king-jena
Copy link
Member

We used to have:

sage: F = QQ['t'].construction()[0]
sage: G = loads(dumps(F))
sage: G == F
True
sage: G.domain() == F.domain()
False
sage: G.codomain() is None
True

In other words, the cdef'd attributes of the construction functor are lost.

I created a generic pickling method for functors, so that it works a lot better:

sage: F = QQ['t'].construction()[0]
sage: G = loads(dumps(F))
sage: G == F
True
sage: G.domain() == F.domain()
True
sage: G.codomain() is None
False

The patch contains two tests, showing that the problem is solved.

Component: categories

Keywords: functors

Author: Simon King

Reviewer: Martin Raum

Merged: sage-4.7.alpha2

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

@simon-king-jena
Copy link
Member Author

comment:1

To the patchbot / release manager:

Depends on #8800

So, in fact, it also depends on #8807 and #10318.

Up to now, I only tested sage/categories/functor.pyx and sage/categories/pushout.py. However, since they use functors intensely, I am already marking the ticket as "needs review".

@simon-king-jena
Copy link
Member Author

comment:2

Since the patchbot complained, I updated the patch. It should cleanly apply to sage-4.6.2.alpha0.

It turns out that the patch does in fact not depend on #8800. It only depends on #8807 and #10318, which are already merged. So, no dependency.

@simon-king-jena
Copy link
Member Author

comment:3

I don't know why the patchbot complains. The patch applies cleanly to a fresh sage-4.6.2.alpha4.

@simon-king-jena
Copy link
Member Author

Pickling of functors. Independent of #8800

@simon-king-jena
Copy link
Member Author

comment:4

Attachment: 10460_pickling_functors.patch.gz

Since the patchbot did not try to apply the patch again and since the patch cleanly applies to sage-4.6.1.alpha4, I now try to trigger another attempt of the patchbot by posting a new copy of the patch.

And, by the way, this rather simple patch still needs review...

@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Mar 1, 2011

Reviewer: Martin Raum

@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Mar 1, 2011

comment:5

I only corrected tiny typos in the documentation, and I altered one doctest to better reflect the change that you introduced.

@sagetrac-mraum sagetrac-mraum mannequin modified the milestones: sage-4.7, sage-4.6.2 Mar 1, 2011
@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Mar 1, 2011

Replacement for original patch.

@simon-king-jena
Copy link
Member Author

comment:6

Attachment: trac-10460-pickling_functors-review.patch.gz

Replying to @sagetrac-mraum:

I only corrected tiny typos in the documentation, and I altered one doctest to better reflect the change that you introduced.

Thank you, Martin!

For the record, the patchbot and the release manager:

Apply trac-10460-pickling_functors-review.patch

@sagetrac-mvngu sagetrac-mvngu mannequin modified the milestones: sage-4.6.2, sage-4.7 Mar 2, 2011
@jdemeyer
Copy link

Merged: sage-4.7.alpha2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants