Skip to content

Commit

Permalink
Defer some changes to all__sagemath_{objects,categories} until sagema…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Nov 9, 2023
1 parent 6c422d0 commit 5e246ae
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 68 deletions.
7 changes: 7 additions & 0 deletions src/sage/misc/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
from sage.misc.classgraph import class_graph

lazy_import('sage.repl.interpreter', 'logstr', deprecation=34259)

# Following will go to all__sagemath_objects.py in #36566
from sage.misc.randstate import seed, set_random_seed, initial_seed, current_randstate
from sage.misc.prandom import *
from sage.misc.sage_timeit_class import timeit
from sage.misc.session import load_session, save_session, show_identifiers
from sage.misc.reset import reset, restore
9 changes: 0 additions & 9 deletions src/sage/misc/all__sagemath_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,4 @@

from sage.misc.abstract_method import abstract_method

from sage.misc.randstate import seed, set_random_seed, initial_seed, current_randstate

from sage.misc.prandom import *

from sage.misc.timing import walltime, cputime

from sage.misc.sage_timeit_class import timeit

from sage.misc.session import load_session, save_session, show_identifiers
from sage.misc.reset import reset, restore
69 changes: 69 additions & 0 deletions src/sage/rings/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,89 @@
except ImportError:
pass

### Following will go to all__sagemath_categories.py in #36566

# Quotient
from sage.rings.quotient_ring import QuotientRing

# Infinities
from sage.rings.infinity import infinity, Infinity, InfinityRing, unsigned_infinity, UnsignedInfinityRing
oo = infinity

# Rational integers.
from sage.rings.integer_ring import IntegerRing, ZZ, crt_basis
from sage.rings.integer import Integer

# Rational numbers
from sage.rings.rational import Rational
from sage.rings.rational_field import RationalField, QQ
Rationals = RationalField

# Integers modulo n.
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod
from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod
Integers = IntegerModRing

### up to here (#36566)

# Finite fields
from sage.rings.finite_rings.all import *

# Function field
from sage.rings.function_field.all import *

### Following will go to all__sagemath_categories.py in #36566

# Semirings
from sage.rings.semirings.all import *

# Double precision floating point numbers
from sage.rings.real_double import RealDoubleField, RDF, RealDoubleElement

# Lazy reals
from sage.rings.real_lazy import RealLazyField, RLF, ComplexLazyField, CLF

### up to here (#36566)

# Polynomial Rings and Polynomial Quotient Rings
from sage.rings.polynomial.all import *

### Following will go to all__sagemath_categories.py in #36566

# Power series rings
from sage.rings.power_series_ring import PowerSeriesRing

# Laurent series ring in one variable
from sage.rings.laurent_series_ring import LaurentSeriesRing

# Puiseux series ring
from sage.rings.puiseux_series_ring import PuiseuxSeriesRing

# Big-oh notation
from sage.rings.big_oh import O

# Fraction field
from sage.rings.fraction_field import FractionField
Frac = FractionField

# Localization
from sage.rings.localization import Localization

### up to here (#36566)

# c-finite sequences
from sage.rings.cfinite_sequence import CFiniteSequence, CFiniteSequences

from sage.rings.fast_arith import prime_range

### Following will go to all__sagemath_categories.py in #36566

# continued fractions
from sage.rings.continued_fraction import (continued_fraction,
continued_fraction_list)

### up to here (#36566)

# asymptotic ring
#from sage.rings.asymptotic.all import *
lazy_import('sage.rings.asymptotic.asymptotic_ring', 'AsymptoticRing')
Expand Down
65 changes: 6 additions & 59 deletions src/sage/rings/all__sagemath_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,14 @@
DedekindDomainElement, PrincipalIdealDomainElement,
EuclideanDomainElement, FieldElement)

# Rational numbers
from sage.rings.rational import Rational
from sage.rings.rational_field import RationalField, QQ
Rationals = RationalField

# Rational integers.
from sage.rings.integer_ring import IntegerRing, ZZ, crt_basis
from sage.rings.integer import Integer

# Integers modulo n.
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod
from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod
Integers = IntegerModRing

# Infinities
from sage.rings.infinity import infinity, Infinity, InfinityRing, unsigned_infinity, UnsignedInfinityRing
oo = infinity

# Quotient
from sage.rings.quotient_ring import QuotientRing

# Localization
from sage.rings.localization import Localization

# Fraction field
from sage.rings.fraction_field import FractionField
Frac = FractionField

# Function field
from sage.rings.function_field.all__sagemath_categories import *

# Double precision floating point numbers
from sage.rings.real_double import RealDoubleField, RDF, RealDoubleElement

# Ideals
from sage.rings.ideal import Ideal
ideal = Ideal

# Semirings
from sage.rings.semirings.all import *

from sage.rings.finite_rings.all__sagemath_categories import *
from sage.rings.number_field.all__sagemath_categories import *
from sage.rings.padics.all__sagemath_categories import *
from sage.rings.polynomial.all__sagemath_categories import *

# Power series rings
from sage.rings.power_series_ring import PowerSeriesRing

# Laurent series ring in one variable
from sage.rings.laurent_series_ring import LaurentSeriesRing

# Puiseux series ring
from sage.rings.puiseux_series_ring import PuiseuxSeriesRing

# Big-oh notation
from sage.rings.big_oh import O

# continued fractions
from sage.rings.continued_fraction import (continued_fraction,
continued_fraction_list)
### To be added in #36566:

# Lazy reals
from sage.rings.real_lazy import RealLazyField, RLF, ComplexLazyField, CLF
#from sage.rings.finite_rings.all__sagemath_categories import *
#from sage.rings.function_field.all__sagemath_categories import *
#from sage.rings.number_field.all__sagemath_categories import *
#from sage.rings.padics.all__sagemath_categories import *
#from sage.rings.polynomial.all__sagemath_categories import *

0 comments on commit 5e246ae

Please sign in to comment.