From 982f792229e7aabb36698ae32ab61a99b238804a Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 2 Mar 2024 18:14:13 +0100 Subject: Export State class to API --- mdpoly/__init__.py | 17 ++++++++++++++--- 1 file 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 """ -- cgit v1.2.1