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

Deprecate GraphicsArray import from sage.plot.graphics #28675

Closed
egourgoulhon opened this issue Oct 29, 2019 · 16 comments
Closed

Deprecate GraphicsArray import from sage.plot.graphics #28675

egourgoulhon opened this issue Oct 29, 2019 · 16 comments

Comments

@egourgoulhon
Copy link
Member

#27865 has refactored the class GraphicsArray, making it a subclass of MultiGraphics, and has moved its definition from src/sage/plot/graphics.py to src/sage/plot/multigraphics.py. As pointed out in https://groups.google.com/d/msg/sage-devel/eTl4DHcwnOo/uQSOtstWAwAJ, this has broken Sage's API: the import via

from sage.plot.graphics import GraphicsArray

does not longer work. This ticket makes it work again, but with the following deprecation notice:

DeprecationWarning: GraphicsArray must be imported from sage.plot.multigraphics 
and no longer from sage.plot.graphics.
See https://trac.sagemath.org/28675 for details.

A possible shortcoming of the approach adopted here is that the deprecation message appears only at the first use of GraphicsArray, not during the import itself. Actually, I don't know if it is possible to generate a deprecation warning during some import.

CC: @williamstein @kcrisman

Component: graphics

Keywords: GraphicsArray

Author: Eric Gourgoulhon

Branch/Commit: 87bc58a

Reviewer: Frédéric Chapoton

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

@egourgoulhon egourgoulhon added this to the sage-9.0 milestone Oct 29, 2019
@egourgoulhon
Copy link
Member Author

Author: Eric Gourgoulhon

@egourgoulhon
Copy link
Member Author

@egourgoulhon
Copy link
Member Author

New commits:

e16951eDeprecation notice for GraphicsArray import from sage.plot.graphics

@egourgoulhon

This comment has been minimized.

@egourgoulhon
Copy link
Member Author

Commit: e16951e

@egourgoulhon egourgoulhon changed the title Redirect import of GraphicsArray Deprecate GraphicsArray import from sage.plot.graphics Oct 31, 2019
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 4, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

87bc58aFix merge conflict of #28675 branch with Sage 9.0.beta4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 4, 2019

Changed commit from e16951e to 87bc58a

@egourgoulhon
Copy link
Member Author

comment:3

The merge conflict solved above was due to the introduction of #27866 in Sage 9.0.beta4.

@egourgoulhon

This comment has been minimized.

@kcrisman
Copy link
Member

kcrisman commented Nov 6, 2019

comment:6

I like the spirit of this. Can you actually view this array and do the usual (old) methods with it for now? (I regret that I cannot actually test this due to time constraints - a sad refrain the past few years.) Anyway, if so and green patchbot, this is probably the best way to deal with this situation, unless William has other improvements he would suggest.

@egourgoulhon
Copy link
Member Author

comment:7

Replying to @kcrisman:

I like the spirit of this. Can you actually view this array and do the usual (old) methods with it for now?

Yes absolutely, since the object constructed from sage.plot.graphics.GraphicsArray is actually a
sage.plot.multigraphics.GraphicsArray.

@egourgoulhon
Copy link
Member Author

comment:8

Replying to @kcrisman:

Anyway, if so and green patchbot, this is probably the best way to deal with this situation, unless William has other improvements he would suggest.

The patchbot is still green...

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@egourgoulhon
Copy link
Member Author

comment:10

Thanks!

@kcrisman
Copy link
Member

comment:11

+1 thanks chapoton!

@vbraun
Copy link
Member

vbraun commented Nov 24, 2019

Changed branch from public/graphics/GraphicsArray_import-28675 to 87bc58a

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

4 participants