Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #19528: rename term to term_monoid and improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Jan 21, 2016
1 parent 8a71ba3 commit dc9d496
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def __init__(self, parent, summands, simplify=True, convert=True):
from misc import combine_exceptions
from term_monoid import TermMonoid
def convert_terms(element):
T = TermMonoid(term=element.parent(), asymptotic_ring=parent)
T = TermMonoid(term_monoid=element.parent(), asymptotic_ring=parent)
try:
return T(element)
except (ValueError, TypeError) as e:
Expand Down Expand Up @@ -1313,7 +1313,7 @@ def convert_terms(element):
if convert_terms.count < precision:
convert_terms.count += 1
return element
T = TermMonoid(term='O', asymptotic_ring=self.parent())
T = TermMonoid(term_monoid='O', asymptotic_ring=self.parent())
return T(element)
convert_terms.count = 0
summands.map(convert_terms, topological=True, reverse=True)
Expand Down
20 changes: 10 additions & 10 deletions src/sage/rings/asymptotic/term_monoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3577,9 +3577,9 @@ class TermMonoidFactory(sage.structure.factory.UniqueFactory):
INPUT:
- ``term`` -- the kind of term that shall be created. Either a string
``'exact'`` or ``'O'`` (capital letter ``O``),
or an existing instance of a term.
- ``term_monoid`` -- the kind of terms held in the new term monoid.
Either a string ``'exact'`` or ``'O'`` (capital letter ``O``),
or an existing instance of a term monoid.
- ``growth_group`` -- a growth group.
Expand Down Expand Up @@ -3670,7 +3670,7 @@ class TermMonoidFactory(sage.structure.factory.UniqueFactory):
running ._test_prod() . . . pass
running ._test_some_elements() . . . pass
"""
def create_key_and_extra_args(self, term,
def create_key_and_extra_args(self, term_monoid,
growth_group=None, coefficient_ring=None,
asymptotic_ring=None,
**kwds):
Expand Down Expand Up @@ -3707,16 +3707,16 @@ def create_key_and_extra_args(self, term,
...
ValueError: Integer Ring has to be an asymptotic growth group
"""
if isinstance(term, GenericTermMonoid):
if isinstance(term_monoid, GenericTermMonoid):
from misc import underlying_class
term_class = underlying_class(term)
elif term == 'O':
term_class = underlying_class(term_monoid)
elif term_monoid == 'O':
term_class = OTermMonoid
elif term == 'exact':
elif term_monoid == 'exact':
term_class = ExactTermMonoid
else:
raise ValueError("Term specification '%s' has to be either 'exact' or 'O' "
"or an instance of an existing term." % term)
"or an instance of an existing term." % term_monoid)

if asymptotic_ring is not None and \
(growth_group is not None or coefficient_ring is not None):
Expand All @@ -3735,7 +3735,7 @@ def create_key_and_extra_args(self, term,

if coefficient_ring is None:
raise ValueError("A coefficient ring has to be specified to "
"create a term monoid of type '%s'" % (term,))
"create a term monoid of type '%s'" % (term_monoid,))

return (term_class, growth_group, coefficient_ring), kwds

Expand Down

0 comments on commit dc9d496

Please sign in to comment.