sagemath/sage

sage.geometry.polyhedron: Split out backend_cdd_rdf from backend_cdd

Closed this issue · 25 comments

(cherry-picked from #32432)

CC: @kliem

Component: geometry

Author: Matthias Koeppe

Branch/Commit: 57919d4

Reviewer: Jonathan Kliem

Issue created by migration from https://trac.sagemath.org/ticket/32592

Commit: e251555

New commits:

e251555src/sage/geometry/polyhedron/backend_cdd_rdf.py: Split out from src/sage/geometry/polyhedron/backend_cdd.py

Author: Matthias Koeppe

kliem commented
comment:3

Do I get this right that RDF will not be a "dependency" of sagemath-polyhedra?

comment:4

The final design of the sagemath-polyhedra is not set in stone. But yes, for now I excluded RDF because of the compile time dependency on gsl and cypari2.

kliem commented
comment:5

I find it confusing that the import is at the end of the file backend_cdd.py.

comment:6

I've now changed it to a standard "lazy import with deprecation"

Changed commit from e251555 to 7f317f1

Branch pushed to git repo; I updated commit sha1. New commits:

5ec8fa8src/sage/geometry/polyhedron/backend_cdd.py: Make Polyhedron_RDF_cdd a deprecated lazy_import
7f317f1src/sage/geometry/polyhedron/parent.py: Use lazy_import for Polyhedron_RDF_cdd

Changed commit from 7f317f1 to 4ec3829

Branch pushed to git repo; I updated commit sha1. New commits:

4ec3829src/sage/geometry/polyhedron/backend_cdd_rdf.py: Update imports in doctests
kliem commented
comment:9

Docbuild fails

[dochtml] Build finished. The built documents can be found in /home/sagemath/sage-9.1/local/share/doc/sage/inventory/en/reference/tensor_free_modules
[dochtml] cd /home/sagemath/sage-9.1 && ./sage --docbuild --no-pdf-links reference/combinat inventory --no-prune-empty-dirs
[dochtml] Error building the documentation.
[dochtml] Traceback (most recent call last):
[dochtml]   File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
[dochtml]     "__main__", mod_spec)
[dochtml]   File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
[dochtml]     exec(code, run_globals)
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage_docbuild/__main__.py", line 2, in <module>
[dochtml]     main()
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage_docbuild/__init__.py", line 1814, in main
[dochtml]     builder()
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage_docbuild/__init__.py", line 810, in _wrapper
[dochtml]     self.write_auto_rest_file(module_name)
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage_docbuild/__init__.py", line 1105, in write_auto_rest_file
[dochtml]     title = self.get_module_docstring_title(module_name)
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage_docbuild/__init__.py", line 1066, in get_module_docstring_title
[dochtml]     __import__(module_name)
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage/combinat/root_system/associahedron.py", line 27, in <module>
[dochtml]     from sage.geometry.polyhedron.parent import Polyhedra, Polyhedra_base, Polyhedra_QQ_ppl, Polyhedra_QQ_normaliz, Polyhedra_QQ_cdd, Polyhedra_polymake, Polyhedra_field
[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage/geometry/polyhedron/parent.py", line 1131, in <module>
[dochtml]     lazy_import('sage.geometry.polyhedron.backend_cdd_rdf', Polyhedron_RDF_cdd)
[dochtml] NameError: name 'lazy_import' is not defined
[dochtml] 
[dochtml]     Note: incremental documentation builds sometimes cause spurious
[dochtml]     error messages. To be certain that these are real errors, run
[dochtml]     "make doc-clean" first and try again.

Branch pushed to git repo; I updated commit sha1. New commits:

1a845fasrc/sage/geometry/polyhedron/parent.py: Add missing import

Changed commit from 4ec3829 to 1a845fa

kliem commented
comment:11

Still fails:

[dochtml]   File "/home/sagemath/sage-9.1/local/lib/python3.7/site-packages/sage/geometry/polyhedron/parent.py", line 1132, in <module>
[dochtml]     lazy_import('sage.geometry.polyhedron.backend_cdd_rdf', Polyhedron_RDF_cdd)
[dochtml] NameError: name 'Polyhedron_RDF_cdd' is not defined

Branch pushed to git repo; I updated commit sha1. New commits:

27a265csrc/sage/geometry/polyhedron/parent.py: Fixup

Changed commit from 1a845fa to 27a265c

comment:13

Now there's a green checkmark

kliem commented

Reviewer: Jonathan Kliem

kliem commented
comment:14

LGTM.

comment:15

Thank you!

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

57919d4Merge tag '9.5.beta3' into t/32592/sage_geometry_polyhedron__split_out_backend_cdd_rdf_from_backend_cdd

Changed commit from 27a265c to 57919d4