Opened 2 years ago
Closed 2 years ago
#23472 closed defect (fixed)
The error message for splitting_field when name is None does not match that of NumberField
Reported by:  geze  Owned by:  

Priority:  trivial  Milestone:  sage8.1 
Component:  number fields  Keywords:  NumberField, splitting_field, TypeError, sd87 
Cc:  Merged in:  
Authors:  Gerardo Zelaya  Reviewers:  Kevin Lui 
Report Upstream:  N/A  Work issues:  
Branch:  46e66c0 (Commits)  Commit:  46e66c0eb9820bc291cf87e1499eb73af7810868 
Dependencies:  Stopgaps: 
Description (last modified by )
When one computes:
sage: R.<x> = QQ[] sage: f = x^2  2 sage: K = NumberField(f) Error in lines 33 Traceback (most recent call last): File "/usr/local/sage/local/lib/python2.7/sitepackages/smc_sagews/sage_server.py", line 995, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/usr/local/sage/local/lib/python2.7/sitepackages/sage/rings/number_field/number_field.py", line 524, in NumberField return NumberField_version2(polynomial=polynomial, name=name, check=check, embedding=embedding, latex_name=latex_name, assume_disc_small=assume_disc_small, maximize_at_primes=maximize_at_primes, structure=structure) File "sage/structure/factory.pyx", line 362, in sage.structure.factory.UniqueFactory.__call__ (/usr/local/sage/src/build/cythonized/sage/structure/factory.c:1856) key, kwds = self.create_key_and_extra_args(*args, **kwds) File "/usr/local/sage/local/lib/python2.7/sitepackages/sage/rings/number_field/number_field.py", line 594, in create_key_and_extra_args raise TypeError("You must specify the name of the generator.") TypeError: You must specify the name of the generator.
However when one computes:
sage: f.splitting_field() Error in lines 33 Traceback (most recent call last): File "/usr/local/sage/local/lib/python2.7/sitepackages/smc_sagews/sage_server.py", line 995, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/rings/polynomial/polynomial_element.pyx", line 4181, in sage.rings.polynomial.polynomial_element.Polynomial.splitting_field (/usr/local/sage/src/build/cythonized/sage/rings/polynomial/polynomial_element.c:41810) def splitting_field(self, names, map=False, **kwds): TypeError: splitting_field() takes at least 1 positional argument (0 given)
One needs to add the lines:
if name is None: raise TypeError("You must specify the name of the generator.")
Before the line:
name = normalize_names(1, name)
in the corresponding file.
Change History (13)
comment:1 Changed 2 years ago by
 Branch set to u/geze/the_error_message_for_splitting_field_when_name_is_none_does_not_match_that_of_numberfield
comment:2 Changed 2 years ago by
 Commit set to 3229f40ffa8c542a8336b9ab78b42cce2664bda4
comment:3 Changed 2 years ago by
 Commit changed from 3229f40ffa8c542a8336b9ab78b42cce2664bda4 to 8d20d6b2dbdcdc19467dcd5366e9d77406dd9b11
Branch pushed to git repo; I updated commit sha1. New commits:
8d20d6b  change typos

comment:4 Changed 2 years ago by
 Commit changed from 8d20d6b2dbdcdc19467dcd5366e9d77406dd9b11 to 46e66c0eb9820bc291cf87e1499eb73af7810868
Branch pushed to git repo; I updated commit sha1. New commits:
46e66c0  change type from name to names

comment:5 Changed 2 years ago by
 Status changed from new to needs_review
 Type changed from PLEASE CHANGE to defect
comment:6 Changed 2 years ago by
 Description modified (diff)
comment:7 Changed 2 years ago by
 Reviewers set to Kevin Lui
 Status changed from needs_review to positive_review
Good change. It makes splitting field more consistent with number field.
comment:8 Changed 2 years ago by
 Status changed from positive_review to needs_work
Author name is missing...
comment:9 Changed 2 years ago by
comment:10 Changed 2 years ago by
Author name should be your real name, not the trac username (will be listed in the release notes)
comment:11 Changed 2 years ago by
Also, please set back to positive review when you are done...
comment:12 Changed 2 years ago by
 Status changed from needs_work to positive_review
comment:13 Changed 2 years ago by
 Branch changed from u/geze/the_error_message_for_splitting_field_when_name_is_none_does_not_match_that_of_numberfield to 46e66c0eb9820bc291cf87e1499eb73af7810868
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Branch pushed to git repo; I updated commit sha1. New commits:
add doc test