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