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

Commit

Permalink
Fixing problems revealed by tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roed314 authored and GIT_AUTHOR_NAME committed Jun 14, 2017
1 parent e16f79f commit a88b630
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/sage/rings/padics/local_generic.py
Expand Up @@ -212,8 +212,8 @@ def change(self, **kwds):
You can also change print modes::
sage: R = Zp(5).change(prec=5, print_mode='digits')
sage: ~R(17)
...13403
sage: repr(~R(17))
'...13403'
You can change extensions::
Expand Down Expand Up @@ -256,6 +256,11 @@ def change(self, **kwds):
field = kwds.pop('field')
if field:
ring = ring.fraction_field()
if 'type' not in kwds:
if self._prec_type() == 'capped-abs':
kwds['type'] = 'capped-rel'
elif self._prec_type() == 'fixed-mod':
raise TypeError('You must specify the type explicitly')
else:
ring = ring.ring_of_integers()
for atr in ('p', 'prec', 'type'):
Expand Down Expand Up @@ -294,9 +299,11 @@ def change(self, **kwds):
elif n is not None:
functor.polys = [n]
for atr in ('names', 'var_name', 'res_name', 'unram_name', 'ram_name'):
functor.kwds[atr] = kwds.pop(atr)
if atr in kwds:
functor.kwds[atr] = kwds.pop(atr)
for atr in ('print_mode', 'halt', 'print_pos', 'print_sep', 'print_alphabet', 'print_max_terms', 'check'):
functor.kwds[atr] = kwds[atr]
if atr in kwds:
functor.kwds[atr] = kwds[atr]
try:
ring = ring.change(**kwds)
except AttributeError:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/padic_extension_generic.py
Expand Up @@ -264,7 +264,7 @@ def construction(self):
"""
from sage.categories.pushout import AlgebraicExtensionFunctor as AEF
print_mode = self._printer.dict()
return (AEF([self._given_poly], [self.variable_name()],
return (AEF([self._pre_poly], [self.variable_name()],
prec=self.precision_cap(), print_mode=self._printer.dict(),
implementation=self._implementation),
self.base_ring())
Expand Down

0 comments on commit a88b630

Please sign in to comment.