diff --git a/src/.relint.yml b/src/.relint.yml index 7996583cb4f..d0eafb0d8fc 100644 --- a/src/.relint.yml +++ b/src/.relint.yml @@ -49,7 +49,7 @@ namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import, or use 'sage --fiximports' to fix automatically in the source file. # Keep in sync with SAGE_ROOT/src/sage/misc/replace_dot_all.py - pattern: 'from\s+sage(|[.](arith|categories|combinat|crypto|databases|data_structures|dynamics|ext|game_theory|games|graphs|groups|interfaces|manifolds|matrix|matroids|misc|modules|monoids|numerical|probability|quadratic_forms|quivers|rings|sat|schemes|sets|stats|symbolic|tensor)[a-z0-9_.]*|[.]libs)[.]all\s+import' + pattern: 'from\s+sage(|[.](arith|categories|combinat|crypto|databases|data_structures|dynamics|ext|game_theory|games|geometry|graphs|groups|interfaces|manifolds|matrix|matroids|misc|modules|monoids|numerical|probability|quadratic_forms|quivers|rings|sat|schemes|sets|stats|symbolic|tensor)[a-z0-9_.]*|[.]libs)[.]all\s+import' # imports from .all are allowed in all.py; also allow in some modules that need sage.all filePattern: '(.*/|)(?!(all|benchmark|dev_tools|parsing|sage_eval))[^/.]*[.](py|pyx|pxi)$' diff --git a/src/sage/combinat/root_system/plot.py b/src/sage/combinat/root_system/plot.py index 354ae0ca741..56b127e2dac 100644 --- a/src/sage/combinat/root_system/plot.py +++ b/src/sage/combinat/root_system/plot.py @@ -916,7 +916,7 @@ def __init__(self, space, # Bounding box from sage.rings.real_mpfr import RR - from sage.geometry.polyhedron.all import Polyhedron + from sage.geometry.polyhedron.constructor import Polyhedron from itertools import product if bounding_box in RR: bounding_box = [[-bounding_box,bounding_box]] * self.dimension @@ -1383,7 +1383,7 @@ def cone(self, rays=[], lines=[], color="black", thickness=1, alpha=1, wireframe """ if color is None: return self.empty() - from sage.geometry.polyhedron.all import Polyhedron + from sage.geometry.polyhedron.constructor import Polyhedron # TODO: we currently convert lines into rays, which simplify a # bit the calculation of the intersection. But it would be # nice to benefit from the new ``lines`` option of Polyhedra diff --git a/src/sage/combinat/root_system/root_lattice_realizations.py b/src/sage/combinat/root_system/root_lattice_realizations.py index 84a7b847f43..c380c53b1db 100644 --- a/src/sage/combinat/root_system/root_lattice_realizations.py +++ b/src/sage/combinat/root_system/root_lattice_realizations.py @@ -2539,7 +2539,7 @@ def plot_hedron(self, **options): Line defined by 2 points: [(1.5, -0.5), (1.5, 0.5)] Point set defined by 8 point(s): [(-1.5, -0.5), (-1.5, 0.5), (-0.5, -1.5), (-0.5, 1.5), (0.5, -1.5), (0.5, 1.5), (1.5, -0.5), (1.5, 0.5)] """ - from sage.geometry.polyhedron.all import Polyhedron + from sage.geometry.polyhedron.constructor import Polyhedron plot_options = self.plot_parse_options(**options) if not self.cartan_type().is_finite(): raise ValueError("the Cartan type must be finite") @@ -3061,7 +3061,7 @@ def plot_mv_polytope(self, mv_polytope, mark_endpoints=True, sage: L.plot_mv_polytope(p) Graphics3d Object """ - from sage.geometry.polyhedron.all import Polyhedron + from sage.geometry.polyhedron.constructor import Polyhedron plot_options = self.plot_parse_options(**options) # Setup the shift for plotting diff --git a/src/sage/misc/replace_dot_all.py b/src/sage/misc/replace_dot_all.py index 8b48118aef6..ebb9a83dfff 100644 --- a/src/sage/misc/replace_dot_all.py +++ b/src/sage/misc/replace_dot_all.py @@ -72,7 +72,7 @@ # Keep in sync with SAGE_ROOT/src/.relint.yml (namespace_pkg_all_import) default_package_regex = (r"sage(" - r"|[.](arith|categories|combinat|crypto|databases|data_structures|dynamics|ext|game_theory|games|graphs|groups|interfaces|manifolds|matrix|matroids|misc|modules|monoids|numerical|probability|quadratic_forms|quivers|rings|sat|schemes|sets|stats|tensor)[a-z0-9_.]*|[.]libs" + r"|[.](arith|categories|combinat|crypto|databases|data_structures|dynamics|ext|game_theory|games|geometry|graphs|groups|interfaces|manifolds|matrix|matroids|misc|modules|monoids|numerical|probability|quadratic_forms|quivers|rings|sat|schemes|sets|stats|tensor)[a-z0-9_.]*|[.]libs" r")[.]all") diff --git a/src/sage/numerical/interactive_simplex_method.py b/src/sage/numerical/interactive_simplex_method.py index 26e332cd8d9..8ff00fb95a5 100644 --- a/src/sage/numerical/interactive_simplex_method.py +++ b/src/sage/numerical/interactive_simplex_method.py @@ -64,7 +64,7 @@ Since it has only two variables, we can solve it graphically:: - sage: P.plot() + sage: P.plot() # optional - sage.plot Graphics object consisting of 19 graphics primitives @@ -182,7 +182,7 @@ from copy import copy from sage.misc.abstract_method import abstract_method -from sage.geometry.all import Polyhedron +from sage.geometry.polyhedron.constructor import Polyhedron from sage.matrix.special import column_matrix from sage.matrix.special import identity_matrix from sage.matrix.constructor import Matrix as matrix @@ -1534,19 +1534,19 @@ def plot(self, *args, **kwds): sage: b = (1000, 1500) sage: c = (10, 5) sage: P = InteractiveLPProblem(A, b, c, ["C", "B"], variable_type=">=") - sage: p = P.plot() - sage: p.show() + sage: p = P.plot() # optional - sage.plot + sage: p.show() # optional - sage.plot In this case the plot works better with the following axes ranges:: - sage: p = P.plot(0, 1000, 0, 1500) - sage: p.show() + sage: p = P.plot(0, 1000, 0, 1500) # optional - sage.plot + sage: p.show() # optional - sage.plot TESTS: We check that zero objective can be dealt with:: - sage: InteractiveLPProblem(A, b, (0, 0), ["C", "B"], variable_type=">=").plot() + sage: InteractiveLPProblem(A, b, (0, 0), ["C", "B"], variable_type=">=").plot() # optional - sage.plot Graphics object consisting of 8 graphics primitives """ FP = self.plot_feasible_set(*args, **kwds) @@ -1611,13 +1611,13 @@ def plot_feasible_set(self, xmin=None, xmax=None, ymin=None, ymax=None, sage: b = (1000, 1500) sage: c = (10, 5) sage: P = InteractiveLPProblem(A, b, c, ["C", "B"], variable_type=">=") - sage: p = P.plot_feasible_set() - sage: p.show() + sage: p = P.plot_feasible_set() # optional - sage.plot + sage: p.show() # optional - sage.plot In this case the plot works better with the following axes ranges:: - sage: p = P.plot_feasible_set(0, 1000, 0, 1500) - sage: p.show() + sage: p = P.plot_feasible_set(0, 1000, 0, 1500) # optional - sage.plot + sage: p.show() # optional - sage.plot """ if self.n() != 2: raise ValueError("only problems with 2 variables can be plotted") diff --git a/src/sage/schemes/toric/fano_variety.py b/src/sage/schemes/toric/fano_variety.py index c7d05455d97..e3433787106 100644 --- a/src/sage/schemes/toric/fano_variety.py +++ b/src/sage/schemes/toric/fano_variety.py @@ -119,7 +119,10 @@ import re -from sage.geometry.all import Cone, FaceFan, Fan, LatticePolytope +from sage.geometry.cone import Cone +from sage.geometry.fan import FaceFan +from sage.geometry.fan import Fan +from sage.geometry.lattice_polytope import LatticePolytope from sage.misc.latex import latex from sage.misc.misc_c import prod from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing diff --git a/src/sage/schemes/toric/library.py b/src/sage/schemes/toric/library.py index c12c8e2c75e..8e1a9dfb732 100644 --- a/src/sage/schemes/toric/library.py +++ b/src/sage/schemes/toric/library.py @@ -42,7 +42,9 @@ from sage.matrix.constructor import Matrix as matrix from sage.matrix.special import identity_matrix -from sage.geometry.all import Fan, LatticePolytope, ToricLattice +from sage.geometry.fan import Fan +from sage.geometry.lattice_polytope import LatticePolytope +from sage.geometry.toric_lattice import ToricLattice from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ from sage.arith.misc import GCD as gcd diff --git a/src/sage/schemes/toric/morphism.py b/src/sage/schemes/toric/morphism.py index 7a304865825..5b494b07be6 100644 --- a/src/sage/schemes/toric/morphism.py +++ b/src/sage/schemes/toric/morphism.py @@ -370,7 +370,8 @@ from sage.misc.cachefunc import cached_method from sage.matrix.constructor import matrix, identity_matrix from sage.modules.free_module_element import vector -from sage.geometry.all import Cone, Fan +from sage.geometry.cone import Cone +from sage.geometry.fan import Fan from sage.schemes.generic.scheme import is_Scheme from sage.schemes.generic.morphism import (