Opened 8 years ago
Closed 4 years ago
#12255 closed defect (fixed)
coeffs() fails on symbolic functions
Reported by:  mjo  Owned by:  burcin 

Priority:  major  Milestone:  sage6.5 
Component:  symbolics  Keywords:  
Cc:  Merged in:  
Authors:  Michael Orlitzky  Reviewers:  Ralf Stephan 
Report Upstream:  N/A  Work issues:  
Branch:  3c181a0 (Commits)  Commit:  3c181a04188f5ccf6327b848c9c5b27a0e612667 
Dependencies:  Stopgaps: 
Description (last modified by )
This was reported on sagesupport:
http://groups.google.com/group/sagesupport/t/fa439b8dd28daaa8
As of 4.8.alpha6,
sage: g = function('g', var('t')) sage: f = 3*g + g**2 + t sage: f.coeffs(g) ... ValueError: The name "g(t)" is not a valid Python identifier.
This didn't throw a ValueError? in 4.7,
sage: f.coeffs(g) [[g(t)^2 + t + 3*g(t), 0]]
but the result was still not the expected one. The correct answer would be,
sage: f.coeffs(g) [[t, 0],[3, 1], [1, 2]]
Change History (9)
comment:1 Changed 8 years ago by
 Description modified (diff)
comment:2 Changed 6 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:3 Changed 5 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:4 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:5 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:6 Changed 4 years ago by
 Milestone changed from sage6.4 to sageduplicate/invalid/wontfix
 Status changed from new to needs_review
comment:7 Changed 4 years ago by
 Branch set to u/mjo/ticket/12255
 Commit set to 3c181a04188f5ccf6327b848c9c5b27a0e612667
 Milestone changed from sageduplicate/invalid/wontfix to sage6.5
Indeed, but let's add a doctest to Expression.coefficients()
if you don't mind.
New commits:
3c181a0  Trac #12255: Add a doctest for the fixed behavior.

comment:8 Changed 4 years ago by
 Reviewers set to Ralf Stephan
 Status changed from needs_review to positive_review
Is fine!
comment:9 Changed 4 years ago by
 Branch changed from u/mjo/ticket/12255 to 3c181a04188f5ccf6327b848c9c5b27a0e612667
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
This seems fixed now (still wasn't in 6.2):