aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mdpoly/expressions.py9
1 files 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