Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/features/normaliz.py: Rename class to PyNormaliz, fix uses
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Nov 11, 2021
1 parent 0b65b79 commit 00cb9c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/sage/features/normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
from .join_feature import JoinFeature


class pynormaliz(JoinFeature):
class PyNormaliz(JoinFeature):
r"""
A :class:`sage.features.Feature` describing the presence of the
Python package ``PyNormaliz``.
EXAMPLES::
sage: from sage.features.normaliz import pynormaliz
sage: pynormaliz().is_present() # optional - pynormaliz
sage: from sage.features.normaliz import PyNormaliz
sage: PyNormaliz().is_present() # optional - pynormaliz
FeatureTestResult('pynormaliz', True)
"""
def __init__(self):
r"""
TESTS::
sage: from sage.features.normaliz import pynormaliz
sage: isinstance(pynormaliz(), pynormaliz)
sage: from sage.features.normaliz import PyNormaliz
sage: isinstance(PyNormaliz(), PyNormaliz)
True
"""
JoinFeature.__init__(self, 'pynormaliz',
Expand Down
4 changes: 2 additions & 2 deletions src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
from sage.structure.element import Element
from sage.misc.cachefunc import cached_method
from sage.misc.misc_c import prod
from sage.features.normaliz import pynormaliz
from sage.misc.lazy_import import lazy_import
import sage.features.normaliz
lazy_import('PyNormaliz', ['NmzResult', 'NmzCompute', 'NmzCone', 'NmzConeCopy'],
feature=pynormaliz)
feature=sage.features.normaliz.PyNormaliz())

from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
Expand Down
8 changes: 4 additions & 4 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8729,18 +8729,18 @@ def volume(self, measure='ambient', engine='auto', **kwds):
Latte().require()
engine = 'latte'
except FeatureNotPresentError:
from sage.features.normaliz import pynormaliz
from sage.features.normaliz import PyNormaliz
try:
pynormaliz.require()
PyNormaliz().require()
engine = 'normaliz'
except FeatureNotPresentError:
raise RuntimeError("the induced rational measure can only be computed with the optional packages `latte_int`, or `pynormaliz`")

if engine == 'auto' and measure == 'induced_lattice':
# Enforce a default choice, change if a better engine is found.
from sage.features.normaliz import pynormaliz
from sage.features.normaliz import PyNormaliz
try:
pynormaliz.require()
PyNormaliz().require()
engine = 'normaliz'
except FeatureNotPresentError:
try:
Expand Down

0 comments on commit 00cb9c7

Please sign in to comment.