Skip to content

Commit 539f3cd

Browse files
committed
Fix remaining all imports
Also fix cyclic import File "<doctest sage.categories.sets_cat.Sets.WithRealizations.ParentMethods.inject_shorthands[0]>", line 1, in <module> S = SymmetricFunctions(ZZ); S # needs sage.combinat sage.modules File "sage/misc/lazy_import.pyx", line 406, in sage.misc.lazy_import.LazyImport.__call__ return self.get_object()(*args, **kwds) File "sage/misc/lazy_import.pyx", line 224, in sage.misc.lazy_import.LazyImport.get_object return self._get_object() File "sage/misc/lazy_import.pyx", line 265, in sage.misc.lazy_import.LazyImport._get_object raise File "sage/misc/lazy_import.pyx", line 259, in sage.misc.lazy_import.LazyImport._get_object self._object = getattr(__import__(self._module, {}, {}, [self._name]), self._name) File "/sage/src/sage/combinat/sf/sf.py", line 34, in <module> from . import schur File "/sage/src/sage/combinat/sf/schur.py", line 21, in <module> from . import classical File "/sage/src/sage/combinat/sf/classical.py", line 30, in <module> from . import jack File "/sage/src/sage/combinat/sf/jack.py", line 34, in <module> from sage.combinat.sf.sf import SymmetricFunctions
1 parent 931cc5e commit 539f3cd

File tree

92 files changed

+269
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+269
-230
lines changed

src/sage/arith/misc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ def plot(self, xmin=1, xmax=50, k=1, pointsize=30, rgbcolor=(0, 0, 1), join=True
17051705
124.0
17061706
"""
17071707
v = [(n, sigma(n, k)) for n in range(xmin, xmax + 1)]
1708-
from sage.plot.all import list_plot
1708+
from sage.plot.plot import list_plot
17091709
P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds)
17101710
if join:
17111711
P += list_plot(v, plotjoined=True, rgbcolor=(0.7, 0.7, 0.7), **kwds)
@@ -3193,7 +3193,7 @@ def plot(self, xmin=1, xmax=50, pointsize=30, rgbcolor=(0, 0, 1),
31933193
46.0
31943194
"""
31953195
v = [(n, euler_phi(n)) for n in range(xmin, xmax + 1)]
3196-
from sage.plot.all import list_plot
3196+
from sage.plot.plot import list_plot
31973197
P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds)
31983198
if join:
31993199
P += list_plot(v, plotjoined=True, rgbcolor=(0.7, 0.7, 0.7), **kwds)
@@ -4743,7 +4743,7 @@ def plot(self, xmin=0, xmax=50, pointsize=30, rgbcolor=(0, 0, 1), join=True,
47434743
"""
47444744
values = self.range(xmin, xmax + 1)
47454745
v = [(n, values[n - xmin]) for n in range(xmin, xmax + 1)]
4746-
from sage.plot.all import list_plot
4746+
from sage.plot.plot import list_plot
47474747
P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds)
47484748
if join:
47494749
P += list_plot(v, plotjoined=True, rgbcolor=(0.7, 0.7, 0.7), **kwds)
@@ -5271,7 +5271,7 @@ def falling_factorial(x, a):
52715271
(isinstance(a, Expression) and
52725272
a.is_integer())) and a >= 0:
52735273
return prod(((x - i) for i in range(a)), z=x.parent().one())
5274-
from sage.functions.all import gamma
5274+
from sage.functions.gamma import gamma
52755275
return gamma(x + 1) / gamma(x - a + 1)
52765276

52775277

@@ -5363,7 +5363,7 @@ def rising_factorial(x, a):
53635363
(isinstance(a, Expression) and
53645364
a.is_integer())) and a >= 0:
53655365
return prod(((x + i) for i in range(a)), z=x.parent().one())
5366-
from sage.functions.all import gamma
5366+
from sage.functions.gamma import gamma
53675367
return gamma(x + a) / gamma(x)
53685368

53695369

src/sage/calculus/desolvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ def desolve_rk4_inner(de, dvar):
13651365

13661366
if not (isinstance(dvar, Expression) and dvar.is_symbol()):
13671367
from sage.symbolic.ring import SR
1368-
from sage.calculus.all import diff
1368+
from sage.calculus.functional import diff
13691369
from sage.symbolic.relation import solve
13701370
if isinstance(de, Expression) and de.is_relational():
13711371
de = de.lhs() - de.rhs()

src/sage/calculus/riemann.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ cdef class Riemann_Map:
744744
sage: m.plot_boundaries(plotjoined=False, rgbcolor=[0,0,1], thickness=6) # needs sage.plot
745745
Graphics object consisting of 1 graphics primitive
746746
"""
747-
from sage.plot.all import list_plot
747+
from sage.plot.plot import list_plot
748748

749749
if rgbcolor is None:
750750
rgbcolor = [0, 0, 0]
@@ -942,7 +942,8 @@ cdef class Riemann_Map:
942942
....: thickness=2.0, min_mag=0.1)
943943
"""
944944
from sage.plot.complex_plot import ComplexPlot
945-
from sage.plot.all import list_plot, Graphics
945+
from sage.plot.plot import list_plot
946+
from sage.plot.graphics import Graphics
946947

947948
cdef int k, i
948949
if self.exterior:
@@ -1068,7 +1069,7 @@ cdef class Riemann_Map:
10681069
Graphics object consisting of 1 graphics primitive
10691070
"""
10701071
from sage.plot.complex_plot import ComplexPlot
1071-
from sage.plot.all import Graphics
1072+
from sage.plot.graphics import Graphics
10721073

