Skip to content

Conversation

@syntron
Copy link
Contributor

@syntron syntron commented Dec 29, 2025

This is an update of PR #400 based on my comments:

  • move import re to the right point
  • call version parsing only once (directly in __init__())
  • merge override code in one function and call it as needed - def _process_override_data()

This needed some cleanup for _linearization_options and _optimization_options. Up to this PR, these were defined as dict[str, str | float] with the float option only used on initialisation. As soon as OMC was run, the data would be defined as str. Always forcing str removes this ambiguity and simplifies the definitions. This change is within the same PR as it is needed to get an OK from the linters ...

Pylint is recommenting to order the imports in several sections alphabetically:
(1) python standard library
(2) third party packages
(3) current package
Would it make sense to combine this code and the code in linearize() in one new function?

def _process_override_data(self, om_cmd, sim_override, file_override) -> None:
The code could:
(1) check the version; set command line parameters as needed
(2) create the content of the override file
(3) create the overwrite file and set it as command line parameter

The advantage would be, that the modified code is not in two places but only in one ...
…ons as dict[str, str]

* after OMC is run, the values will be string anyway
* simplify code / align on one common definition for these dicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant