Ticket #3853 (closed defect: fixed)
[with patch, positive review] plot.py improvements part 1: Remove all factories
| Reported by: | mhansen | Owned by: | was |
|---|---|---|---|
| Priority: | major | Milestone: | sage-3.1.2 |
| Component: | graphics | Keywords: | |
| Cc: | anakha, jason | Work issues: | |
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
I replaced all of the factories with individual functions.
Attachments
Change History
comment:1 Changed 5 years ago by mhansen
- Owner changed from tbd to was
- Component changed from algebra to graphics
- Milestone set to sage-3.1
Changed 5 years ago by jason
-
attachment
trac_3853-rebased-3.1.1-trac_3880.patch
added
apply instead of trac_3853.patch
comment:5 Changed 5 years ago 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.
comment:6 Changed 5 years ago 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.
comment:7 Changed 5 years ago 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.
comment:8 Changed 5 years ago by jason
That last patch also streamlines a few things and makes a few things more consistent.
comment:9 Changed 5 years ago by jason
Despite the name trac_3880 in the referee patch, it really is the referee patch for this ticket!
comment:10 Changed 5 years ago by jason
referee patch updated to correct documentation and doctests, plus simplify code in xydata... function.
comment:11 Changed 5 years ago by jason
plus throw some errors when trying to do line() or text() and get back a 3d object.
comment:12 Changed 5 years ago by jason
there are still some doctest errors from the referee patch
comment:13 Changed 5 years ago by jason
updated referee patch to fix some more things.
comment:14 Changed 5 years ago 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.
comment:15 Changed 5 years ago 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).
comment:16 Changed 5 years ago 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.
comment:17 Changed 5 years ago 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.
comment:18 Changed 5 years ago 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
comment:19 Changed 5 years ago 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
comment:20 Changed 5 years ago 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
