Opened 15 years ago

Closed 15 years ago

#1772 closed defect (fixed)

[with patch, positive review] bug somewhere in the symbolics

Reported by: William Stein Owned by: Mike Hansen
Priority: major Milestone: sage-2.10.1
Component: calculus Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This is from Hector:

I also hit this bug while doing this (taken from the "piecewise"
documentation):

sage: f1 = lambda x:-1
sage: f2 = lambda x:2
sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
sage: P = f.plot_fourier_series_partial_sum(15,pi,-5,5)   # long time
boom
...

/Users/was/s/local/lib/python2.5/site-packages/sage/calculus/calculus.py in <lambda>(i)
   3607             # We need to do this maximum to correctly handle the case where
   3608             # self is something like (sin+1)
-> 3609             n = max( max(map(lambda i: i.number_of_arguments(), self._operands)+[0]), len(variables) )
   3610         self.__number_of_args = n
   3611         return n

<type 'exceptions.AttributeError'>: 'Pi' object has no attribute 'number_of_arguments'

Attachments (2)

1772.patch (32.1 KB) - added by Mike Hansen 15 years ago.
1772-bug.patch (919 bytes) - added by Robert Miller 15 years ago.
Fixes the one doctest failure in constant.py

Download all attachments as: .zip

Change History (7)

comment:1 Changed 15 years ago by Mike Hansen

Owner: changed from William Stein to Mike Hansen
Status: newassigned

Changed 15 years ago by Mike Hansen

Attachment: 1772.patch added

comment:2 Changed 15 years ago by Mike Hansen

Summary: bug somewhere in the symbolics[with patch, needs review] bug somewhere in the symbolics

comment:3 Changed 15 years ago by William Stein

I also fixed this in the same way earlier today (as part of one my other patches), but my patch was just a few lines to actually fix the listed problem. The patch attached to this ticket, fixes the problem and does a HUGE amount more to vastly improve doctesting in some files, etc. I.e., this is _great_.

I have not fully reviewed the patch yet, though I've looked it over by eye and it looks very good.

Changed 15 years ago by Robert Miller

Attachment: 1772-bug.patch added

Fixes the one doctest failure in constant.py

comment:4 Changed 15 years ago by Robert Miller

Summary: [with patch, needs review] bug somewhere in the symbolics[with patch, positive review] bug somewhere in the symbolics

comment:5 Changed 15 years ago by Michael Abshoff

Resolution: fixed
Status: assignedclosed

Merged in Sage 2.10.1.alpha0

Note: See TracTickets for help on using tickets.