Skip to content

Commit c282b09

Browse files
author
Matthias Koeppe
committed
sage.knots, sage.groups.braid: Modularization fixes
1 parent 7f78eda commit c282b09

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/sage/groups/braid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
from sage.functions.generalized import sign
8181
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
8282
from sage.groups.perm_gps.permgroup_named import SymmetricGroupElement
83-
from sage.knots.knot import Knot
8483
from sage.libs.gap.libgap import libgap
8584
from sage.matrix.constructor import identity_matrix, matrix
8685
from sage.misc.lazy_attribute import lazy_attribute
@@ -99,6 +98,7 @@
9998
'leastcommonmultiple', 'conjugatingbraid', 'ultrasummitset',
10099
'thurston_type', 'rigidity', 'sliding_circuits'],
101100
feature=PythonModule('sage.libs.braiding', spkg='libbraiding', type='standard'))
101+
lazy_import('sage.knots.knot', 'Knot')
102102

103103

104104
class Braid(FiniteTypeArtinGroupElement):

src/sage/knots/knotinfo.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,26 @@
9797
<class 'sage.knots.link.Link'>
9898
9999
If you have `SnapPy <https://snappy.math.uic.edu/index.html>`__ installed inside
100-
Sage you can obtain an instance of :class:`~spherogram.links.links_base.Link`,
100+
Sage, you can obtain an instance of :class:`~spherogram.links.links_base.Link`,
101101
too::
102102
103+
sage: # optional - snappy
103104
sage: L6 = KnotInfo.L6a1_0
104-
sage: l6s = L6.link(snappy=True); l6s # optional - snappy
105+
sage: l6s = L6.link(snappy=True); l6s
105106
Plink failed to import tkinter.
106107
<Link: 2 comp; 6 cross>
107-
108-
sage: type(l6s) # optional - snappy
108+
sage: type(l6s)
109109
<class 'spherogram.links.invariants.Link'>
110110
sage: l6 = L6.link()
111-
sage: l6 == l6s.sage_link() # optional - snappy
111+
sage: l6 == l6s.sage_link()
112112
True
113-
sage: L6.link(L6.items.name, snappy=True) # optional - snappy
113+
sage: L6.link(L6.items.name, snappy=True)
114114
<Link L6a1: 2 comp; 6 cross>
115-
sage: l6sn = _ # optional - snappy
116-
sage: l6s == l6sn # optional - snappy
115+
sage: l6sn = _
116+
sage: l6s == l6sn
117117
False
118-
sage: l6m = l6.mirror_image() # optional - snappy
119-
sage: l6sn.sage_link().is_isotopic(l6m) # optional - snappy
118+
sage: l6m = l6.mirror_image()
119+
sage: l6sn.sage_link().is_isotopic(l6m)
120120
True
121121
122122
But observe that the name conversion to SnapPy does not distinguish orientation
@@ -238,14 +238,16 @@
238238

239239
from enum import Enum
240240
from sage.misc.cachefunc import cached_method
241+
from sage.misc.lazy_import import lazy_import
241242
from sage.misc.sage_eval import sage_eval
242243
from sage.structure.sage_object import SageObject
243244
from sage.structure.unique_representation import UniqueRepresentation
244245
from sage.rings.integer_ring import ZZ
245-
from sage.groups.braid import BraidGroup
246246
from sage.knots.knot import Knots
247247
from sage.databases.knotinfo_db import KnotInfoColumns, db
248248

249+
lazy_import('sage.groups.braid', 'BraidGroup')
250+
249251

250252
def eval_knotinfo(string, locals={}, to_tuple=True):
251253
r"""
@@ -694,8 +696,7 @@ def braid_length(self):
694696
@cached_method
695697
def braid(self):
696698
r"""
697-
Return the braid notation of self as an instance of :class:`~sage.groups.braid.Braid`.
698-
699+
Return the braid notation of ``self`` as an instance of :class:`~sage.groups.braid.Braid`.
699700
700701
EXAMPLES::
701702

0 commit comments

Comments
 (0)