Ticket #4084 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch, positive review] plot(1/cos,-1,1) fails

Reported by: jwmerrill Owned by: jwmerrill
Priority: major Milestone: sage-3.1.2
Component: graphics Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

Plot works with symbolic functions, but not compositions or arithmetic involving them.

sage: plot(cos,-1,1) #works

sage: plot(1/cos,-1,1)
Traceback (most recent call last):
...
TypeError: float() argument must be a string or a number

Attachments

4804.patch Download (4.6 KB) - added by jwmerrill 5 years ago.
4804_doctest_only.patch Download (738 bytes) - added by jwmerrill 5 years ago.

Change History

Changed 5 years ago by jwmerrill

comment:1 Changed 5 years ago by mabshoff

  • Summary changed from plot(1/cos,-1,1) fails to [with patch, needs work] plot(1/cos,-1,1) fails

Hi,

this is fixed in 3.1.2.rc1-ish:

mabshoff@sage:/scratch/mabshoff/release-cycle/sage-3.1.2.rc1$ ./sage
----------------------------------------------------------------------
| SAGE Version 3.1.2.rc0, Release Date: 2008-09-06                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: plot(1/cos,-1,1)

sage: 
Exiting SAGE (CPU time 0m0.63s, Wall time 0m4.01s).
Exiting spawned Maxima process.

Please post a patch that adds only the doctest. There are unrelated changes in the patch.

Cheers,

Michael

Changed 5 years ago by jwmerrill

comment:2 follow-up: ↓ 3 Changed 5 years ago by jwmerrill

  • Summary changed from [with patch, needs work] plot(1/cos,-1,1) fails to [with patch, needs review] plot(1/cos,-1,1) fails

4804_doctest_only.patch adds only doctests. If accepted, only that patch should be applied. This should not be accepted until the new doctests actually pass.

Thanks for the quick catch mhansen. "Unrelated" might be a little strong, though I was bold in modifying implementation to make this work. In any case, sounds like problem solved.

Cheers,

JM

comment:3 in reply to: ↑ 2 Changed 5 years ago by mabshoff

Replying to jwmerrill:

4804_doctest_only.patch adds only doctests. If accepted, only that patch should be applied. This should not be accepted until the new doctests actually pass.

I rebased the patch against my current merge tree.

Thanks for the quick catch mhansen. "Unrelated" might be a little strong, though I was bold in modifying implementation to make this work. In any case, sounds like problem solved.

It wasn't mhansen ;). The changes in plot.py had *zero* to do with the ticket and the "fix" is canonically wrong since we just don't just wipe out low order bits preventatively.

Cheers,

JM

Cheers,

Michael

comment:4 Changed 5 years ago by jwmerrill

Both points well taken.

Cheers,

JM

comment:5 Changed 5 years ago by mabshoff

  • Summary changed from [with patch, needs review] plot(1/cos,-1,1) fails to [with patch, positive review] plot(1/cos,-1,1) fails

With the patch applied doctests do pass. Positive review.

Cheers,

Michael

comment:6 Changed 5 years ago by mabshoff

  • Status changed from new to closed
  • Resolution set to fixed

Merged rebased 4804_doctest_only.patch in Sage 3.1.2.rc1

Note: See TracTickets for help on using tickets.