-
Notifications
You must be signed in to change notification settings - Fork 62
[ModelicaSystem] improve set functions #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[ModelicaSystem] improve set functions #345
Conversation
@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
41c9d31
Compare
Which variables are you talking about? Did you mean Modelica and not OpenModelica? |
Also as I understand this supersedes PR #326. |
@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. |
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. |
* use a Pythonic way for input: setParameters(a=123) param = {'a': 123} setParameters(**param) see input by SengerM in PR OpenModelica#326
41c9d31
to
6102df1
Compare
improve input handling for set*() functions
Based on PR #314 with input from SengerM (see PR #326); this replaces PR #326