Uh oh!
There was an error while loading. Please reload this page.
[ModelicaSystem] improve set functions - #345
Conversation
syntron
commented
Aug 16, 2025
@adeas31 one thing I did not checked but which is quite important to confirm here: are there the same rules for variable names in Python and OpenModelica? I assume yes and then all is fine - if not this PR should not be applied! |
171c0f5 to
41c9d31Compareadeas31
commented
Aug 21, 2025
Which variables are you talking about? Did you mean Modelica and not OpenModelica? |
adeas31
commented
Aug 21, 2025
Also as I understand this supersedes PR #326. |
syntron
commented
Aug 21, 2025
@adeas31 Yes, the interface uses the idea of @SengerM (PR #326). It adds this way of defining arguments not only to
Just to confirm: the definition of a valid variable in Modelica is eual to the definition in Python, i.e. must start with a letter (or underscore?) and can only contain leters, numbers and underscore. The reason for this is that by using the code in this PR, the Modelica variables are used as Python variables. Thus, the rules should match in this direction. |
SengerM
commented
Aug 22, 2025
The rules for identifiers in Python and the ones for Modelica.
Even if the naming rules are a bit different, you can overcome this issue if the current string interface is maintained for those specific cases. |
41c9d31 to
6102df1Compare6102df1 to
36c93c4Compare* use a Pythonic way for input:
setParameters(a=123)
param = {'a': 123}
setParameters(**param)
see input by SengerM in PR OpenModelica#32636c93c4 to
e3121f7CompareUh oh!
There was an error while loading. Please reload this page.
improve input handling for set*() functions
Based on PR #314 with input from SengerM (see PR #326); this replaces PR #326