Replace use of `sage.misc.package.PackageNotFoundError` (2); lazy_import: Add keyword argument 'feature'
mkoeppe opened this issue · 19 comments
This helps with the modularization of sagelib.
We demonstrate its use by simplifying:
sage.groups.braid(which depends on the optional librarylibbraidingviasage.libs.libbraiding). Actually a standard packagesage.sat.solvers.cryptominisat,.picosatsage.matrix.matrix_space(meataxe)sage.graphs.graph(tdlib,mcqd)
This simplification helps eliminate the use of sage.misc.package.PackageNotFoundError. See #30607.
CC: @kiwifb @jhpalmieri @slel @seblabbe @dcoudert
Component: refactoring
Author: Matthias Koeppe
Branch: e1f6624
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/30616
Commit: 30613c8
Description changed:
---
+++
@@ -1,5 +1,7 @@
This helps with the modularization of sagelib.
-We demonstrate its use by simplifying `sage.groups.braid` (which depends on the optional library `libbraiding` via `sage.libs.libbraiding`).
+We demonstrate its use by simplifying:
+- `sage.groups.braid` (which depends on the optional library `libbraiding` via `sage.libs.libbraiding`). Actually a standard package
+- `sage.sat.solvers.cryptominisat`, `.picosat`
+- `sage.matrix.matrix_space` (`meataxe`)
-Author: Matthias Koeppe
Description changed:
---
+++
@@ -4,4 +4,10 @@
- `sage.groups.braid` (which depends on the optional library `libbraiding` via `sage.libs.libbraiding`). Actually a standard package
- `sage.sat.solvers.cryptominisat`, `.picosat`
- `sage.matrix.matrix_space` (`meataxe`)
+- `sage.graphs.graph` (`tdlib`, `mcqd`)
+This simplification helps eliminate the use of `sage.misc.package.PackageNotFoundError`. See #30607.
+
+
+
+I tried before and after installing tdlib, mcqd, cryptominisat, pycosat (not obvious to know that its picosat), meataxe. Note that libbraiding was already installed (is it standard now ?). It's working well.
However, we have several pyflakes errors (see patchbot)
src/sage/graphs/graph.py:6419:20 undefined name 'mcqd'
src/sage/graphs/graph.py:6517:24 undefined name 'mcqd'
src/sage/groups/braid.py:82:1 'sage.misc.package.PackageNotFoundError' imported but unused
src/sage/groups/braid.py:1080:13 undefined name 'rightnormalform'
src/sage/groups/braid.py:1096:13 undefined name 'centralizer'
src/sage/groups/braid.py:1115:13 undefined name 'supersummitset'
src/sage/groups/braid.py:1138:13 undefined name 'greatestcommondivisor'
src/sage/groups/braid.py:1158:13 undefined name 'leastcommonmultiple'
src/sage/groups/braid.py:1183:13 undefined name 'conjugatingbraid'
src/sage/groups/braid.py:1208:13 undefined name 'conjugatingbraid'
src/sage/groups/braid.py:1236:15 undefined name 'ultrasummitset'
src/sage/groups/braid.py:1261:16 undefined name 'thurston_type'
src/sage/groups/braid.py:1326:24 undefined name 'rigidity'
src/sage/groups/braid.py:1358:15 undefined name 'sliding_circuits'
src/sage/matrix/matrix_space.py:287:24 undefined name 'Matrix_gfpn_dense'
src/sage/sat/solvers/cryptominisat.py:72:24 undefined name 'Solver'
src/sage/sat/solvers/picosat.py:63:23 undefined name 'solve'
Replying to @dcoudert:
Note that
libbraidingwas already installed (is it standard now ?).
Yes, see build/pkgs/libbraiding/type which you can either
check with this command:
$ cat build/pkgs/libbraiding/type
standard
or by viewing that file online:
This happened in
- #25705 Make libhomfly and libbraiding standard packages
which was merged in Sage 8.4.beta0.
Thanks.
Can we do something for the pyflakes issues or is it the prize to pay for lazy import ?
Unfortunately that's the prize to pay...
Reviewer: David Coudert
So then.
Thank you!
Changed branch from u/mkoeppe/lazy_import__add_keyword_argument__feature_ to e1f6624