Opened 11 years ago
Closed 10 years ago
#9630 closed defect (duplicate)
Python ints should have a conversion to Maxima
Reported by: | kcrisman | Owned by: | burcin |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | symbolics | Keywords: | |
Cc: | mjo | Merged in: | |
Authors: | Reviewers: | Michael Orlitzky, Burcin Erocal | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
I don't know how this might be done, but
for n in range(1,10): sum(k, k, 1, n)
doesn't work, while
for n in [1..10]: sum(k,k,1,n)
does. We need to fix
int(3)._maxima_() AttributeError: 'int' object has no attribute '_maxima_'
Duplicate of #9393.
Change History (6)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Sure, if Pynac sum expressions had been known to exist (or how to use them) when this code went in. There was also some weird bug that this originally took care of that had to do with held expressions in Maxima, if I recall correctly, though that had ceased to be an issue.
This just goes to show that we need some sort of Pynac tutorial so that more people can be effective on this!
comment:3 Changed 10 years ago by
- Cc mjo added
I don't think it's possible to monkey-patch methods onto int, but the symbolic sum issue has been fixed and I have a patch with a doctest (needs review!) at #9393.
comment:4 Changed 10 years ago by
- Milestone changed from sage-4.8 to sage-duplicate/invalid/wontfix
- Reviewers set to Michael Orlitzky, Burcin Erocal
- Status changed from new to needs_review
This is a duplicate of #9393. There is a patch with a doctest attached to that ticket.
comment:5 Changed 10 years ago by
- Status changed from needs_review to positive_review
comment:6 Changed 10 years ago by
- Description modified (diff)
- Resolution set to duplicate
- Status changed from positive_review to closed
the particular error that arises here is raised in sage/calculus/calculus.pyc line 501:
One could fix this one by first coercing a,b into SR. As an example:
This code looks rather convoluted to me anyway: Convert to maxima, take string representative, paste together and then simplify? Shouldn't the whole sum first be turned into a pynac sum expression, the whole thing converted to maxima, simplified, and then cast back?