Opened 3 years ago

Closed 3 years ago

#28675 closed defect (fixed)

Deprecate GraphicsArray import from sage.plot.graphics

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.0
Component: graphics Keywords: GraphicsArray
Cc: was, kcrisman Merged in:
Authors: Eric Gourgoulhon Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 87bc58a (Commits, GitHub, GitLab) Commit: 87bc58a608cf303db209808e6b5ae9bbddef46fb
Dependencies: Stopgaps:

Status badges

Description (last modified by egourgoulhon)

#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.

Change History (12)

comment:1 Changed 3 years ago by egourgoulhon

Authors: Eric Gourgoulhon
Branch: public/graphics/GraphicsArray_import-28675
Cc: was added
Commit: e16951ee794cb76aefa181103ae7d3a07d5e7bcb
Description: modified (diff)
Status: newneeds_review
Summary: Redirect import of GraphicsArrayDeprecate GraphicsArray import from sage.plot.graphics

New commits:

e16951eDeprecation notice for GraphicsArray import from sage.plot.graphics

comment:2 Changed 3 years ago by git

Commit: e16951ee794cb76aefa181103ae7d3a07d5e7bcb87bc58a608cf303db209808e6b5ae9bbddef46fb

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

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

comment:3 Changed 3 years ago by egourgoulhon

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

comment:4 Changed 3 years ago by egourgoulhon

Cc: kcrisman added

comment:5 Changed 3 years ago by egourgoulhon

Description: modified (diff)

comment:6 Changed 3 years ago by kcrisman

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.

comment:7 in reply to:  6 Changed 3 years ago by egourgoulhon

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.

comment:8 in reply to:  6 Changed 3 years ago by egourgoulhon

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...

comment:9 Changed 3 years ago by chapoton

Reviewers: Frédéric Chapoton
Status: needs_reviewpositive_review

comment:10 in reply to:  9 Changed 3 years ago by egourgoulhon

Thanks!

comment:11 Changed 3 years ago by kcrisman

+1 thanks chapoton!

comment:12 Changed 3 years ago by vbraun

Branch: public/graphics/GraphicsArray_import-2867587bc58a608cf303db209808e6b5ae9bbddef46fb
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.