Opened 5 months ago

Closed 4 months 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) Commit: 87bc58a608cf303db209808e6b5ae9bbddef46fb
Dependencies: Stopgaps:

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 5 months ago by egourgoulhon

  • Authors set to Eric Gourgoulhon
  • Branch set to public/graphics/GraphicsArray_import-28675
  • Cc was added
  • Commit set to e16951ee794cb76aefa181103ae7d3a07d5e7bcb
  • Description modified (diff)
  • Status changed from new to needs_review
  • Summary changed from Redirect import of GraphicsArray to Deprecate GraphicsArray import from sage.plot.graphics

New commits:

e16951eDeprecation notice for GraphicsArray import from sage.plot.graphics

comment:2 Changed 5 months ago by git

  • Commit changed from e16951ee794cb76aefa181103ae7d3a07d5e7bcb to 87bc58a608cf303db209808e6b5ae9bbddef46fb

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 5 months ago by egourgoulhon

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

comment:4 Changed 5 months ago by egourgoulhon

  • Cc kcrisman added

comment:5 Changed 5 months ago by egourgoulhon

  • Description modified (diff)

comment:6 follow-ups: Changed 5 months 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 5 months 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 5 months 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 follow-up: Changed 5 months ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

comment:10 in reply to: ↑ 9 Changed 5 months ago by egourgoulhon

Thanks!

comment:11 Changed 5 months ago by kcrisman

+1 thanks chapoton!

comment:12 Changed 4 months ago by vbraun

  • Branch changed from public/graphics/GraphicsArray_import-28675 to 87bc58a608cf303db209808e6b5ae9bbddef46fb
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.