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

random_element fails for power series over real field, has inaccurate docstring #9481

Closed
nilesjohnson mannequin opened this issue Jul 12, 2010 · 12 comments
Closed

random_element fails for power series over real field, has inaccurate docstring #9481

nilesjohnson mannequin opened this issue Jul 12, 2010 · 12 comments

Comments

@nilesjohnson
Copy link
Mannequin

nilesjohnson mannequin commented Jul 12, 2010

The random_element method of univariate power series does not pass arguments to the underlying polynomial ring accurately, and the description of its second argument is inaccurate.

c.f. this thread from sage-devel

sage: SQ = PowerSeriesRing(QQ,'v')
sage: SR = PowerSeriesRing(RR,'v')

sage: SQ.random_element(5,100)  # docstring promises coefficients are uniformly distributed between -100 and 100
-7/3 + 5/8*v + 37/60*v^2 + 33/8*v^3 + 77/89*v^4 + O(v^5)

sage: SR.random_element(5)  # broken
Traceback (most recent call last):
...
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

CC: @rishikesha

Component: commutative algebra

Keywords: power series, random element

Author: Niles Johnson, Jeroen Demeyer

Reviewer: Aly Deines

Merged: sage-4.6.2.alpha1

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

@nilesjohnson nilesjohnson mannequin added this to the sage-4.6.1 milestone Jul 12, 2010
@nilesjohnson nilesjohnson mannequin assigned malb Jul 12, 2010
@nilesjohnson nilesjohnson mannequin added p: major / 3 and removed p: minor / 4 labels Jul 12, 2010
@nilesjohnson
Copy link
Mannequin Author

nilesjohnson mannequin commented Aug 1, 2010

emulated behavior of polynomial ring random_element, as suggested on sage-devel; commit message now references ticket number

@rishikesha
Copy link
Mannequin

rishikesha mannequin commented Aug 8, 2010

comment:2

Attachment: trac_9481_ps_random_element.patch.gz

@nilesjohnson
Copy link
Mannequin Author

nilesjohnson mannequin commented Dec 3, 2010

Changed author from niles to Niles Johnson

@nilesjohnson nilesjohnson mannequin added the good first issue label Dec 3, 2010
@adeines
Copy link
Mannequin

adeines mannequin commented Jan 10, 2011

comment:4

Looks good.

@adeines
Copy link
Mannequin

adeines mannequin commented Jan 10, 2011

Reviewer: Aly Deines

@jdemeyer jdemeyer modified the milestones: sage-4.6.1, sage-4.6.2 Jan 11, 2011
@jdemeyer
Copy link

Attachment: trac_9481_ps_random_element.2.patch.gz

Same patch, fixed commit message

@jdemeyer
Copy link

comment:6

Docstring needs reformatting to proper Sphinx markup.

@jdemeyer
Copy link

Apply on top of previous patch

@jdemeyer
Copy link

Changed author from Niles Johnson to Niles Johnson, Jeroen Demeyer

@jdemeyer
Copy link

comment:7

Attachment: 9481_docstring.patch.gz

@nilesjohnson
Copy link
Mannequin Author

nilesjohnson mannequin commented Jan 19, 2011

comment:8

All documentation now builds without error or warning, so positive review for attachment: 9481_docstring.patch

@jdemeyer
Copy link

Merged: sage-4.6.2.alpha1

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

2 participants