-
-
Notifications
You must be signed in to change notification settings - Fork 649
Commit 159a6f9

Release Manager
gh-36089: `sage.geometry.polyhedron`: fix doctest error due to modularization
On MacOS with sagemath 10.1.rc0, I have the following doctest error in
`src/sage/geometry/polyhedron/base_ZZ.py`
```
sage -t --long --warn-long 18.5 --random-
seed=240228246560107174999702016603267109757
src/sage/geometry/polyhedron/base_ZZ.py
**********************************************************************
File "src/sage/geometry/polyhedron/base_ZZ.py", line 419, in
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?
Failed example:
hypercube(3).ehrhart_polynomial(engine='normaliz')
Exception raised:
Traceback (most recent call last):
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 709,
in _run
self.compile_and_execute(example, compiler, test.globs)
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 1144,
in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[9]>", line 1, in
<module>
hypercube(Integer(3)).ehrhart_polynomial(engine='normaliz')
^^^^^^^^^^^^^^^^^^^^^
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[8]>", line 2, in
hypercube
return Polyhedron(vertices=list(product([Integer(0),Integer(1)],
repeat=d)),backend='normaliz')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'sage.rings.integer.Integer' object is not iterable
**********************************************************************
File "src/sage/geometry/polyhedron/base_ZZ.py", line 421, in
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?
Failed example:
hypercube(4).ehrhart_polynomial(engine='normaliz')
Exception raised:
Traceback (most recent call last):
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 709,
in _run
self.compile_and_execute(example, compiler, test.globs)
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 1144,
in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[10]>", line 1, in
<module>
hypercube(Integer(4)).ehrhart_polynomial(engine='normaliz')
^^^^^^^^^^^^^^^^^^^^^
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[8]>", line 2, in
hypercube
return Polyhedron(vertices=list(product([Integer(0),Integer(1)],
repeat=d)),backend='normaliz')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'sage.rings.integer.Integer' object is not iterable
**********************************************************************
File "src/sage/geometry/polyhedron/base_ZZ.py", line 423, in
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?
Failed example:
hypercube(5).ehrhart_polynomial(engine='normaliz')
Exception raised:
Traceback (most recent call last):
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 709,
in _run
self.compile_and_execute(example, compiler, test.globs)
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 1144,
in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[11]>", line 1, in
<module>
hypercube(Integer(5)).ehrhart_polynomial(engine='normaliz')
^^^^^^^^^^^^^^^^^^^^^
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[8]>", line 2, in
hypercube
return Polyhedron(vertices=list(product([Integer(0),Integer(1)],
repeat=d)),backend='normaliz')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'sage.rings.integer.Integer' object is not iterable
**********************************************************************
File "src/sage/geometry/polyhedron/base_ZZ.py", line 425, in
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?
Failed example:
hypercube(6).ehrhart_polynomial(engine='normaliz')
Exception raised:
Traceback (most recent call last):
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 709,
in _run
self.compile_and_execute(example, compiler, test.globs)
File "/Users/dcoudert/sage/src/sage/doctest/forker.py", line 1144,
in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[12]>", line 1, in
<module>
hypercube(Integer(6)).ehrhart_polynomial(engine='normaliz')
^^^^^^^^^^^^^^^^^^^^^
File "<doctest
sage.geometry.polyhedron.base_ZZ.Polyhedron_ZZ.?[8]>", line 2, in
hypercube
return Polyhedron(vertices=list(product([Integer(0),Integer(1)],
repeat=d)),backend='normaliz')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'sage.rings.integer.Integer' object is not iterable
```
This is caused by the `from itertools import product` in a block
starting with `# optional - latte_int`. Apparently I don't have
`latte_int` installed, and so this import is not done when starting the
block with `pynormaliz` (I have it). So the fix is trivial.
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
### ⌛ Dependencies
<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
URL: #36089
Reported by: David Coudert
Reviewer(s): Matthias Köppe
File tree
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedFilter options
- src/sage/geometry/polyhedron
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedsrc/sage/geometry/polyhedron/base_ZZ.py
Copy file name to clipboardExpand all lines: src/sage/geometry/polyhedron/base_ZZ.py+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
414 | 414 |
| |
415 | 415 |
| |
416 | 416 |
| |
| 417 | + | |
417 | 418 |
| |
418 | 419 |
| |
419 | 420 |
| |
|
0 commit comments