@@ -1068,24 +1068,24 @@ def _set_method_helper(
1068
1068
1069
1069
inputdata_status : dict [str , bool ] = {}
1070
1070
for key , val in inputdata .items ():
1071
- status = False
1072
- if key in classdata :
1073
- if datatype == "parameter" and not self .isParameterChangeable (key ):
1074
- logger .debug (f"It is not possible to set the parameter { repr (key )} . It seems to be "
1075
- "structural, final, protected, evaluated or has a non-constant binding. "
1076
- "Use sendExpression(...) and rebuild the model using buildModel() API; example: "
1077
- "sendExpression(\" setParameterValue("
1078
- f"{ self .modelName } , { key } , { val if val is not None else '<?value?>' } "
1079
- ")\" ) " )
1080
- else :
1081
- classdata [key ] = val
1082
- if overwritedata is not None :
1083
- overwritedata [key ] = val
1084
- status = True
1085
- else :
1071
+ if key not in classdata :
1086
1072
raise ModelicaSystemError ("Unhandled case in setMethodHelper.apply_single() - "
1087
1073
f"{ repr (key )} is not a { repr (datatype )} variable" )
1088
1074
1075
+ status = False
1076
+ if datatype == "parameter" and not self .isParameterChangeable (key ):
1077
+ logger .debug (f"It is not possible to set the parameter { repr (key )} . It seems to be "
1078
+ "structural, final, protected, evaluated or has a non-constant binding. "
1079
+ "Use sendExpression(...) and rebuild the model using buildModel() API; example: "
1080
+ "sendExpression(\" setParameterValue("
1081
+ f"{ self .modelName } , { key } , { val if val is not None else '<?value?>' } "
1082
+ ")\" ) " )
1083
+ else :
1084
+ classdata [key ] = val
1085
+ if overwritedata is not None :
1086
+ overwritedata [key ] = val
1087
+ status = True
1088
+
1089
1089
inputdata_status [key ] = status
1090
1090
1091
1091
return all (inputdata_status .values ())
0 commit comments