From 0fc1a67377ece682124e84c4e57514e2349ed71d Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 18 Mar 2024 21:39:51 +0100 Subject: Fix MatParam.to_repr --- mdpoly/expressions.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mdpoly/expressions.py b/mdpoly/expressions.py index dd033f0..d7315b0 100644 --- a/mdpoly/expressions.py +++ b/mdpoly/expressions.py @@ -86,13 +86,8 @@ class MatParam(Param): shape: Shape def to_repr(self, repr_type: Type[ReprT], state: State) -> tuple[ReprT, State]: - if self not in state.parameters: - raise MissingParameters("Cannot construct representation because " - f"value for parameter {self} was not given.") - - # FIXME: add conversion to scalar variables - # Ignore typecheck because dataclassabc has not type stub - return MatConst(state.parameters[self]).to_repr(repr_type, state) # type: ignore[call-arg] + p = state.parameter(self) + return MatConst(p).to_repr(repr_type, state) # type: ignore[call-arg] def __str__(self) -> str: return self.name -- cgit v1.2.1