From 2d66f318bb71861626dffb8d07a5939e3cf671ac Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 5 Jan 2025 01:10:00 +0800 Subject: [PATCH] Fix remaining all imports --- src/sage/arith/misc.py | 10 +-- src/sage/calculus/desolvers.py | 2 +- src/sage/calculus/riemann.pyx | 7 +- .../examples/finite_coxeter_groups.py | 2 +- src/sage/categories/number_fields.py | 2 +- src/sage/categories/sets_cat.py | 1 - src/sage/coding/goppa_code.py | 2 +- src/sage/combinat/combinat.py | 3 +- src/sage/combinat/designs/block_design.py | 4 +- .../combinat/designs/difference_family.py | 9 ++- src/sage/combinat/sf/dual.py | 3 +- src/sage/combinat/sf/hall_littlewood.py | 7 +- src/sage/combinat/sf/jack.py | 12 ++-- src/sage/combinat/sf/llt.py | 3 +- src/sage/combinat/words/paths.py | 6 +- src/sage/crypto/lfsr.py | 2 +- .../complex_dynamics/mandel_julia_helper.pyx | 2 +- src/sage/geometry/cone.py | 3 +- .../hyperbolic_space/hyperbolic_isometry.py | 3 +- .../hyperbolic_space/hyperbolic_model.py | 2 +- src/sage/geometry/lattice_polytope.py | 2 +- src/sage/geometry/toric_lattice.py | 2 +- src/sage/geometry/toric_plotter.py | 3 +- src/sage/geometry/triangulation/element.py | 4 +- src/sage/geometry/voronoi_diagram.py | 5 +- src/sage/graphs/matching.py | 2 +- src/sage/graphs/matching_covered_graph.py | 2 +- src/sage/groups/perm_gps/cubegroup.py | 3 +- src/sage/interacts/library.py | 2 +- src/sage/interfaces/sympy.py | 2 +- src/sage/matrix/matrix_integer_dense.pyx | 6 +- src/sage/matroids/utilities.py | 2 +- src/sage/misc/functional.py | 4 +- src/sage/misc/latex.py | 5 +- src/sage/misc/parser.pyx | 2 +- src/sage/misc/sage_input.py | 4 +- src/sage/misc/table.py | 2 +- src/sage/modular/abvar/homspace.py | 2 +- src/sage/modular/arithgroup/farey_symbol.pyx | 5 +- src/sage/modular/hecke/ambient_module.py | 4 +- src/sage/modular/modform/eis_series.py | 2 +- src/sage/modular/modform/vm_basis.py | 2 +- src/sage/modules/fg_pid/fgp_module.py | 2 +- src/sage/modules/free_module_element.pyx | 2 +- src/sage/modules/matrix_morphism.py | 3 +- .../numerical/interactive_simplex_method.py | 2 +- src/sage/plot/arc.py | 2 +- src/sage/plot/arrow.py | 2 +- src/sage/plot/bezier_path.py | 2 +- src/sage/plot/circle.py | 2 +- src/sage/plot/complex_plot.pyx | 2 +- src/sage/plot/contour_plot.py | 6 +- src/sage/plot/density_plot.py | 2 +- src/sage/plot/disk.py | 2 +- src/sage/plot/ellipse.py | 2 +- src/sage/plot/hyperbolic_polygon.py | 2 +- src/sage/plot/line.py | 2 +- src/sage/plot/matrix_plot.py | 2 +- src/sage/plot/plot.py | 2 +- src/sage/plot/plot_field.py | 2 +- src/sage/plot/point.py | 2 +- src/sage/plot/polygon.py | 2 +- src/sage/plot/scatter_plot.py | 2 +- src/sage/plot/streamline_plot.py | 2 +- src/sage/plot/text.py | 2 +- .../quadratic_form__local_field_invariants.py | 2 +- .../quadratic_form__mass__Siegel_densities.py | 2 +- .../repl/ipython_kernel/widgets_sagenb.py | 2 +- .../finite_rings/finite_field_constructor.py | 5 +- src/sage/rings/integer.pyx | 2 +- src/sage/rings/number_field/number_field.py | 64 ++++++++++++------- .../number_field/number_field_element.pyx | 2 +- .../rings/number_field/number_field_rel.py | 7 +- src/sage/rings/padics/padic_base_generic.py | 2 +- src/sage/rings/polynomial/convolution.py | 2 +- .../polynomial/infinite_polynomial_ring.py | 3 +- .../polynomial/multi_polynomial_ideal.py | 2 +- .../polynomial_padic_capped_relative_dense.py | 4 +- src/sage/schemes/curves/constructor.py | 2 +- src/sage/schemes/elliptic_curves/cm.py | 2 +- .../elliptic_curves/descent_two_isogeny.pyx | 12 ++-- src/sage/schemes/elliptic_curves/heegner.py | 5 +- .../schemes/elliptic_curves/lseries_ell.py | 2 +- src/sage/schemes/generic/algebraic_scheme.py | 2 +- src/sage/schemes/plane_conics/constructor.py | 2 +- src/sage/schemes/toric/sheaf/klyachko.py | 2 +- src/sage/stats/hmm/distributions.pyx | 2 +- src/sage/stats/time_series.pyx | 9 ++- src/sage/structure/parent_gens.pyx | 2 +- src/sage/symbolic/expression.pyx | 6 +- .../expression_conversion_algebraic.py | 2 +- src/sage/symbolic/expression_conversions.py | 2 +- 92 files changed, 200 insertions(+), 154 deletions(-) diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py index 637ed9192bd..86acb0e707e 100644 --- a/src/sage/arith/misc.py +++ b/src/sage/arith/misc.py @@ -1706,7 +1706,7 @@ def plot(self, xmin=1, xmax=50, k=1, pointsize=30, rgbcolor=(0,0,1), join=True, 124.0 """ v = [(n, sigma(n, k)) for n in range(xmin, xmax + 1)] - from sage.plot.all import list_plot + from sage.plot.plot import list_plot P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds) if join: P += list_plot(v, plotjoined=True, rgbcolor=(0.7,0.7,0.7), **kwds) @@ -3194,7 +3194,7 @@ def plot(self, xmin=1, xmax=50, pointsize=30, rgbcolor=(0, 0, 1), 46.0 """ v = [(n, euler_phi(n)) for n in range(xmin, xmax + 1)] - from sage.plot.all import list_plot + from sage.plot.plot import list_plot P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds) if join: P += list_plot(v, plotjoined=True, rgbcolor=(0.7,0.7,0.7), **kwds) @@ -4645,7 +4645,7 @@ def plot(self, xmin=0, xmax=50, pointsize=30, rgbcolor=(0,0,1), join=True, """ values = self.range(xmin, xmax + 1) v = [(n,values[n-xmin]) for n in range(xmin,xmax + 1)] - from sage.plot.all import list_plot + from sage.plot.plot import list_plot P = list_plot(v, pointsize=pointsize, rgbcolor=rgbcolor, **kwds) if join: P += list_plot(v, plotjoined=True, rgbcolor=(0.7,0.7,0.7), **kwds) @@ -5173,7 +5173,7 @@ def falling_factorial(x, a): (isinstance(a, Expression) and a.is_integer())) and a >= 0: return prod(((x - i) for i in range(a)), z=x.parent().one()) - from sage.functions.all import gamma + from sage.functions.gamma import gamma return gamma(x + 1) / gamma(x - a + 1) @@ -5265,7 +5265,7 @@ def rising_factorial(x, a): (isinstance(a, Expression) and a.is_integer())) and a >= 0: return prod(((x + i) for i in range(a)), z=x.parent().one()) - from sage.functions.all import gamma + from sage.functions.gamma import gamma return gamma(x + a) / gamma(x) diff --git a/src/sage/calculus/desolvers.py b/src/sage/calculus/desolvers.py index d17f5a14e90..3d597f56651 100644 --- a/src/sage/calculus/desolvers.py +++ b/src/sage/calculus/desolvers.py @@ -1365,7 +1365,7 @@ def desolve_rk4_inner(de, dvar): if not (isinstance(dvar, Expression) and dvar.is_symbol()): from sage.symbolic.ring import SR - from sage.calculus.all import diff + from sage.calculus.functional import diff from sage.symbolic.relation import solve if isinstance(de, Expression) and de.is_relational(): de = de.lhs() - de.rhs() diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx index 455567371eb..af18fee4d24 100644 --- a/src/sage/calculus/riemann.pyx +++ b/src/sage/calculus/riemann.pyx @@ -745,7 +745,7 @@ cdef class Riemann_Map: sage: m.plot_boundaries(plotjoined=False, rgbcolor=[0,0,1], thickness=6) # needs sage.plot Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import list_plot + from sage.plot.plot import list_plot plots = list(range(self.B)) for k in range(self.B): @@ -939,7 +939,8 @@ cdef class Riemann_Map: ....: thickness=2.0, min_mag=0.1) """ from sage.plot.complex_plot import ComplexPlot - from sage.plot.all import list_plot, Graphics + from sage.plot.plot import list_plot + from sage.plot.graphics import Graphics cdef int k, i if self.exterior: @@ -1051,7 +1052,7 @@ cdef class Riemann_Map: Graphics object consisting of 1 graphics primitive """ from sage.plot.complex_plot import ComplexPlot - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics z_values, xmin, xmax, ymin, ymax = self.compute_on_grid(plot_range, plot_points) diff --git a/src/sage/categories/examples/finite_coxeter_groups.py b/src/sage/categories/examples/finite_coxeter_groups.py index b84da8d221a..eb3b18ae8b8 100644 --- a/src/sage/categories/examples/finite_coxeter_groups.py +++ b/src/sage/categories/examples/finite_coxeter_groups.py @@ -129,7 +129,7 @@ def __contains__(self, x): (also tested by :meth:`test_an_element` :meth:`test_some_elements`) """ - from sage.structure.all import parent + from sage.structure.element import parent return parent(x) is self @cached_method diff --git a/src/sage/categories/number_fields.py b/src/sage/categories/number_fields.py index cc5571b5c07..e14c4077dfd 100644 --- a/src/sage/categories/number_fields.py +++ b/src/sage/categories/number_fields.py @@ -185,7 +185,7 @@ def zeta_function(self, prec=53, PARI zeta function associated to Rational Field """ if algorithm == 'gp': - from sage.lfunctions.all import Dokchitser + from sage.lfunctions.dokchitser import Dokchitser r1, r2 = self.signature() zero = [0] one = [1] diff --git a/src/sage/categories/sets_cat.py b/src/sage/categories/sets_cat.py index ba13c6bc9a4..33be5fdc815 100644 --- a/src/sage/categories/sets_cat.py +++ b/src/sage/categories/sets_cat.py @@ -38,7 +38,6 @@ from sage.misc.lazy_format import LazyFormat from sage.categories.category import Category from sage.categories.category_singleton import Category_singleton -# Do not use sage.categories.all here to avoid initialization loop from sage.categories.sets_with_partial_maps import SetsWithPartialMaps from sage.categories.subquotients import SubquotientsCategory from sage.categories.quotients import QuotientsCategory diff --git a/src/sage/coding/goppa_code.py b/src/sage/coding/goppa_code.py index aede3782597..45c3c87d52c 100644 --- a/src/sage/coding/goppa_code.py +++ b/src/sage/coding/goppa_code.py @@ -33,7 +33,7 @@ from sage.coding.linear_code import AbstractLinearCode from sage.coding.encoder import Encoder from sage.modules.free_module_element import vector -from sage.coding.all import codes +import sage.coding.codes_catalog as codes def _columnize(element): diff --git a/src/sage/combinat/combinat.py b/src/sage/combinat/combinat.py index 03c1797abfb..a4fbc01c33e 100644 --- a/src/sage/combinat/combinat.py +++ b/src/sage/combinat/combinat.py @@ -388,7 +388,8 @@ def bell_number(n, algorithm='flint', **options) -> Integer: if n < 0: raise ArithmeticError('Bell numbers not defined for negative indices') if algorithm == 'mpmath': - from sage.libs.mpmath.all import bell, mp, mag + from sage.libs.mpmath.all import bell, mag + from mpmath import mp old_prec = mp.dps if 'prec' in options: mp.dps = options['prec'] diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index 0c8b5b3fd38..00774c0fa47 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -148,7 +148,7 @@ def are_hyperplanes_in_projective_geometry_parameters(v, k, lmbda, return_parame ....: assert are_hyperplanes_in_projective_geometry_parameters(v,k,l+1) is False ....: assert are_hyperplanes_in_projective_geometry_parameters(v,k,l-1) is False """ - import sage.arith.all as arith + from sage.arith.misc import gcd q1 = Integer(v - k) q2 = Integer(k - lmbda) @@ -161,7 +161,7 @@ def are_hyperplanes_in_projective_geometry_parameters(v, k, lmbda, return_parame p1,e1 = q1.factor()[0] p2,e2 = q2.factor()[0] - k = arith.gcd(e1,e2) + k = gcd(e1,e2) d = e1//k q = p1**k if e2//k != d-1 or lmbda != (q**(d-1)-1)//(q-1): diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index a74634d32cf..bd745c7be0c 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -47,11 +47,10 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.arith.misc import is_prime_power +from sage.arith.misc import is_prime_power, is_square, factor from sage.misc.cachefunc import cached_function from sage.categories.sets_cat import EmptySetError -import sage.arith.all as arith from sage.misc.unknown import Unknown from sage.rings.finite_rings.integer_mod_ring import Zmod from sage.rings.integer import Integer @@ -572,13 +571,13 @@ def radical_difference_set(K, k, l=1, existence=False, check=True): add_zero = True # q = 4t^2 + 1, t odd - elif v % 8 == 5 and k == (v-1)//4 and arith.is_square((v-1)//4): + elif v % 8 == 5 and k == (v-1)//4 and is_square((v-1)//4): if existence: return True add_zero = False # q = 4t^2 + 9, t odd - elif v % 8 == 5 and k == (v+3)//4 and arith.is_square((v-9)//4): + elif v % 8 == 5 and k == (v+3)//4 and is_square((v-9)//4): if existence: return True add_zero = True @@ -3828,7 +3827,7 @@ def difference_family(v, k, l=1, existence=False, explain_construction=False, ch G = Zmod(v) return G, [list(range(1, v))] - factorization = arith.factor(v) + factorization = factor(v) if len(factorization) == 1: from sage.rings.finite_rings.finite_field_constructor import GF K = GF(v,'z') diff --git a/src/sage/combinat/sf/dual.py b/src/sage/combinat/sf/dual.py index 5feb90c385b..48fc8a17e0f 100644 --- a/src/sage/combinat/sf/dual.py +++ b/src/sage/combinat/sf/dual.py @@ -17,6 +17,7 @@ # # https://www.gnu.org/licenses/ #***************************************************************************** +from sage.categories.modules_with_basis import ModulesWithBasis from sage.categories.morphism import SetMorphism from sage.categories.homset import Hom from sage.matrix.constructor import matrix @@ -166,7 +167,7 @@ def __init__(self, dual_basis, scalar, scalar_name, basis_name, prefix): prefix=prefix) # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self.base_ring()) + category = ModulesWithBasis(self.base_ring()) self.register_coercion(SetMorphism(Hom(self._dual_basis, self, category), self._dual_to_self)) self._dual_basis.register_coercion(SetMorphism(Hom(self, self._dual_basis, category), self._self_to_dual)) diff --git a/src/sage/combinat/sf/hall_littlewood.py b/src/sage/combinat/sf/hall_littlewood.py index c725d478749..69c9e56b4ea 100644 --- a/src/sage/combinat/sf/hall_littlewood.py +++ b/src/sage/combinat/sf/hall_littlewood.py @@ -19,8 +19,9 @@ # http://www.gnu.org/licenses/ #***************************************************************************** +from sage.categories.modules_with_basis import ModulesWithBasis from sage.structure.unique_representation import UniqueRepresentation -from sage.libs.symmetrica.all import hall_littlewood +from sage.libs.symmetrica.symmetrica import hall_littlewood_symmetrica as hall_littlewood from . import sfa import sage.combinat.partition from sage.matrix.constructor import matrix @@ -385,7 +386,7 @@ def __init__(self, hall_littlewood): # common category BasesByOrthotriangularity (shared with Jack, HL, orthotriang, Mcdo) if hasattr(self, "_s_cache"): # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self._sym.base_ring()) + category = ModulesWithBasis(self._sym.base_ring()) self .register_coercion(SetMorphism(Hom(self._s, self, category), self._s_to_self)) self._s.register_coercion(SetMorphism(Hom(self, self._s, category), self._self_to_s)) @@ -856,7 +857,7 @@ def __init__(self, hall_littlewood): self._P = self._hall_littlewood.P() # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self.base_ring()) + category = ModulesWithBasis(self.base_ring()) phi = self.module_morphism(diagonal=self._P._q_to_p_normalization, codomain=self._P, category=category) diff --git a/src/sage/combinat/sf/jack.py b/src/sage/combinat/sf/jack.py index f104af0d9d5..0ae58a1fa3e 100644 --- a/src/sage/combinat/sf/jack.py +++ b/src/sage/combinat/sf/jack.py @@ -30,8 +30,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** +from sage.categories.modules_with_basis import ModulesWithBasis from sage.structure.unique_representation import UniqueRepresentation -import sage.categories.all from sage.rings.integer import Integer from sage.rings.rational_field import QQ from sage.arith.misc import gcd @@ -525,13 +525,13 @@ def __init__(self, jack): # common category BasesByOrthotriangularity (shared with Jack, HL, orthotriang, Mcdo) if hasattr(self, "_m_cache"): # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self._sym.base_ring()) + category = ModulesWithBasis(self._sym.base_ring()) self._m = self._sym.monomial() self .register_coercion(SetMorphism(Hom(self._m, self, category), self._m_to_self)) self._m.register_coercion(SetMorphism(Hom(self, self._m, category), self._self_to_m)) if hasattr(self, "_h_cache"): # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self._sym.base_ring()) + category = ModulesWithBasis(self._sym.base_ring()) self._h = self._sym.homogeneous() self .register_coercion(SetMorphism(Hom(self._h, self, category), self._h_to_self)) self._h.register_coercion(SetMorphism(Hom(self, self._h, category), self._self_to_h)) @@ -1080,7 +1080,7 @@ def __init__(self, jack): # Should be shared with _q (and possibly other bases in Macdo/HL) as BasesByRenormalization self._P = self._jack.P() # temporary until Hom(GradedHopfAlgebrasWithBasis) works better - category = sage.categories.all.ModulesWithBasis(self.base_ring()) + category = ModulesWithBasis(self.base_ring()) phi = self.module_morphism(diagonal=self.c1, codomain=self._P, category=category) # should use module_morphism(on_coeffs = ...) once it exists @@ -1116,7 +1116,7 @@ def __init__(self, jack): # Should be shared with _j (and possibly other bases in Macdo/HL) as BasesByRenormalization self._P = self._jack.P() # temporary until Hom(GradedHopfAlgebrasWithBasis) works better - category = sage.categories.all.ModulesWithBasis(self.base_ring()) + category = ModulesWithBasis(self.base_ring()) phi = self._P.module_morphism(diagonal=self._P.scalar_jack_basis, codomain=self, category=category) self.register_coercion(self._normalize_morphism(category) * phi) @@ -1348,7 +1348,7 @@ def __init__(self, Sym): #self._self_to_m_cache = {} and we don't need to compute it separately for zonals sfa.SymmetricFunctionAlgebra_generic.__init__(self, self._sym, prefix='Z', basis_name='zonal') - category = sage.categories.all.ModulesWithBasis(self._sym.base_ring()) + category = ModulesWithBasis(self._sym.base_ring()) self .register_coercion(SetMorphism(Hom(self._P, self, category), self.sum_of_terms)) self._P.register_coercion(SetMorphism(Hom(self, self._P, category), self._P.sum_of_terms)) diff --git a/src/sage/combinat/sf/llt.py b/src/sage/combinat/sf/llt.py index d0a0a040672..5cb2af63506 100644 --- a/src/sage/combinat/sf/llt.py +++ b/src/sage/combinat/sf/llt.py @@ -30,6 +30,7 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** +from sage.categories.modules_with_basis import ModulesWithBasis from sage.structure.unique_representation import UniqueRepresentation from . import sfa import sage.combinat.ribbon_tableau as ribbon_tableau @@ -450,7 +451,7 @@ def __init__(self, llt, prefix): sfa.SymmetricFunctionAlgebra_generic.__init__(self, self._sym, self._basis_name) # temporary until Hom(GradedHopfAlgebrasWithBasis work better) - category = sage.categories.all.ModulesWithBasis(self._sym.base_ring()) + category = ModulesWithBasis(self._sym.base_ring()) self._m = llt._sym.m() self .register_coercion(SetMorphism(Hom(self._m, self, category), self._m_to_self)) self._m.register_coercion(SetMorphism(Hom(self, self._m, category), self._self_to_m)) diff --git a/src/sage/combinat/words/paths.py b/src/sage/combinat/words/paths.py index a17331b7b82..06a8696e533 100644 --- a/src/sage/combinat/words/paths.py +++ b/src/sage/combinat/words/paths.py @@ -1393,7 +1393,7 @@ def plot_projection(self, v=None, letters=None, color=None, ring=None, if letters is None: letters = self.parent().alphabet() if color is None: - from sage.plot.all import hue + from sage.plot.colors import hue A = self.parent().alphabet() color = {a: hue(A.rank(a) / float(A.cardinality())) for a in A} it = self.projected_point_iterator(v, ring=ring) @@ -1655,7 +1655,9 @@ def animate(self): See www.imagemagick.org, for example. """ - from sage.plot.all import line, polygon, animate + from sage.plot.line import line + from sage.plot.polygon import polygon + from sage.plot.animate import animate pts = list(self.points()) diff --git a/src/sage/crypto/lfsr.py b/src/sage/crypto/lfsr.py index 7a640e91533..dfd56a43383 100644 --- a/src/sage/crypto/lfsr.py +++ b/src/sage/crypto/lfsr.py @@ -127,7 +127,7 @@ import copy -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from sage.rings.finite_rings.finite_field_base import FiniteField from sage.rings.integer import Integer from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing diff --git a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx index 2fd00e9b07a..ce4f7064b91 100644 --- a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +++ b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx @@ -31,7 +31,7 @@ from sage.rings.cc import CC from sage.rings.real_double import RDF from sage.rings.complex_double import CDF from sage.ext.fast_callable import fast_callable -from sage.calculus.all import symbolic_expression +from sage.calculus.expr import symbolic_expression from sage.symbolic.ring import SR from sage.calculus.var import var from sage.rings.fraction_field import FractionField_generic diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index edb5aa3a3af..6b949348953 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -227,7 +227,8 @@ from sage.modules.free_module_element import vector from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ -from sage.structure.all import SageObject, parent +from sage.structure.sage_object import SageObject +from sage.structure.element import parent from sage.structure.richcmp import richcmp_method, richcmp lazy_import('sage.geometry.integral_points', 'parallelotope_points') from sage.geometry.convex_set import ConvexSet_closed diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py b/src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py index 9fe8f9e5a67..90b38ae52dc 100644 --- a/src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py +++ b/src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py @@ -53,7 +53,8 @@ from sage.rings.real_double import RDF from sage.functions.other import imag from sage.misc.functional import sqrt -from sage.functions.all import arccosh, sign +from sage.functions.hyperbolic import acosh as arccosh +from sage.functions.generalized import sgn as sign from sage.geometry.hyperbolic_space.hyperbolic_constants import EPSILON from sage.geometry.hyperbolic_space.hyperbolic_geodesic import HyperbolicGeodesic diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_model.py b/src/sage/geometry/hyperbolic_space/hyperbolic_model.py index d9def677e6d..d9b67a44a83 100644 --- a/src/sage/geometry/hyperbolic_space/hyperbolic_model.py +++ b/src/sage/geometry/hyperbolic_space/hyperbolic_model.py @@ -82,7 +82,7 @@ from sage.misc.lazy_import import lazy_import from sage.functions.other import imag, real from sage.misc.functional import sqrt -from sage.functions.all import arccosh +from sage.functions.hyperbolic import acosh as arccosh from sage.rings.cc import CC from sage.rings.real_double import RDF from sage.rings.real_mpfr import RR diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 2869dcc7442..24cb2a4dd35 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -153,7 +153,7 @@ from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ from sage.sets.set import Set_generic -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, richcmp from sage.geometry.convex_set import ConvexSet_compact diff --git a/src/sage/geometry/toric_lattice.py b/src/sage/geometry/toric_lattice.py index a79bac65c6e..f1779f89a94 100644 --- a/src/sage/geometry/toric_lattice.py +++ b/src/sage/geometry/toric_lattice.py @@ -149,7 +149,7 @@ from sage.misc.lazy_import import lazy_import lazy_import('sage.geometry.toric_plotter', 'ToricPlotter') from sage.misc.latex import latex -from sage.structure.all import parent +from sage.structure.element import parent from sage.structure.richcmp import (richcmp_method, richcmp, rich_to_bool, richcmp_not_equal) from sage.modules.fg_pid.fgp_element import FGP_Element diff --git a/src/sage/geometry/toric_plotter.py b/src/sage/geometry/toric_plotter.py index 398903fc76a..26c688bb3e6 100644 --- a/src/sage/geometry/toric_plotter.py +++ b/src/sage/geometry/toric_plotter.py @@ -1077,7 +1077,8 @@ def sector(ray1, ray2, **extra_options): sage: sector((3,2,1), (1,2,3)) # needs sage.plot Graphics3d Object """ - from sage.functions.all import arccos, arctan2 + from sage.functions.trig import acos as arccos + from sage.functions.trig import arctan2 ray1 = vector(RDF, ray1) ray2 = vector(RDF, ray2) diff --git a/src/sage/geometry/triangulation/element.py b/src/sage/geometry/triangulation/element.py index 2baf66a578e..3ff2089abe9 100644 --- a/src/sage/geometry/triangulation/element.py +++ b/src/sage/geometry/triangulation/element.py @@ -68,7 +68,9 @@ def triangulation_render_2d(triangulation, **kwds): sage: triang.plot(axes=False, aspect_ratio=1) # indirect doctest # needs sage.plot Graphics object consisting of 12 graphics primitives """ - from sage.plot.all import point2d, line2d, polygon2d + from sage.plot.point import point2d + from sage.plot.line import line2d + from sage.plot.polygon import polygon2d points = [point.reduced_affine() for point in triangulation.point_configuration()] coord = [ [p[0], p[1]] for p in points ] plot_points = sum([ point2d(p, diff --git a/src/sage/geometry/voronoi_diagram.py b/src/sage/geometry/voronoi_diagram.py index 9929ae7ca60..f5722b671b8 100644 --- a/src/sage/geometry/voronoi_diagram.py +++ b/src/sage/geometry/voronoi_diagram.py @@ -280,7 +280,10 @@ def plot(self, cell_colors=None, **kwds): NotImplementedError: Plotting of 3-dimensional Voronoi diagrams not implemented """ - from sage.plot.all import line, point, rainbow, plot + from sage.plot.line import line + from sage.plot.point import point + from sage.plot.colors import rainbow + from sage.plot.plot import plot if self.ambient_dim() == 2: S = line([]) diff --git a/src/sage/graphs/matching.py b/src/sage/graphs/matching.py index c8eea2bb005..e7211efbb45 100644 --- a/src/sage/graphs/matching.py +++ b/src/sage/graphs/matching.py @@ -1636,4 +1636,4 @@ def M_alternating_even_mark(G, vertex, matching): rank[y] = rank[x] + 1 rank[z] = rank[y] + 1 - return even \ No newline at end of file + return even diff --git a/src/sage/graphs/matching_covered_graph.py b/src/sage/graphs/matching_covered_graph.py index 9e06d4ebfca..685d0d79098 100644 --- a/src/sage/graphs/matching_covered_graph.py +++ b/src/sage/graphs/matching_covered_graph.py @@ -2750,4 +2750,4 @@ def update_matching(self, matching): raise exception -__doc__ = __doc__.replace('{INDEX_OF_METHODS}', gen_thematic_rest_table_index(MatchingCoveredGraph, only_local_functions=False)) \ No newline at end of file +__doc__ = __doc__.replace('{INDEX_OF_METHODS}', gen_thematic_rest_table_index(MatchingCoveredGraph, only_local_functions=False)) diff --git a/src/sage/groups/perm_gps/cubegroup.py b/src/sage/groups/perm_gps/cubegroup.py index a9a24f2b26c..e732577dd10 100644 --- a/src/sage/groups/perm_gps/cubegroup.py +++ b/src/sage/groups/perm_gps/cubegroup.py @@ -168,7 +168,8 @@ def rotation_list(tilt, turn): sage: rotation_list(30, 45) [0.49999999999999994, 0.7071067811865475, 0.8660254037844387, 0.7071067811865476] """ - from sage.functions.all import sin, cos + from sage.functions.trig import sin + from sage.functions.trig import cos return [sin(tilt*pi/180.0), sin(turn*pi/180.0), cos(tilt*pi/180.0), cos(turn*pi/180.0)] diff --git a/src/sage/interacts/library.py b/src/sage/interacts/library.py index a58a0748477..75d3bbbe135 100644 --- a/src/sage/interacts/library.py +++ b/src/sage/interacts/library.py @@ -39,7 +39,7 @@ from sage.arith.misc import factor from sage.arith.srange import srange -from sage.calculus.all import symbolic_expression +from sage.calculus.expr import symbolic_expression from sage.calculus.functional import derivative from sage.calculus.integration import numerical_integral as integral_numerical from sage.ext.fast_callable import fast_callable diff --git a/src/sage/interfaces/sympy.py b/src/sage/interfaces/sympy.py index 5a380a86271..c079578b641 100644 --- a/src/sage/interfaces/sympy.py +++ b/src/sage/interfaces/sympy.py @@ -1299,7 +1299,7 @@ def test_functions(): def test_issue_4023(): from sage.symbolic.ring import SR - from sage.functions.all import log + from sage.misc.functional import log from sympy import integrate, simplify a, x = SR.var("a x") i = integrate(log(x) / a, (x, a, a + 1)) diff --git a/src/sage/matrix/matrix_integer_dense.pyx b/src/sage/matrix/matrix_integer_dense.pyx index 9ea2335b297..4848ae629db 100644 --- a/src/sage/matrix/matrix_integer_dense.pyx +++ b/src/sage/matrix/matrix_integer_dense.pyx @@ -3164,8 +3164,7 @@ cdef class Matrix_integer_dense(Matrix_dense): cdef Matrix_integer_dense U = None # transformation matrix tm = verbose("LLL of %sx%s matrix (algorithm %s)"%(self.nrows(), self.ncols(), algorithm)) - import sage.libs.ntl.all - ntl_ZZ = sage.libs.ntl.all.ZZ + from sage.libs.ntl.ntl_ZZ import ntl_ZZ verb = get_verbose() >= 2 @@ -3211,8 +3210,9 @@ cdef class Matrix_integer_dense(Matrix_dense): raise TypeError("eta must be >= 0.5") if algorithm.startswith('NTL:'): + from sage.libs.ntl.ntl_mat_ZZ import ntl_mat_ZZ as mat_ZZ - A = sage.libs.ntl.all.mat_ZZ(self.nrows(),self.ncols(), + A = mat_ZZ(self.nrows(),self.ncols(), [ntl_ZZ(z) for z in self.list()]) if algorithm == "NTL:LLL": diff --git a/src/sage/matroids/utilities.py b/src/sage/matroids/utilities.py index c9b903594c5..7a451e3921d 100644 --- a/src/sage/matroids/utilities.py +++ b/src/sage/matroids/utilities.py @@ -27,7 +27,7 @@ from sage.matrix.constructor import Matrix from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ -from sage.structure.all import SageObject +from sage.structure.sage_object import SageObject from operator import itemgetter diff --git a/src/sage/misc/functional.py b/src/sage/misc/functional.py index fa8b7923d99..8519a5457a6 100644 --- a/src/sage/misc/functional.py +++ b/src/sage/misc/functional.py @@ -1769,7 +1769,7 @@ def isqrt(x): try: return x.isqrt() except AttributeError: - from sage.functions.all import floor + from sage.functions.other import floor n = Integer(floor(x)) return n.isqrt() @@ -1813,7 +1813,7 @@ def squarefree_part(x): except AttributeError: pass from sage.arith.misc import factor - from sage.structure.all import parent + from sage.structure.element import parent F = factor(x) n = parent(x)(1) for p, e in F: diff --git a/src/sage/misc/latex.py b/src/sage/misc/latex.py index 9d8fcd4a341..5b2e0350b4c 100644 --- a/src/sage/misc/latex.py +++ b/src/sage/misc/latex.py @@ -1997,8 +1997,9 @@ def png(x, filename, density=150, debug=False, sage: with tempfile.NamedTemporaryFile(suffix='.png') as f: # random ....: png(ZZ[x], f.name) """ - import sage.plot.all - if isinstance(x, sage.plot.graphics.Graphics): + from sage.plot.graphics import Graphics + + if isinstance(x, Graphics): x.save(filename) return # if not graphics: create a string of latex code to write in a file diff --git a/src/sage/misc/parser.pyx b/src/sage/misc/parser.pyx index 522f5ebf55e..03b4382eace 100644 --- a/src/sage/misc/parser.pyx +++ b/src/sage/misc/parser.pyx @@ -904,7 +904,7 @@ cdef class Parser: operand2 = self.p_factor(tokens) return operand1 ** operand2 elif token == c"!": - from sage.functions.all import factorial + from sage.functions.other import factorial operand1 = factorial(operand1) if tokens.peek() == c'^': tokens.next() diff --git a/src/sage/misc/sage_input.py b/src/sage/misc/sage_input.py index 08bfde6e715..ec50848746c 100644 --- a/src/sage/misc/sage_input.py +++ b/src/sage/misc/sage_input.py @@ -446,7 +446,7 @@ def __call__(self, x, coerced=False): # However, we don't want to assume that hashing x is always # efficient, so we only try the lookup if some value of the same # type as x has been cached. - from sage.structure.all import parent + from sage.structure.element import parent if type(x) in self._cached_types: v = self._cache.get((parent(x), x)) @@ -649,7 +649,7 @@ def cache(self, x, sie, name): GF_101 = GF(101) GF_101(42) + GF_101(43) """ - from sage.structure.all import parent + from sage.structure.element import parent self._cached_types.add(type(x)) self._cache[(parent(x), x)] = sie diff --git a/src/sage/misc/table.py b/src/sage/misc/table.py index 61ead0537b1..4dd735fc729 100644 --- a/src/sage/misc/table.py +++ b/src/sage/misc/table.py @@ -804,7 +804,7 @@ def _html_table_row(self, file, row, header=False): import types try: - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics except ImportError: Graphics = () diff --git a/src/sage/modular/abvar/homspace.py b/src/sage/modular/abvar/homspace.py index 30ad76f3601..bc5ee85e1b6 100644 --- a/src/sage/modular/abvar/homspace.py +++ b/src/sage/modular/abvar/homspace.py @@ -182,7 +182,7 @@ from copy import copy from sage.categories.homset import HomsetWithBase -from sage.structure.all import parent +from sage.structure.element import parent from sage.structure.parent import Parent from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/modular/arithgroup/farey_symbol.pyx b/src/sage/modular/arithgroup/farey_symbol.pyx index af81a0f61fc..466ba3ce00f 100644 --- a/src/sage/modular/arithgroup/farey_symbol.pyx +++ b/src/sage/modular/arithgroup/farey_symbol.pyx @@ -959,9 +959,10 @@ cdef class Farey: ....: thickness='2') Graphics object consisting of 58 graphics primitives """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.colors import rainbow - from sage.plot.all import hyperbolic_arc, hyperbolic_triangle + from sage.plot.hyperbolic_arc import hyperbolic_arc + from sage.plot.hyperbolic_polygon import hyperbolic_triangle I = CC(0, 1) w = RR(3).sqrt() diff --git a/src/sage/modular/hecke/ambient_module.py b/src/sage/modular/hecke/ambient_module.py index 0e769d47ace..4fb625d5183 100644 --- a/src/sage/modular/hecke/ambient_module.py +++ b/src/sage/modular/hecke/ambient_module.py @@ -25,12 +25,12 @@ from sage.modules.free_module import FreeModule, FreeModule_generic from sage.rings.integer import Integer -import sage.arith.all as arith +import sage.arith.misc as arith import sage.matrix.matrix_space as matrix_space from sage.matrix.constructor import matrix -from sage.modular.arithgroup.all import Gamma0 # for Sturm bound +from sage.modular.arithgroup.congroup_gamma0 import Gamma0_constructor as Gamma0 # for Sturm bound def is_AmbientHeckeModule(x) -> bool: diff --git a/src/sage/modular/modform/eis_series.py b/src/sage/modular/modform/eis_series.py index 5676bf0507a..f098bb5a022 100644 --- a/src/sage/modular/modform/eis_series.py +++ b/src/sage/modular/modform/eis_series.py @@ -425,7 +425,7 @@ def eisenstein_series_lseries(weight, prec=53, -5.0235535164599797471968418348135050804419155747868718371029 """ f = eisenstein_series_qexp(weight, prec) - from sage.lfunctions.all import Dokchitser + from sage.lfunctions.dokchitser import Dokchitser j = weight L = Dokchitser(conductor=1, gammaV=[0, 1], diff --git a/src/sage/modular/modform/vm_basis.py b/src/sage/modular/modform/vm_basis.py index 58f36fd0f1a..cfe3f68670b 100644 --- a/src/sage/modular/modform/vm_basis.py +++ b/src/sage/modular/modform/vm_basis.py @@ -39,7 +39,7 @@ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.rational_field import QQ -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from .eis_series_cython import eisenstein_series_poly diff --git a/src/sage/modules/fg_pid/fgp_module.py b/src/sage/modules/fg_pid/fgp_module.py index 435796d83e5..7ef90b4194a 100644 --- a/src/sage/modules/fg_pid/fgp_module.py +++ b/src/sage/modules/fg_pid/fgp_module.py @@ -214,7 +214,7 @@ from sage.modules.module import Module from sage.modules.free_module import FreeModule_generic -from sage.structure.all import parent +from sage.structure.element import parent from sage.structure.sequence import Sequence from .fgp_element import DEBUG, FGP_Element from .fgp_morphism import FGP_Morphism, FGP_Homset diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx index a9d074007f0..bcfa7f57347 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx @@ -4084,7 +4084,7 @@ cdef class FreeModuleElement(Vector): # abstract base class """ if var is None: if isinstance(self.coordinate_ring(), sage.rings.abc.CallableSymbolicExpressionRing): - from sage.calculus.all import jacobian + from sage.calculus.functions import jacobian return jacobian(self, self.coordinate_ring().arguments()) else: raise ValueError("No differentiation variable specified.") diff --git a/src/sage/modules/matrix_morphism.py b/src/sage/modules/matrix_morphism.py index 175d152f364..73106816a77 100644 --- a/src/sage/modules/matrix_morphism.py +++ b/src/sage/modules/matrix_morphism.py @@ -52,7 +52,8 @@ import sage.categories.morphism import sage.categories.homset from sage.categories.finite_dimensional_modules_with_basis import FiniteDimensionalModulesWithBasis -from sage.structure.all import Sequence, parent +from sage.structure.sequence import Sequence +from sage.structure.element import parent from sage.structure.richcmp import richcmp, op_NE, op_EQ diff --git a/src/sage/numerical/interactive_simplex_method.py b/src/sage/numerical/interactive_simplex_method.py index e394224a3c9..e1e0eb63fed 100644 --- a/src/sage/numerical/interactive_simplex_method.py +++ b/src/sage/numerical/interactive_simplex_method.py @@ -203,7 +203,7 @@ from sage.rings.rational_field import QQ from sage.rings.real_double import RDF from sage.rings.integer_ring import ZZ -from sage.structure.all import SageObject +from sage.structure.sage_object import SageObject # We produce rather complicated LaTeX code which needs some tweaks to be diff --git a/src/sage/plot/arc.py b/src/sage/plot/arc.py index 77f09c4a485..5f04e9c7caf 100644 --- a/src/sage/plot/arc.py +++ b/src/sage/plot/arc.py @@ -475,7 +475,7 @@ def arc(center, r1, r2=None, angle=0.0, sector=(0.0, 2 * pi), **options): ... NotImplementedError """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics # Reset aspect_ratio to 'automatic' in case scale is 'semilog[xy]'. # Otherwise matplotlib complains. diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py index 02442f90ba4..edeb67fc46b 100644 --- a/src/sage/plot/arrow.py +++ b/src/sage/plot/arrow.py @@ -650,7 +650,7 @@ def arrow2d(tailpoint=None, headpoint=None, path=None, **options): sage: A = arrow2d((-1,-1), (2,3), legend_label='test') """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() g._set_extra_kwds(Graphics._extract_kwds_for_show(options)) diff --git a/src/sage/plot/bezier_path.py b/src/sage/plot/bezier_path.py index 1b81c6fe6d5..94d5cedda33 100644 --- a/src/sage/plot/bezier_path.py +++ b/src/sage/plot/bezier_path.py @@ -391,7 +391,7 @@ def bezier_path(path, **options): sage: bp [[(1, 1), (2, 3), (3, 3)], [(4, 4), (5, 5)]] """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() g._set_extra_kwds(g._extract_kwds_for_show(options)) g.add_primitive(BezierPath(path, options)) diff --git a/src/sage/plot/circle.py b/src/sage/plot/circle.py index f9c864d602a..458a5fd99f6 100644 --- a/src/sage/plot/circle.py +++ b/src/sage/plot/circle.py @@ -410,7 +410,7 @@ def circle(center, radius, **options): sage: C = circle((1,1), 1, legend_label='test') """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics # Reset aspect_ratio to 'automatic' in case scale is 'semilog[xy]'. # Otherwise matplotlib complains. diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx index 0552a51ff19..fafd2a2170a 100644 --- a/src/sage/plot/complex_plot.pyx +++ b/src/sage/plot/complex_plot.pyx @@ -1173,7 +1173,7 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None, """ import matplotlib as mpl import numpy as np - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid from sage.ext.fast_callable import fast_callable from sage.rings.complex_double import CDF diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py index a59397e8b23..25a157e2918 100644 --- a/src/sage/plot/contour_plot.py +++ b/src/sage/plot/contour_plot.py @@ -881,7 +881,7 @@ def f(x, y): return cos(x) + sin(y) sage: contour_plot(log(x) + log(y), (-1, 5), (-1, 5)) Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid region = options.pop('region') @@ -1650,7 +1650,7 @@ def region_plot(f, xrange, yrange, **options): sage: region_plot([x^2 + y^2 == 1, x < y], (x,-1,1), (y,-1,1)) Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid from sage.structure.element import Expression from warnings import warn @@ -1780,7 +1780,7 @@ def equify(f): sage: f(2, 1) -1 """ - from sage.calculus.all import symbolic_expression + from sage.calculus.expr import symbolic_expression from sage.structure.element import Expression if not isinstance(f, Expression): return lambda x, y: -1 if f(x, y) else 1 diff --git a/src/sage/plot/density_plot.py b/src/sage/plot/density_plot.py index dbbeb767775..4557c7d7d50 100644 --- a/src/sage/plot/density_plot.py +++ b/src/sage/plot/density_plot.py @@ -301,7 +301,7 @@ def f(x, y): return x**2 * cos(x*y) sage: density_plot(f, (0,1), (0,1)) Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid from sage.rings.real_double import RDF g, ranges = setup_for_eval_on_grid([f], [xrange, yrange], options['plot_points']) diff --git a/src/sage/plot/disk.py b/src/sage/plot/disk.py index 862ba12afc9..9552441b8e1 100644 --- a/src/sage/plot/disk.py +++ b/src/sage/plot/disk.py @@ -348,7 +348,7 @@ def disk(point, radius, angle, **options): sage: D = disk((0, 0), 5, (0, pi/2), legend_label='test') """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() # Reset aspect_ratio to 'automatic' in case scale is 'semilog[xy]'. diff --git a/src/sage/plot/ellipse.py b/src/sage/plot/ellipse.py index 8722d6fdb83..8cf7822b52d 100644 --- a/src/sage/plot/ellipse.py +++ b/src/sage/plot/ellipse.py @@ -352,7 +352,7 @@ def ellipse(center, r1, r2, angle=0, **options): sage: E = ellipse((0,0), 2, 1, legend_label='test') """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() # Reset aspect_ratio to 'automatic' in case scale is 'semilog[xy]'. diff --git a/src/sage/plot/hyperbolic_polygon.py b/src/sage/plot/hyperbolic_polygon.py index f74c35fef6f..ba1ea872d4a 100644 --- a/src/sage/plot/hyperbolic_polygon.py +++ b/src/sage/plot/hyperbolic_polygon.py @@ -287,7 +287,7 @@ def hyperbolic_polygon(pts, model='UHP', resolution=200, **options): P = hyperbolic_polygon(pts, model='HM', color='yellow', fill=True) sphinx_plot(P) """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() g._set_extra_kwds(g._extract_kwds_for_show(options)) diff --git a/src/sage/plot/line.py b/src/sage/plot/line.py index 241b2b4c1f1..fb765514ffe 100644 --- a/src/sage/plot/line.py +++ b/src/sage/plot/line.py @@ -610,7 +610,7 @@ def line2d(points, **options): sage: line(enumerate(range(2)), marker='o', legend_label='circle') Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.plot import xydata_from_point_list points = list(points) # make sure points is a python list if not points: diff --git a/src/sage/plot/matrix_plot.py b/src/sage/plot/matrix_plot.py index aa8309b5bc0..f252bc9e5ce 100644 --- a/src/sage/plot/matrix_plot.py +++ b/src/sage/plot/matrix_plot.py @@ -568,7 +568,7 @@ def matrix_plot(mat, xrange=None, yrange=None, **options): import numpy as np import scipy.sparse as scipysparse - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.structure.element import Matrix from sage.rings.real_double import RDF orig_mat = mat diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index c8f5a0fca96..35ecefc2585 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -3106,7 +3106,7 @@ def list_plot(data, plotjoined=False, **kwargs): sage: d['ymin'] 100.0 """ - from sage.plot.all import point + from sage.plot.point import point try: if not data: return Graphics() diff --git a/src/sage/plot/plot_field.py b/src/sage/plot/plot_field.py index 4a884cf4662..c79a22e389c 100644 --- a/src/sage/plot/plot_field.py +++ b/src/sage/plot/plot_field.py @@ -256,7 +256,7 @@ def plot_vector_field(f_g, xrange, yrange, **options): sphinx_plot(g) """ f, g = f_g - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid z, ranges = setup_for_eval_on_grid([f, g], [xrange, yrange], options['plot_points']) diff --git a/src/sage/plot/point.py b/src/sage/plot/point.py index 7c2d6bb1ae3..333767d13cf 100644 --- a/src/sage/plot/point.py +++ b/src/sage/plot/point.py @@ -583,7 +583,7 @@ def point2d(points, **options): sage: P = point((0.5, 0.5), legend_label='test') """ from sage.plot.plot import xydata_from_point_list - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.structure.element import Expression # points could be a single number diff --git a/src/sage/plot/polygon.py b/src/sage/plot/polygon.py index 8f2fa424725..265dc741709 100644 --- a/src/sage/plot/polygon.py +++ b/src/sage/plot/polygon.py @@ -535,7 +535,7 @@ def polygon2d(points, **options): - David Joyner (2006-04-14): the long list of examples above. """ from sage.plot.plot import xydata_from_point_list - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics if options["thickness"] is None: # If the user did not specify thickness if options["fill"] and options["edgecolor"] is None: # If the user chose fill diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py index 3b07349cb9c..1b6a8eae48f 100644 --- a/src/sage/plot/scatter_plot.py +++ b/src/sage/plot/scatter_plot.py @@ -187,7 +187,7 @@ def scatter_plot(datalist, **options): sphinx_plot(S) """ import numpy - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics g = Graphics() g._set_extra_kwds(Graphics._extract_kwds_for_show(options)) data = numpy.array(datalist, dtype='float') diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py index 2801446433a..1fff01116b4 100644 --- a/src/sage/plot/streamline_plot.py +++ b/src/sage/plot/streamline_plot.py @@ -285,7 +285,7 @@ def streamline_plot(f_g, xrange, yrange, **options): f = 1 / sqrt(f_g**2 + 1) g = f_g * f - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics from sage.plot.misc import setup_for_eval_on_grid z, ranges = setup_for_eval_on_grid([f,g], [xrange,yrange], options['plot_points']) f, g = z diff --git a/src/sage/plot/text.py b/src/sage/plot/text.py index 32b0cc712c4..22bad82b1d2 100644 --- a/src/sage/plot/text.py +++ b/src/sage/plot/text.py @@ -422,7 +422,7 @@ def text(string, xy, **options): if isinstance(xy, (list, tuple)) and len(xy) == 3: raise ValueError("use text3d instead for text in 3d") raise - from sage.plot.all import Graphics + from sage.plot.graphics import Graphics options['rgbcolor'] = to_mpl_color(options['rgbcolor']) point = (float(x), float(y)) g = Graphics() diff --git a/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py b/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py index aa2478af088..025afd44857 100644 --- a/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py +++ b/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py @@ -892,7 +892,7 @@ def compute_definiteness_string_by_determinants(self): if not ((self.base_ring() == ZZ) or (self.base_ring() == QQ) or (self.base_ring() == RR)): raise NotImplementedError("we can only check definiteness over ZZ, QQ, and RR for now") - from sage.functions.all import sgn + from sage.functions.generalized import sgn # Some useful variables n = self.dim() diff --git a/src/sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py b/src/sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py index e1b7c897032..db0135e5c8f 100644 --- a/src/sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py +++ b/src/sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py @@ -185,7 +185,7 @@ def Watson_mass_at_2(self): sage: Q.Watson_mass_at_2() # WARNING: WE NEED TO CHECK THIS CAREFULLY! # needs sage.symbolic 384 """ - from sage.functions.all import sgn + from sage.functions.generalized import sgn # Make a 0-dim'l quadratic form (for initialization purposes) Null_Form = deepcopy(self) diff --git a/src/sage/repl/ipython_kernel/widgets_sagenb.py b/src/sage/repl/ipython_kernel/widgets_sagenb.py index aa146aa438a..1bc2cd248f4 100644 --- a/src/sage/repl/ipython_kernel/widgets_sagenb.py +++ b/src/sage/repl/ipython_kernel/widgets_sagenb.py @@ -39,7 +39,7 @@ from collections.abc import Iterable, Sequence from numbers import Integral, Rational, Real -from sage.structure.all import parent +from sage.structure.element import parent from sage.arith.srange import srange import sage.rings.abc diff --git a/src/sage/rings/finite_rings/finite_field_constructor.py b/src/sage/rings/finite_rings/finite_field_constructor.py index bd29fdb1a95..52ac901d637 100644 --- a/src/sage/rings/finite_rings/finite_field_constructor.py +++ b/src/sage/rings/finite_rings/finite_field_constructor.py @@ -581,7 +581,8 @@ def create_key_and_extra_args(self, order, name=None, modulus=None, names=None, if not (val is None or isinstance(val, list) and all(c is None for c in val)): raise NotImplementedError("ring extension with prescribed %s is not implemented" % key) - from sage.structure.proof.all import WithProof, arithmetic + from sage.structure.proof.proof import WithProof + from sage.structure.proof.all import arithmetic if proof is None: proof = arithmetic() with WithProof('arithmetic', proof): @@ -753,7 +754,7 @@ def create_object(self, version, key, **kwds): else: order, name, modulus, impl, p, n, proof, prefix, repr, elem_cache, check_prime, check_irreducible = key - from sage.structure.proof.all import WithProof + from sage.structure.proof.proof import WithProof with WithProof('arithmetic', proof): if check_prime and not p.is_prime(): raise ValueError("the order of a finite field must be a prime power") diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx index c9d1ff65bc6..f3d77dd3e98 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -2911,7 +2911,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement): sage: y.exp(prec=53) # default RealField precision # needs sage.symbolic +infinity """ - from sage.functions.all import exp + from sage.functions.log import exp res = exp(self, dont_call_method_on_arg=True) if prec: return res.n(prec=prec) diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index dbd8e7e2edf..1380bcc3c48 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -208,9 +208,26 @@ def proof_flag(t): import sage.rings.complex_interval_field from sage.structure.factory import UniqueFactory -from . import number_field_element -from . import number_field_element_quadratic -from .number_field_ideal import NumberFieldIdeal, NumberFieldFractionalIdeal +from sage.rings.number_field.number_field_element import ( + NumberFieldElement_absolute, + OrderElement_relative, + OrderElement_absolute, + NumberFieldElement, +) +from sage.rings.number_field.number_field_element_quadratic import ( + NumberFieldElement_quadratic, + NumberFieldElement_quadratic_sqrt, + is_sqrt_disc, + Q_to_quadratic_field_element, + Z_to_quadratic_field_element, + NumberFieldElement_quadratic, + NumberFieldElement_gaussian, + OrderElement_quadratic, +) +from sage.rings.number_field.number_field_ideal import ( + NumberFieldIdeal, + NumberFieldFractionalIdeal, +) from sage.libs.pari.all import pari, pari_gen from sage.rings.rational_field import QQ @@ -1712,13 +1729,13 @@ def _element_constructor_(self, x, check=True): sage: K([1]).parent() Number Field in a with defining polynomial x """ - if isinstance(x, number_field_element.NumberFieldElement): + if isinstance(x, NumberFieldElement): K = x.parent() if K is self: return x - elif isinstance(x, (number_field_element.OrderElement_absolute, - number_field_element.OrderElement_relative, - number_field_element_quadratic.OrderElement_quadratic)): + elif isinstance(x, (OrderElement_absolute, + OrderElement_relative, + OrderElement_quadratic)): L = K.number_field() if L is self: return self._element_class(self, x) @@ -6769,10 +6786,13 @@ def polynomial_ntl(self): try: return (self.__polynomial_ntl, self.__denominator_ntl) except AttributeError: - self.__denominator_ntl = ntl.ZZ() + from sage.libs.ntl.ntl_ZZ import ntl_ZZ + from sage.libs.ntl.ntl_ZZX import ntl_ZZX + + self.__denominator_ntl = ntl_ZZ() den = self.polynomial().denominator() self.__denominator_ntl.set_from_sage_int(ZZ(den)) - self.__polynomial_ntl = ntl.ZZX((self.polynomial()*den).list()) + self.__polynomial_ntl = ntl_ZZX((self.polynomial() * den).list()) return (self.__polynomial_ntl, self.__denominator_ntl) def polynomial(self): @@ -8075,7 +8095,7 @@ def __init__(self, polynomial, name, latex_name=None, check=True, embedding=None """ NumberField_generic.__init__(self, polynomial, name, latex_name, check, embedding, assume_disc_small=assume_disc_small, maximize_at_primes=maximize_at_primes, structure=structure) - self._element_class = number_field_element.NumberFieldElement_absolute + self._element_class = NumberFieldElement_absolute self._zero_element = self._element_class(self, 0) self._one_element = self._element_class(self, 1) @@ -10853,12 +10873,12 @@ def __init__(self, n, names, embedding=None, assume_disc_small=False, maximize_a self._cache_an_element = None if n == 4: - self._element_class = number_field_element_quadratic.NumberFieldElement_gaussian + self._element_class = NumberFieldElement_gaussian self._D = ZZ(-1) self._NumberField_generic__gen = self._element_class(self, (QQ(0), QQ.one())) else: # n is 3 or 6 - self._element_class = number_field_element_quadratic.NumberFieldElement_quadratic + self._element_class = NumberFieldElement_quadratic self._D = ZZ(-3) one_half = QQ((1, 2)) if n == 3: @@ -11211,9 +11231,9 @@ def _coerce_map_from_(self, K): elif self.degree() == 2: if K is ZZ: - return number_field_element_quadratic.Z_to_quadratic_field_element(self) + return Z_to_quadratic_field_element(self) if K is QQ: - return number_field_element_quadratic.Q_to_quadratic_field_element(self) + return Q_to_quadratic_field_element(self) return NumberField_absolute._coerce_map_from_(self, K) @@ -11357,7 +11377,7 @@ def _element_constructor_(self, x, check=True): sage: K(O.1^2 + O.1 - 2) z^2 + z - 2 """ - if isinstance(x, number_field_element.NumberFieldElement): + if isinstance(x, NumberFieldElement): if isinstance(x.parent(), NumberField_cyclotomic): return self._coerce_from_other_cyclotomic_field(x) else: @@ -12074,19 +12094,19 @@ def __init__(self, polynomial, name=None, latex_name=None, check=True, embedding parts = -b/(2*a), (Dpoly/D).sqrt()/(2*a) if a.is_one() and b.is_zero() and c.is_one(): - self._element_class = number_field_element_quadratic.NumberFieldElement_gaussian + self._element_class = NumberFieldElement_gaussian else: - if number_field_element_quadratic.is_sqrt_disc(parts[0], parts[1]): - self._element_class = number_field_element_quadratic.NumberFieldElement_quadratic_sqrt + if is_sqrt_disc(parts[0], parts[1]): + self._element_class = NumberFieldElement_quadratic_sqrt else: - self._element_class = number_field_element_quadratic.NumberFieldElement_quadratic + self._element_class = NumberFieldElement_quadratic self._NumberField_generic__gen = self._element_class(self, parts) # we must set the flag _standard_embedding *before* any element creation # Note that in the following code, no element is built. if self.coerce_embedding() is not None and CDF.has_coerce_map_from(self): - rootD = CDF(number_field_element_quadratic.NumberFieldElement_quadratic(self, (QQ(0), QQ(1)))) + rootD = CDF(NumberFieldElement_quadratic(self, (QQ(0), QQ(1)))) if D > 0: self._standard_embedding = rootD.real() > 0 else: @@ -12127,11 +12147,11 @@ def _coerce_map_from_(self, K): True """ if K is ZZ: - return number_field_element_quadratic.Z_to_quadratic_field_element(self) + return Z_to_quadratic_field_element(self) if K is int: return self._coerce_map_via([ZZ], int) # faster than direct if K is QQ: - return number_field_element_quadratic.Q_to_quadratic_field_element(self) + return Q_to_quadratic_field_element(self) return NumberField_absolute._coerce_map_from_(self, K) def _latex_(self): diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx index 27432813b2b..3e19a145f6e 100644 --- a/src/sage/rings/number_field/number_field_element.pyx +++ b/src/sage/rings/number_field/number_field_element.pyx @@ -1990,7 +1990,7 @@ cdef class NumberFieldElement(NumberFieldElement_base): # Compute the product of the p^e to figure out the unit from sage.misc.misc_c import prod element_product = prod([p**e for p,e in element_fac], K.one()) - from sage.structure.all import Factorization + from sage.structure.factorization import Factorization return Factorization(element_fac, unit=self/element_product) def is_prime(self): diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py index 7ea070b113e..3f7ee0ac980 100644 --- a/src/sage/rings/number_field/number_field_rel.py +++ b/src/sage/rings/number_field/number_field_rel.py @@ -74,7 +74,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -import sage.libs.ntl.all as ntl +from sage.libs.ntl.ntl_ZZ import ntl_ZZ +from sage.libs.ntl.ntl_ZZX import ntl_ZZX from sage.categories.map import Map from sage.structure.sequence import Sequence @@ -1890,10 +1891,10 @@ def absolute_polynomial_ntl(self): try: return (self.__abs_polynomial_ntl, self.__abs_denominator_ntl) except AttributeError: - self.__abs_denominator_ntl = ntl.ZZ() + self.__abs_denominator_ntl = ntl_ZZ() den = self.absolute_polynomial().denominator() self.__abs_denominator_ntl.set_from_sage_int(ZZ(den)) - self.__abs_polynomial_ntl = ntl.ZZX((self.absolute_polynomial()*den).list()) + self.__abs_polynomial_ntl = ntl_ZZX((self.absolute_polynomial()*den).list()) return (self.__abs_polynomial_ntl, self.__abs_denominator_ntl) @cached_method diff --git a/src/sage/rings/padics/padic_base_generic.py b/src/sage/rings/padics/padic_base_generic.py index 8001d366b23..d2e8349bab7 100644 --- a/src/sage/rings/padics/padic_base_generic.py +++ b/src/sage/rings/padics/padic_base_generic.py @@ -443,7 +443,7 @@ def plot(self, max_points=2500, **args): args['pointsize'] = 1 from sage.misc.mrange import cartesian_product_iterator from sage.rings.real_double import RDF - from sage.plot.all import points + from sage.plot.point import point as points p = self.prime() phi = 2*RDF.pi()/p V = RDF**2 diff --git a/src/sage/rings/polynomial/convolution.py b/src/sage/rings/polynomial/convolution.py index 0f7cc5fadfa..89dfc55b53d 100644 --- a/src/sage/rings/polynomial/convolution.py +++ b/src/sage/rings/polynomial/convolution.py @@ -47,7 +47,7 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.structure.all import parent +from sage.structure.element import parent from math import log, ceil # ------------------------------------------------------------------- diff --git a/src/sage/rings/polynomial/infinite_polynomial_ring.py b/src/sage/rings/polynomial/infinite_polynomial_ring.py index 05735a21cd2..1c5481da4be 100644 --- a/src/sage/rings/polynomial/infinite_polynomial_ring.py +++ b/src/sage/rings/polynomial/infinite_polynomial_ring.py @@ -263,7 +263,8 @@ from sage.rings.ring import CommutativeRing from sage.categories.rings import Rings -from sage.structure.all import SageObject, parent +from sage.structure.sage_object import SageObject +from sage.structure.element import parent from sage.structure.factory import UniqueFactory from sage.misc.cachefunc import cached_method diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index adf1dc5db01..21eeb58c44e 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -5258,7 +5258,7 @@ def plot(self, *args, **kwds): sage: I.plot() # blow up # needs sage.plot Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import implicit_plot + from sage.plot.contour_plot import implicit_plot from sage.rings.real_mpfr import RR K = self.base_ring() diff --git a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py index 668f66fe574..f115bfa06e8 100644 --- a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py +++ b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py @@ -25,8 +25,6 @@ from sage.misc.lazy_import import lazy_import from sage.rings.infinity import infinity -lazy_import('sage.libs.ntl.all', 'ZZX') - min = misc.min ZZ = sage.rings.integer_ring.ZZ PrecisionError = precision_error.PrecisionError @@ -79,6 +77,8 @@ def __init__(self, parent, x=None, check=True, is_gen=False, construct=False, ab self._list = None return + from sage.libs.ntl.ntl_ZZX import ntl_ZZX as ZZX + # First we list the types that are turned into Polynomials if isinstance(x, ZZX): x = Polynomial_integer_dense(PolynomialRing(ZZ, parent.variable_name()), x, construct=True) diff --git a/src/sage/schemes/curves/constructor.py b/src/sage/schemes/curves/constructor.py index beff4dd649d..2c407a4e7be 100644 --- a/src/sage/schemes/curves/constructor.py +++ b/src/sage/schemes/curves/constructor.py @@ -43,7 +43,7 @@ from sage.rings.finite_rings.finite_field_base import FiniteField from sage.rings.rational_field import QQ -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from sage.schemes.generic.ambient_space import AmbientSpace from sage.schemes.generic.algebraic_scheme import AlgebraicScheme diff --git a/src/sage/schemes/elliptic_curves/cm.py b/src/sage/schemes/elliptic_curves/cm.py index e02a117ee3c..49816010417 100644 --- a/src/sage/schemes/elliptic_curves/cm.py +++ b/src/sage/schemes/elliptic_curves/cm.py @@ -130,7 +130,7 @@ def hilbert_class_polynomial(D, algorithm=None): from sage.quadratic_forms.binary_qf import BinaryQF_reduced_representatives from sage.rings.real_mpfr import RR from sage.rings.complex_mpfr import ComplexField - from sage.functions.all import elliptic_j + from sage.functions.special import elliptic_j # get all primitive reduced quadratic forms, (necessary to exclude # imprimitive forms when D is not a fundamental discriminant): diff --git a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx index 16bad60ba56..bcfb103d98c 100644 --- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx +++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx @@ -20,7 +20,7 @@ from sage.rings.polynomial.polynomial_ring import polygen cdef object x_ZZ = polygen(ZZ) from sage.rings.polynomial.real_roots import real_roots from sage.arith.misc import prime_divisors -import sage.libs.ntl.all as ntl +from sage.libs.ntl.ntl_ZZ_pX import ntl_ZZ_pX as ZZ_pX from sage.rings.integer cimport Integer from sage.libs.gmp.mpz cimport * @@ -579,8 +579,8 @@ cdef bint Zp_soluble_siksek_large_p(mpz_t a, mpz_t b, mpz_t c, mpz_t d, mpz_t e, mpz_set(D.value, d) mpz_set(E.value, e) mpz_set(P.value, pp) - f = ntl.ZZ_pX([E, D, C, B, A], P) - f /= ntl.ZZ_pX([A], P) # now f is monic, and we are done with A,B,C,D,E + f = ZZ_pX([E, D, C, B, A], P) + f /= ZZ_pX([A], P) # now f is monic, and we are done with A,B,C,D,E mpz_set(qq, A.value) # qq is the leading coefficient of the polynomial f_factzn = f.factor() result = 0 @@ -593,7 +593,7 @@ cdef bint Zp_soluble_siksek_large_p(mpz_t a, mpz_t b, mpz_t c, mpz_t d, mpz_t e, if result: return 1 - f = ntl.ZZ_pX([1], P) + f = ZZ_pX([1], P) for factor, exponent in f_factzn: for j in range(exponent // 2): f *= factor @@ -732,8 +732,8 @@ cdef bint Zp_soluble_siksek_large_p(mpz_t a, mpz_t b, mpz_t c, mpz_t d, mpz_t e, mpz_set(D.value, d) mpz_set(E.value, e) mpz_set(P.value, pp) - f = ntl.ZZ_pX([E, D, C, B, A], P) - f /= ntl.ZZ_pX([A], P) # now f is monic + f = ZZ_pX([E, D, C, B, A], P) + f /= ZZ_pX([A], P) # now f is monic f_factzn = f.factor() has_roots = 0 diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index f0a7087d7ea..8597fc78cbb 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -2985,7 +2985,7 @@ def plot(self, **kwds): sage: heegner_point(389,-7,1).plot(pointsize=50) Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import point + from sage.plot.point import point return point(CDF(self.tau()), **kwds) @@ -4279,7 +4279,8 @@ def plot(self, prec=53, *args, **kwds): E = self.curve() if E.root_number() == -1: P = self.numerical_approx(prec=prec) - from sage.plot.all import point, Graphics + from sage.plot.point import point + from sage.plot.graphics import Graphics if not P: # point at infinity return Graphics() diff --git a/src/sage/schemes/elliptic_curves/lseries_ell.py b/src/sage/schemes/elliptic_curves/lseries_ell.py index 74f5233c0e1..eca9bb5498a 100644 --- a/src/sage/schemes/elliptic_curves/lseries_ell.py +++ b/src/sage/schemes/elliptic_curves/lseries_ell.py @@ -172,7 +172,7 @@ def dokchitser(self, prec=53, return L if algorithm == 'gp': - from sage.lfunctions.all import Dokchitser + from sage.lfunctions.dokchitser import Dokchitser key = (prec, max_imaginary_part, max_asymp_coeffs) try: return self.__dokchitser[key] diff --git a/src/sage/schemes/generic/algebraic_scheme.py b/src/sage/schemes/generic/algebraic_scheme.py index a0257a065fd..ba390ead917 100644 --- a/src/sage/schemes/generic/algebraic_scheme.py +++ b/src/sage/schemes/generic/algebraic_scheme.py @@ -124,7 +124,7 @@ from sage.misc.latex import latex from sage.misc.misc import is_iterator -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from sage.structure.richcmp import richcmp, richcmp_method from sage.arith.functions import lcm diff --git a/src/sage/schemes/plane_conics/constructor.py b/src/sage/schemes/plane_conics/constructor.py index 49e3f77e28e..02743147aa5 100644 --- a/src/sage/schemes/plane_conics/constructor.py +++ b/src/sage/schemes/plane_conics/constructor.py @@ -38,7 +38,7 @@ from sage.schemes.affine.affine_point import SchemeMorphism_point_affine from sage.schemes.projective.projective_point import SchemeMorphism_point_projective_field from sage.schemes.projective.projective_space import ProjectiveSpace -from sage.structure.all import Sequence +from sage.structure.sequence import Sequence from sage.structure.element import Matrix from .con_field import ProjectiveConic_field diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py index a2e80dd7fa6..0513edd70c3 100644 --- a/src/sage/schemes/toric/sheaf/klyachko.py +++ b/src/sage/schemes/toric/sheaf/klyachko.py @@ -46,7 +46,7 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.structure.all import SageObject +from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal from sage.rings.integer_ring import ZZ from sage.misc.cachefunc import cached_method diff --git a/src/sage/stats/hmm/distributions.pyx b/src/sage/stats/hmm/distributions.pyx index ed79d289ed6..467cc481b37 100644 --- a/src/sage/stats/hmm/distributions.pyx +++ b/src/sage/stats/hmm/distributions.pyx @@ -130,7 +130,7 @@ cdef class Distribution: sage: P.plot(-10,30) # needs sage.plot Graphics object consisting of 1 graphics primitive """ - from sage.plot.all import plot + from sage.plot.plot import plot return plot(self.prob, *args, **kwds) cdef class GaussianMixtureDistribution(Distribution): diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx index edcc8e39ea1..0aa2101a427 100644 --- a/src/sage/stats/time_series.pyx +++ b/src/sage/stats/time_series.pyx @@ -1041,7 +1041,8 @@ cdef class TimeSeries: sage: v.plot() + v.plot(points=True, rgbcolor='red', pointsize=50) Graphics object consisting of 2 graphics primitives """ - from sage.plot.all import line, point + from sage.plot.line import line + from sage.plot.point import point cdef Py_ssize_t s if self._length < plot_points: @@ -1910,7 +1911,7 @@ cdef class TimeSeries: sage: v.plot_histogram(bins=3,normalize=False,aspect_ratio=1) # needs sage.plot Graphics object consisting of 3 graphics primitives """ - from sage.plot.all import polygon + from sage.plot.polygon import polygon counts, intervals = self.histogram(bins, normalize=normalize) s = 0 kwds.setdefault('aspect_ratio','automatic') @@ -1947,7 +1948,9 @@ cdef class TimeSeries: sage: v.plot_candlestick(bins=20) # needs sage.plot Graphics object consisting of 40 graphics primitives """ - from sage.plot.all import line, polygon, Graphics + from sage.plot.line import line + from sage.plot.polygon import polygon + from sage.plot.graphics import Graphics cdef TimeSeries t = new_time_series(self._length) cdef TimeSeries s diff --git a/src/sage/structure/parent_gens.pyx b/src/sage/structure/parent_gens.pyx index b27002d1254..3a69fa07be6 100644 --- a/src/sage/structure/parent_gens.pyx +++ b/src/sage/structure/parent_gens.pyx @@ -303,7 +303,7 @@ cdef class ParentWithGens(ParentWithBase): if isinstance(im_gens, parent.Parent): return self.Hom(im_gens).natural_map() if codomain is None: - from sage.structure.all import Sequence + from sage.structure.sequence import Sequence im_gens = Sequence(im_gens) codomain = im_gens.universe() kwds = {} diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx index da4d5db908f..cde5062f202 100644 --- a/src/sage/symbolic/expression.pyx +++ b/src/sage/symbolic/expression.pyx @@ -1521,7 +1521,8 @@ cdef class Expression(Expression_abc): ... ValueError: cannot convert sqrt(-3) to int """ - from sage.functions.all import floor, ceil + from sage.functions.other import floor + from sage.functions.other import ceil from sage.rings.real_mpfi import RIF try: rif_self = RIF(self) @@ -6704,7 +6705,8 @@ cdef class Expression(Expression_abc): return self.pyobject().round() except (TypeError, AttributeError): pass - from sage.functions.all import floor, ceil + from sage.functions.other import floor + from sage.functions.other import ceil from sage.rings.real_mpfi import RIF try: rif_self = RIF(self) diff --git a/src/sage/symbolic/expression_conversion_algebraic.py b/src/sage/symbolic/expression_conversion_algebraic.py index 9772fb8d94a..1e047510299 100644 --- a/src/sage/symbolic/expression_conversion_algebraic.py +++ b/src/sage/symbolic/expression_conversion_algebraic.py @@ -22,7 +22,7 @@ import sage.rings.abc -from sage.functions.all import exp +from sage.functions.log import exp from sage.symbolic.expression_conversions import Converter from sage.symbolic.operators import add_vararg, mul_vararg from sage.symbolic.ring import SR diff --git a/src/sage/symbolic/expression_conversions.py b/src/sage/symbolic/expression_conversions.py index 2d59c66293c..c5b687a18ef 100644 --- a/src/sage/symbolic/expression_conversions.py +++ b/src/sage/symbolic/expression_conversions.py @@ -23,7 +23,7 @@ from sage.misc.lazy_import import lazy_import from sage.symbolic.ring import SR from sage.structure.element import Expression -from sage.functions.all import exp +from sage.functions.log import exp from sage.symbolic.operators import arithmetic_operators, relation_operators, FDerivativeOperator, add_vararg, mul_vararg from sage.rings.number_field.number_field_element_base import NumberFieldElement_base from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField