-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding the category keyword to padic rings and fields classes
- Loading branch information
Showing
4 changed files
with
51 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
sage: R = QpLF(2) | ||
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2007-2013 David Roe <[email protected]> | ||
# William Stein <[email protected]> | ||
# | ||
|
@@ -26,10 +26,11 @@ | |
# the License, or (at your option) any later version. | ||
# | ||
# https://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# **************************************************************************** | ||
|
||
from sage.misc.superseded import experimental | ||
|
||
from sage.categories.fields import Fields | ||
from sage.structure.factory import UniqueFactory | ||
from sage.rings.integer import Integer | ||
from sage.rings.infinity import Infinity | ||
|
@@ -783,35 +784,45 @@ def create_object(self, version, key): | |
pass | ||
p, prec, type, print_mode, name, print_pos, print_sep, print_alphabet, print_max_terms, show_prec, label = key | ||
|
||
_Fields = Fields() | ||
|
||
if type == 'capped-rel': | ||
if print_mode == 'terse': | ||
return pAdicFieldCappedRelative(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
else: | ||
return pAdicFieldCappedRelative(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
elif type == 'floating-point': | ||
if print_mode == 'terse': | ||
return pAdicFieldFloatingPoint(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
else: | ||
return pAdicFieldFloatingPoint(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
elif type == 'relaxed': | ||
if print_mode == 'terse': | ||
return pAdicFieldRelaxed(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
else: | ||
return pAdicFieldRelaxed(p, prec, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name) | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name, | ||
category=_Fields) | ||
elif type[:8] == 'lattice-': | ||
subtype = type[8:] | ||
if print_mode == 'terse': | ||
return pAdicFieldLattice(p, prec, subtype, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name, label) | ||
'ram_name': name, 'max_terse_terms': print_max_terms, 'show_prec': show_prec}, name, label, | ||
category=_Fields) | ||
else: | ||
return pAdicFieldLattice(p, prec, subtype, {'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet, | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name, label) | ||
'ram_name': name, 'max_ram_terms': print_max_terms, 'show_prec': show_prec}, name, label, | ||
category=_Fields) | ||
else: | ||
raise ValueError("unexpected type") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters