Skip to content

Commit d7f8a5d

Browse files
author
Matthias Koeppe
committed
Replace imports from sage.geometry*all, update relint pattern
1 parent 443b754 commit d7f8a5d

File tree

7 files changed

+15
-9
lines changed

7 files changed

+15
-9
lines changed

src/.relint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import,
5050
or use 'sage --fiximports' to fix automatically in the source file.
5151
# Keep in sync with SAGE_ROOT/src/sage/misc/replace_dot_all.py
52-
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'
52+
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'
5353
# imports from .all are allowed in all.py; also allow in some modules that need sage.all
5454
filePattern: '(.*/|)(?!(all|benchmark|dev_tools|parsing|sage_eval))[^/.]*[.](py|pyx|pxi)$'
5555

src/sage/combinat/root_system/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ def __init__(self, space,
916916

917917
# Bounding box
918918
from sage.rings.real_mpfr import RR
919-
from sage.geometry.polyhedron.all import Polyhedron
919+
from sage.geometry.polyhedron.constructor import Polyhedron
920920
from itertools import product
921921
if bounding_box in RR:
922922
bounding_box = [[-bounding_box,bounding_box]] * self.dimension
@@ -1383,7 +1383,7 @@ def cone(self, rays=[], lines=[], color="black", thickness=1, alpha=1, wireframe
13831383
"""
13841384
if color is None:
13851385
return self.empty()
1386-
from sage.geometry.polyhedron.all import Polyhedron
1386+
from sage.geometry.polyhedron.constructor import Polyhedron
13871387
# TODO: we currently convert lines into rays, which simplify a
13881388
# bit the calculation of the intersection. But it would be
13891389
# nice to benefit from the new ``lines`` option of Polyhedra

src/sage/combinat/root_system/root_lattice_realizations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ def plot_hedron(self, **options):
25392539
Line defined by 2 points: [(1.5, -0.5), (1.5, 0.5)]
25402540
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)]
25412541
"""
2542-
from sage.geometry.polyhedron.all import Polyhedron
2542+
from sage.geometry.polyhedron.constructor import Polyhedron
25432543
plot_options = self.plot_parse_options(**options)
25442544
if not self.cartan_type().is_finite():
25452545
raise ValueError("the Cartan type must be finite")
@@ -3061,7 +3061,7 @@ def plot_mv_polytope(self, mv_polytope, mark_endpoints=True,
30613061
sage: L.plot_mv_polytope(p)
30623062
Graphics3d Object
30633063
"""
3064-
from sage.geometry.polyhedron.all import Polyhedron
3064+
from sage.geometry.polyhedron.constructor import Polyhedron
30653065
plot_options = self.plot_parse_options(**options)
30663066

30673067
# Setup the shift for plotting

src/sage/misc/replace_dot_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
# Keep in sync with SAGE_ROOT/src/.relint.yml (namespace_pkg_all_import)
7373

7474
default_package_regex = (r"sage("
75-
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"
75+
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"
7676
r")[.]all")
7777

7878

src/sage/schemes/toric/fano_variety.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@
119119

120120
import re
121121

122-
from sage.geometry.all import Cone, FaceFan, Fan, LatticePolytope
122+
from sage.geometry.cone import Cone
123+
from sage.geometry.fan import FaceFan
124+
from sage.geometry.fan import Fan
125+
from sage.geometry.lattice_polytope import LatticePolytope
123126
from sage.misc.latex import latex
124127
from sage.misc.misc_c import prod
125128
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing

src/sage/schemes/toric/library.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242

4343
from sage.matrix.constructor import Matrix as matrix
4444
from sage.matrix.special import identity_matrix
45-
from sage.geometry.all import Fan, LatticePolytope, ToricLattice
45+
from sage.geometry.fan import Fan
46+
from sage.geometry.lattice_polytope import LatticePolytope
47+
from sage.geometry.toric_lattice import ToricLattice
4648
from sage.rings.integer_ring import ZZ
4749
from sage.rings.rational_field import QQ
4850
from sage.arith.misc import GCD as gcd

src/sage/schemes/toric/morphism.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@
370370
from sage.misc.cachefunc import cached_method
371371
from sage.matrix.constructor import matrix, identity_matrix
372372
from sage.modules.free_module_element import vector
373-
from sage.geometry.all import Cone, Fan
373+
from sage.geometry.cone import Cone
374+
from sage.geometry.fan import Fan
374375

375376
from sage.schemes.generic.scheme import is_Scheme
376377
from sage.schemes.generic.morphism import (

0 commit comments

Comments
 (0)