10731074
if plot_range is None:
10741075
plot_range = []

src/sage/categories/examples/finite_coxeter_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __contains__(self, x):
129129
130130
(also tested by :meth:`test_an_element` :meth:`test_some_elements`)
131131
"""
132-
from sage.structure.all import parent
132+
from sage.structure.element import parent
133133
return parent(x) is self
134134

135135
@cached_method

src/sage/categories/number_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def zeta_function(self, prec=53,
185185
PARI zeta function associated to Rational Field
186186
"""
187187
if algorithm == 'gp':
188-
from sage.lfunctions.all import Dokchitser
188+
from sage.lfunctions.dokchitser import Dokchitser
189189
r1, r2 = self.signature()
190190
zero = [0]
191191
one = [1]

src/sage/categories/sets_cat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from sage.misc.lazy_format import LazyFormat
3939
from sage.categories.category import Category
4040
from sage.categories.category_singleton import Category_singleton
41-
# Do not use sage.categories.all here to avoid initialization loop
4241
from sage.categories.sets_with_partial_maps import SetsWithPartialMaps
4342
from sage.categories.subquotients import SubquotientsCategory
4443
from sage.categories.quotients import QuotientsCategory

src/sage/coding/goppa_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from sage.coding.linear_code import AbstractLinearCode
3434
from sage.coding.encoder import Encoder
3535
from sage.modules.free_module_element import vector
36-
from sage.coding.all import codes
36+
import sage.coding.codes_catalog as codes
3737

3838

3939
def _columnize(element):

src/sage/combinat/combinat.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,22 @@
164164
# https://www.gnu.org/licenses/
165165
# ****************************************************************************
166166
from __future__ import annotations
167+
167168
from collections.abc import Iterator
168169

169170
from sage.arith.misc import bernoulli, factorial
170-
from sage.rings.integer_ring import ZZ
171-
from sage.rings.rational_field import QQ
171+
from sage.combinat.combinat_cython import _stirling_number2
172+
from sage.misc.cachefunc import cached_function
173+
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
174+
from sage.misc.lazy_import import lazy_import
175+
from sage.misc.misc_c import prod
172176
from sage.rings.integer import Integer
177+
from sage.rings.integer_ring import ZZ
173178
from sage.rings.polynomial.polynomial_element import Polynomial
174179
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
175-
from sage.misc.misc_c import prod
176-
from sage.misc.cachefunc import cached_function
177-
from sage.structure.sage_object import SageObject
178-
from sage.misc.lazy_import import lazy_import
179-
from .combinat_cython import _stirling_number2
180-
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
180+
from sage.rings.rational_field import QQ
181181
from sage.structure.element import Element
182+
from sage.structure.sage_object import SageObject
182183

