aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-03-02 18:14:13 +0100
committerNao Pross <np@0hm.ch>2024-03-02 18:14:13 +0100
commit982f792229e7aabb36698ae32ab61a99b238804a (patch)
tree3f4cb0631054011476155e8f5bcb02bd536c6a14
parentAdd constants file and introduce EPS for numerical precision (diff)
downloadmdpoly-982f792229e7aabb36698ae32ab61a99b238804a.tar.gz
mdpoly-982f792229e7aabb36698ae32ab61a99b238804a.zip
Export State class to API
-rw-r--r--mdpoly/__init__.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/mdpoly/__init__.py b/mdpoly/__init__.py
index b08f191..3f56b27 100644
--- a/mdpoly/__init__.py
+++ b/mdpoly/__init__.py
@@ -2,8 +2,9 @@
A Library to represent multivariate polynomials
"""
-# internal classes imported with underscore because they should not be exposed
-# to the end users
+# internal classes imported with underscore because
+# they should not be exposed to the end users
+
from .abc import (Shape as _Shape)
from .algebra import (PolyRingAlgebra as _PolyRingAlgebra,
@@ -13,12 +14,23 @@ from .leaves import (Const as _Const,
Var as _Var,
Param as _Param)
+from .state import State as _State
+
from typing import Self, Sequence
+# ┏━╸╻ ╻┏━┓┏━┓┏━┓╺┳╸ ┏━┓┏━┓ ╻┏━┓
+# ┣╸ ┏╋┛┣━┛┃ ┃┣┳┛ ┃ ┣━┫┗━┓╺━╸┃┗━┓
+# ┗━╸╹ ╹╹ ┗━┛╹┗╸ ╹ ╹ ╹┗━┛ ╹┗━┛
+
Shape = _Shape
+State = _State
+# ╻ ╻┏━┓┏━┓┏━┓┏━┓┏━╸┏━┓┏━┓
+# ┃╻┃┣┳┛┣━┫┣━┛┣━┛┣╸ ┣┳┛┗━┓
+# ┗┻┛╹┗╸╹ ╹╹ ╹ ┗━╸╹┗╸┗━┛
+
class _FromHelpers:
@classmethod
def from_names(cls, comma_separated_names: str, strip: bool =True) -> Sequence[Self]:
@@ -28,7 +40,6 @@ class _FromHelpers:
names = map(str.strip, names)
yield from map(cls, names)
-
class Constant(_Const, _PolyRingAlgebra, _FromHelpers):
""" Constant values """