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:  sage9.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: 
Description (last modified by )
#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/sagedevel/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
Authors:  → Eric Gourgoulhon 

Branch:  → public/graphics/GraphicsArray_import28675 
Cc:  was added 
Commit:  → e16951ee794cb76aefa181103ae7d3a07d5e7bcb 
Description:  modified (diff) 
Status:  new → needs_review 
Summary:  Redirect import of GraphicsArray → Deprecate GraphicsArray import from sage.plot.graphics 
comment:2 Changed 3 years ago by
Commit:  e16951ee794cb76aefa181103ae7d3a07d5e7bcb → 87bc58a608cf303db209808e6b5ae9bbddef46fb 

Branch pushed to git repo; I updated commit sha1. New commits:
87bc58a  Fix merge conflict of #28675 branch with Sage 9.0.beta4

comment:3 Changed 3 years ago by
The merge conflict solved above was due to the introduction of #27866 in Sage 9.0.beta4.
comment:4 Changed 3 years ago by
Cc:  kcrisman added 

comment:5 Changed 3 years ago by
Description:  modified (diff) 

comment:6 followups: 7 8 Changed 3 years ago by
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 Changed 3 years ago by
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 Changed 3 years ago by
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 followup: 10 Changed 3 years ago by
Reviewers:  → Frédéric Chapoton 

Status:  needs_review → positive_review 
comment:12 Changed 3 years ago by
Branch:  public/graphics/GraphicsArray_import28675 → 87bc58a608cf303db209808e6b5ae9bbddef46fb 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
Deprecation notice for GraphicsArray import from sage.plot.graphics