183184
lazy_import('sage.interfaces.maxima_lib', 'maxima')
184185
lazy_import('sage.libs.pari', 'pari')
@@ -385,7 +386,7 @@ def bell_number(n, algorithm='flint', **options) -> Integer:
385386
if n < 0:
386387
raise ArithmeticError('Bell numbers not defined for negative indices')
387388
if algorithm == 'mpmath':
388-
from sage.libs.mpmath.all import bell, mp, mag
389+
from mpmath import bell, mag, mp
389390
old_prec = mp.dps
390391
if 'prec' in options:
391392
mp.dps = options['prec']
@@ -2059,8 +2060,8 @@ def bell_polynomial(n: Integer, k=None, ordinary=False):
20592060
the polynomial is in variable ``x0``. extended to complete exponential,
20602061
partial ordinary and complete ordinary Bell polynomials.
20612062
"""
2062-
from sage.combinat.partition import Partitions
20632063
from sage.arith.misc import multinomial
2064+
from sage.combinat.partition import Partitions
20642065
if k is None:
20652066
partitions = Partitions(n)
20662067
# We set k = 1 to use the correct ring

src/sage/combinat/designs/block_design.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def are_hyperplanes_in_projective_geometry_parameters(v, k, lmbda, return_parame
148148
....: assert are_hyperplanes_in_projective_geometry_parameters(v,k,l+1) is False
149149
....: assert are_hyperplanes_in_projective_geometry_parameters(v,k,l-1) is False
150150
"""
151-
import sage.arith.all as arith
151+
from sage.arith.misc import gcd
152152

153153
q1 = Integer(v - k)
154154
q2 = Integer(k - lmbda)
@@ -161,7 +161,7 @@ def are_hyperplanes_in_projective_geometry_parameters(v, k, lmbda, return_parame
161161
p1,e1 = q1.factor()[0]
162162
p2,e2 = q2.factor()[0]
163163

164-
k = arith.gcd(e1,e2)
164+
k = gcd(e1,e2)
165165
d = e1//k
166166
q = p1**k
167167
if e2//k != d-1 or lmbda != (q**(d-1)-1)//(q-1):

src/sage/combinat/designs/difference_family.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@
4747
# https://www.gnu.org/licenses/
4848
# ****************************************************************************
4949

50-
from sage.arith.misc import is_prime_power
50+
from sage.arith.misc import is_prime_power, is_square, factor
5151
from sage.misc.cachefunc import cached_function
5252

5353
from sage.categories.sets_cat import EmptySetError
54-
import sage.arith.all as arith
5554
from sage.misc.unknown import Unknown
5655
from sage.rings.finite_rings.integer_mod_ring import Zmod
5756
from sage.rings.integer import Integer
@@ -572,13 +571,13 @@ def radical_difference_set(K, k, l=1, existence=False, check=True):
572571
add_zero = True
573572

574573
# q = 4t^2 + 1, t odd
575-
elif v % 8 == 5 and k == (v-1)//4 and arith.is_square((v-1)//4):
574+
elif v % 8 == 5 and k == (v-1)//4 and is_square((v-1)//4):
576575
if existence:
577576
return True
578577
add_zero = False
579578

580579
# q = 4t^2 + 9, t odd
581-
elif v % 8 == 5 and k == (v+3)//4 and arith.is_square((v-9)//4):
580+
elif v % 8 == 5 and k == (v+3)//4 and is_square((v-9)//4):
582581
if existence:
583582
return True
584583
add_zero = True
@@ -3823,7 +3822,7 @@ def difference_family(v, k, l=1, existence=False, explain_construction=False, ch
38233822
G = Zmod(v)
38243823
return G, [list(range(1, v))]
38253824

3826-
factorization = arith.factor(v)
3825+
factorization = factor(v)
38273826
if len(factorization) == 1:
38283827
from sage.rings.finite_rings.finite_field_constructor import GF
38293828
K = GF(v,'z')

0 commit comments

Comments
 (0)