Ticket #3853 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

[with patch, positive review] plot.py improvements part 1: Remove all factories

Reported by: mhansen Assigned to: was
Priority: major Milestone: sage-3.1.2
Component: graphics Keywords:
Cc: anakha, jason

Description

I replaced all of the factories with individual functions.

Attachments

trac_3853.patch (40.1 kB) - added by mhansen on 08/14/2008 10:56:50 AM.
trac_3853-rebased-3.1.1-trac_3880.patch (40.7 kB) - added by jason on 08/19/2008 07:54:20 AM.
apply instead of trac_3853.patch
trac_3880-referee.patch (11.7 kB) - added by jason on 08/21/2008 02:58:37 PM.
trac_3853-fixes.2.patch (3.3 kB) - added by mhansen on 08/25/2008 08:01:00 PM.

Change History

08/14/2008 10:56:50 AM changed by mhansen

  • attachment trac_3853.patch added.

08/14/2008 10:57:20 AM changed by mhansen

  • owner changed from tbd to was.
  • component changed from algebra to graphics.
  • milestone set to sage-3.1.

08/14/2008 11:20:42 AM changed by anakha

  • cc set to anakha.

08/14/2008 11:21:30 AM changed by jason

  • keywords set to jason.

08/14/2008 11:21:42 AM changed by jason

  • cc changed from anakha to anakha, jason.
  • keywords deleted.

08/19/2008 07:54:20 AM changed by jason

  • attachment trac_3853-rebased-3.1.1-trac_3880.patch added.

apply instead of trac_3853.patch

08/19/2008 09:48:13 AM changed by jason

Extra things this patch does:

line([(0,0,0),(1,1,1)]) no longer produces a 3d line, but a 2d line from the first 2 coordinates. Use line3d to get a 3d line.

line(object) no longer tries object.plot() first, which is a very, very good thing, since it is natural to assume that line(object) will be something like a line, but object.plot() could be *anything*.

line no longer has a "coerce" argument; all input data is always coerced to float. I've changed this to use numpy to convert to float; currently, that's a bit faster, from some tests that wstein ran. As wstein mentioned on IRC, we should try to replace the float conversion with a snippet of Cython.

text used to make 3d text when a 3d point was passed; now it only makes 2d text. Use the text3d for 3d text.

08/19/2008 09:50:32 AM changed by jason

well, that coerce comment should really be: I changed this to use numpy in one case; the case where we need to separate the x-values and y-values still coerces to float no matter what. I guess the "line" function, a user-visible function, shouldn't have a coerce=False option; it's too unsafe.

08/19/2008 09:54:33 AM changed by jason

I take that back; I took back out the numpy stuff; we should just make a general cython function that ensures that a list is coerced to float.

08/19/2008 09:58:38 AM changed by jason

That last patch also streamlines a few things and makes a few things more consistent.

08/19/2008 10:17:28 AM changed by jason

Despite the name trac_3880 in the referee patch, it really is the referee patch for this ticket!

08/19/2008 12:53:47 PM changed by jason

referee patch updated to correct documentation and doctests, plus simplify code in xydata... function.

08/19/2008 12:54:12 PM changed by jason

plus throw some errors when trying to do line() or text() and get back a 3d object.

08/19/2008 02:04:33 PM changed by jason

there are still some doctest errors from the referee patch

08/21/2008 02:58:37 PM changed by jason

  • attachment trac_3880-referee.patch added.

08/21/2008 02:59:02 PM changed by jason

updated referee patch to fix some more things.

08/21/2008 03:01:07 PM changed by jason

Positive review for the initial part (mhansen's part). The referee patch adds enough functionality that it probably ought to be reviewed as well.

So, apply trac_3853-rebased-3.1.1-trac_3880.patch and then the referee patch to review/merge this ticket.

08/21/2008 03:03:12 PM changed by jason

I think now there is one doctest in plot.py that gives a weird error (it's a doctesting error, not a sage error, I think).

08/25/2008 07:06:20 PM changed by mhansen

  • summary changed from [with patch, needs review] plot.py improvements part 1: Remove all factories to [with patch, positive review] plot.py improvements part 1: Remove all factories.

Apply

trac_3853-rebased-3.1.1-trac_3880.patch trac_3880-referee.patch trac_3853-fixes.patch

in order.

08/25/2008 07:38:06 PM changed by jwmerrill

  • summary changed from [with patch, positive review] plot.py improvements part 1: Remove all factories to [with patch, needs work] plot.py improvements part 1: Remove all factories.

There was a thread about the proposed new behavior of line:

line([(0,0,0),(1,1,1)]) no longer produces a 3d line, but a 2d line from the first 2 coordinates. Use line3d to get a 3d line.

http://groups.google.com/group/sage-devel/browse_thread/thread/6f4b382145c09546

All the comments were negative. That needs to be addressed, right?

I suspect I may be overstepping my bounds by changing this from positive review to needs work--if so, I'll accept an appropriate wrist slapping.

08/25/2008 08:01:00 PM changed by mhansen

  • attachment trac_3853-fixes.2.patch added.

08/25/2008 08:01:21 PM changed by mhansen

  • summary changed from [with patch, needs work] plot.py improvements part 1: Remove all factories to [with patch, needs review] plot.py improvements part 1: Remove all factories.

08/25/2008 08:24:42 PM changed by mabshoff

  • summary changed from [with patch, needs review] plot.py improvements part 1: Remove all factories to [with patch, positive review] plot.py improvements part 1: Remove all factories.

This looks good to me, it restores the old behavior. If something else is desired it should be dealt with via a new ticket since this code should go in and would bitrot quickly.

Cheers,

Michael

08/25/2008 08:44:45 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged trac_3853-rebased-3.1.1-trac_3880.patch, trac_3880-referee.patch and trac_3853-fixes.2.patch in Sage 3.1.2.alpha1