-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Move generally usable decorators to misc.decorators #9907
Comments
comment:2
While trying to use this patch in Trac #6094, I found out that the |
comment:3
I'm not qualified to check out the "work-around" for classes. But I've cc'ed Mike Hansen and Jason Grout, who I think were in on these in the first place back at #4201. I am running this through full tests as part of #6094 and a report will go there once concluded. Commit message on the ticket itself should probably change - there is no "as before" here to compare with, and in the final log it really won't make any sense. |
comment:4
Replying to @johanrosenkilde:
Do you think you could just add the work-around to the sage_wraps decorator (sage.misc.misc.sage_wraps) and convert the decorators to use it? There are other functions that use sage_wraps, and it would be nice to have all of that work-around code in one place. |
comment:5
Replying to @jasongrout:
That should be no problem, I guess; I wasn't aware of sage_wraps. However, that might affect a lot of places outside the original scope of this ticket; should it be a new ticket then? What's the precedence here? |
comment:6
Replying to @johanrosenkilde:
I started Trac #9919 for doing this patch in sage_wraps. I'm also thinking that, when the problems with this patch are identified, we might move sage_wraps and other decorators in sage.misc.misc into sage.misc.decorators as well. |
comment:7
Starting another ticket sounds good. |
comment:8
Rob Beezer posted the following problem with the current patch for Trac #6094, but that is actually a problem with the current patch for this trac. When testing the unpickle-function in sage.structure.sage_object, the relocation of the decorators yield problems:
The deprecation-warnings are just garbage from words.py, so the important thing to note is the "** failed"-lines. The problem, as far as I can see, is simply that there is a standard pickle jar which has a pickle for all the functions etc. shipped with sage. This needs to be updated when applying this patch. Does anyone know how this is done and possibly included in the patch? Cheers, Johan |
comment:9
The pickle jar contains old pickles of objects that we want to ensure work in the future. For example, if you made the changes at 9907 as the are, then possibly many pickles out in the wild would break. Instead of trying to update the pickle jar, the appropriate thing to do would be to add the following to sage/plot/misc.py
That way, the old pickles will still work as they will still be able to find the decorators in sage.plot.misc. |
comment:10
Replying to @mwhansen:
Ok, thanks -- I will update the patch for #9907. I was actually wondering a bit about backward compatibility, so good to know this is the system. Does the above fix then have a one-year lifetime like for keyword-deprecation? If so, should it be flagged somehow (e.g. with the comment containing the term "backward compatibility") so it can be found and removed one year from now? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:14
Note that the added patch assumes the patch for Trac #9919. |
comment:15
Added a comment about when then bug in #9919 was fixed in Python. Accidentally uploaded two. |
comment:16
Ok, uploaded a new one, as it seems you can't manually change the patch-files because of some hashes in the top of the file. So this one was done the right way. Remember to use the newest and |
comment:17
Can I delete the .2.patch file, then? |
comment:18
I've opened up #10057 to address an import change that needs to be made in sagenb after this is merged. |
apply only this patch; rebased to 4.6.alpha1+some patches |
comment:19
Attachment: trac_9907_move_decorators.patch.gz Replying to @jasongrout:
Sure; I just don't have the privileges to do that myself. |
comment:20
This needs to be coordinated with #10107. |
Attachment: trac_9907_move_decorators.2.patch.gz Rebased to 4.6. Still requires first applying patch for Trac #9919 |
Reviewer: Robert Miller |
comment:22
Should this be merged in Sage 4.6.1? (if yes, please set the Milestone) |
Changed author from jsrn to Johan Sebastian Rosenkilde Nielsen |
Merged: sage-4.6.1.alpha2 |
The decorators in sage.misc.misc should be moved to sage.misc.decorators.
In plot.misc there are also some generally usable decorators for various nice stuff. These should be moved to a general library so other modules can use them without illogically depending on plot. Simultaneously, they should be patched to use sage_wraps instead of the Python "wraps" to accommodate for Sage-specific things; e.g. the fix of Trac #9917.
CC: @jasongrout @mwhansen
Component: relocation
Keywords: generality, decorators
Author: Johan Sebastian Rosenkilde Nielsen
Reviewer: Robert Miller
Merged: sage-4.6.1.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/9907
The text was updated successfully, but these errors were encountered: