Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coeffs() fails on symbolic functions #12255

Closed
orlitzky opened this issue Jan 3, 2012 · 9 comments
Closed

coeffs() fails on symbolic functions #12255

orlitzky opened this issue Jan 3, 2012 · 9 comments

Comments

@orlitzky
Copy link
Contributor

orlitzky commented Jan 3, 2012

This was reported on sage-support:

http://groups.google.com/group/sage-support/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]]

Component: symbolics

Author: Michael Orlitzky

Branch/Commit: 3c181a0

Reviewer: Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/12255

@orlitzky orlitzky added this to the sage-5.11 milestone Jan 3, 2012
@orlitzky

This comment has been minimized.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@rwst
Copy link

rwst commented Jan 31, 2015

comment:6

This seems fixed now (still wasn't in 6.2):

/home/ralf/sage/src/bin/sage-ipython:1: DeprecationWarning: coeffs is deprecated. Please use coefficients instead.
See http://trac.sagemath.org/17438 for details.
  #!/usr/bin/env python
[[t, 0], [3, 1], [1, 2]]

@rwst rwst removed this from the sage-6.4 milestone Jan 31, 2015
@orlitzky
Copy link
Contributor Author

Commit: 3c181a0

@orlitzky
Copy link
Contributor Author

Branch: u/mjo/ticket/12255

@orlitzky
Copy link
Contributor Author

comment:7

Indeed, but let's add a doctest to Expression.coefficients() if you don't mind.


New commits:

3c181a0Trac #12255: Add a doctest for the fixed behavior.

@orlitzky
Copy link
Contributor Author

Author: Michael Orlitzky

@orlitzky orlitzky added this to the sage-6.5 milestone Jan 31, 2015
@rwst
Copy link

rwst commented Feb 1, 2015

comment:8

Is fine!

@rwst
Copy link

rwst commented Feb 1, 2015

Reviewer: Ralf Stephan

@vbraun
Copy link
Member

vbraun commented Feb 17, 2015

Changed branch from u/mjo/ticket/12255 to 3c181a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants