Skip to content

(I002) setInputsCSV()#447

Draft
syntron wants to merge 30 commits intoOpenModelica:masterfrom
syntron:I002-setInputsCSV
Draft

(I002) setInputsCSV()#447
syntron wants to merge 30 commits intoOpenModelica:masterfrom
syntron:I002-setInputsCSV

Conversation

@syntron
Copy link
Contributor

@syntron syntron commented Mar 6, 2026

Read content from a CSV file and use it to define the time based input data.

See issue #353 - currently completly untested from my side!

@FaBiasch could you please tests?

syntron added 28 commits March 9, 2026 20:15
[ModelExecution*] create classes to handle model execution

* rename ModelicaSystemCmd => ModelExecutionCmd
* rename OMCSessionRunData => ModelExecutionData
* create class ModelExecutionException
* move some code:
  * OMCSession.omc_run_data_update() => merge into ModelExecutionCmd.define()
  * OMCSession.run_model_executable() => ModelExecutionData.run()

[test_ModelicaSystemCmd] update unittest

[ModelExecutionData] include the original exception if reraised as ModelExecutionException

[ModelicaSystem] fix usage of ModelicaSystemCmd
[ModelicaSystem] split ModelicaSystem into ModelicaSystemABC and ModelicaSystem

[ModelicaSystem] rename ModelicaSystem => ModelicaSystemOMC

* add compatibility variable for ModelicaSystem

[test_ModelicaSystemOMC] rename from ModelicaSystem and update

[test_*] use ModelicaSystemOMC

[ModelicaSystem*] fix last usages of ModelicaSystem() in comments & docstrings
[ModelicaSystem] split ModelicaSystemDoE into ModelicaDoEABC and ModelicaDoE

[ModelicaSystem] rename ModelicaSystemDoE => ModelicaDoEOMC

* add compatibility variable for ModelicaSystemDoE

[test_ModelicaDoEOMC] rename from ModelicaSystemDoE and update

[ModelicaSystem] update ModelicaDoEABC to use ModelicaSystemABC

[ModelicaSystem] define doe_get_solutions() as separate method
[OMCSession] update OMCPath to use OMPathABC as baseline and further cleanup

[ModelicaSystem] shortcut to use OMCPath = OMPathABC for now

[ModelicaSystem] fix usage of OMCPath; replace by OMPathABC

[OMCSession] move OM(C)Path classes into the if cause

[OMCSession] define and use OMPathBase

[OMCSession] align on OMPathABC; replace usage of OMPathBase
[OMCSession] update OMCSession* to use OMSessionABC as baseline and further cleanup

[ModelicaSystem] shortcut to use OMCSession = OMSessionABC for now

[ModelicaSystem] fix usage of OMCSession; replace by OMSessionABC

fix usage of OMCSession

[OMSessionABC] fix OMCPath; rename to OMPathABC
[OMCSession] add *Runner related classes for OMPath and OMSession

[ModelicaSystem] add ModelicaSystemRunner

[test_ModelicaSystemRunner] add test case for ModelicaSystemRunner

[ModelicaSystem] add ModelicaDoERunner

[test_ModelicaDoERunner] add test case for ModelicaDoERunner

[OMCSession] move OMCPathRunner* into the if clause

[OMSessionRunner] fix usage of sendExpression()

[__init__] add missing definitions for *Runner classes

[ModelicaDoERunner] fix definition; allow all variations of ModelicaSystem*

[test_ModelicaDoERunner] fix definition; test ModelicaSystem(OCM|Runner)

[ModelicaDoEABC] add get_resultpath()
* comments
* prepare cmd_prefix handling within OMSession
* fix timeout handling
[__init__] define OMSessionABC in the public interface

[OMCSessionZMQ] move class definition such that it can be derived from OMSessionABC

* needed for the compatibility layer
[OMPathABC] improve definition

* add get_session()
* fix return values

[(_)OMCPath] improve definition

* check return value from OMC
* define return value for methods
[(_)OMPathRunnerLocal] improve definition

* fix return values
* additional cleanups

[__init__] define OMPathRunnerLocal for public interface

[_OMPathRunnerBash] define class

[__init__] define OMPathRunnerBash for public interface

[OMSessionRunner] update code such that it can be used by OMPathRunnerLocal and OMPathRunner Bash
[OMCSessionPort] fix timeout handling

[OMCSessionDocker*] improve data handling

* move more code to OMCSessionDockerHelper
* use _docker_omc_start() to differentiate classes
* define cmd_prefix

[OMCSessionWSL] define cmd_prefix

[OMCSessionWSL] layout fix
[ModelicaSystemABC] reorder code in __init__()

[ModelicaSystem*] linter fixes
[OMTypedParser] compatibility layer

[__init__/OMCSession] prepare compatibility layer

[ModelicaSystem] define as compatibility layer

[ModelicaSystemCmd] define as compatibility layer
add workflow to run unittests in ./tests

tests from v4.0.0

fix test_linearization from v4.0.0

flake8 error: test_linearization.py:71:5: E741 ambiguous variable name 'l'

this was fixed in: 'update usage of flake8 (OpenModelica#357)' (SHA1: 70cb446)

fix test_ModelicaSystem - needed adaptions:

* convert OMCPath to pathlib.Path
* use correct exceptions

define test workflows for v400
[test_*] reorder imports

[tests_ModelicaDoE*] fix pylint hint

* use .items()

[tests_*] use OMSessionABC.get_version()

[test_ModelicaSystemCmd] use get_model_name() instead of access to private variable _model_name

[test_ModelicaSystemOMC] read file using utf-8 encoding / linter fix

[test_ModelicaSystemRunner] update test case

* ModelicaSystemRunner & OMCPath
* ModelicaSystemRunner & OMPathRunnerLocal
* ModelicaSystemRunner & OMPathRunnerBash
* ModelicaSystemRunner & OMPathRunnerBash using docker
* ModelicaSystemRunner & OMPathRunnerBash using WSL (not tested!)

[test_OMCPath] update test case

* OMCPath & OMCSessionZMQ
* OMCPath & OMCSessionLocal
* OMCPath & OMCSessionDocker
* OMCPath & OMCSessionWSL (not tested!)
* OMPathLocal & OMCSessionRunner
* OMPathBash & OMCSessionRunner
* OMPathBash & OMCSessionRunner in docker
* OMPathBash & OMCSessionRunner in WSL (not tested!)

add workflow to run unittests in ./tests

[test_OMParser] use only the public interface => om_parser_basic()

[test_OMTypedParser] rename file / use om_parser_typed()

update tests - do NOT run test_FMIRegression.py

reason:
* it is only a test for OMC / not OMPython specific
* furthermore, it is run automatically via cron job (= FMITest)

[test_ModelExecutionCmd] rename from test_ModelicaSystemCmd
[ModelicaSystemCmd] add missing docstring

[OMCSession] spelling fixes

[OMCSessionCmd] add warning about depreciated class

[OMCSessionABC] remove duplicated code; see OMSessionABC

[OMSessionRunnerABC] define class

[OMCSessionZMQ] call super()__init__()

[OMCPath] fix forward dependency on OMCSessionLocal

[OMSessionException] rename from OMCSessionException

[__init__] fix imports
[README.md] small updates

[__init__] small updates
[pylint] fix 'R1729: Use a generator instead 'all(isinstance(item, tuple) for item in val_evaluated)' (use-a-generator)'

[pylint] fix 'W0237: Parameter 'expr' has been renamed to 'command' in overriding 'OMCSessionZMQ.sendExpression' method (arguments-renamed)'

[pylint] [OM*Path*] fix pylint messags about incompatible definitions
[ModelExecutionException] catch exception if ModelExecutionCmd.run() is used

[bugfix] [ModelicaSystem] fix exception; use ModelicaSystemError (instead of wrong ModelExecutionException)

[bugfix] [ModelicaSystemABC] fix _prepare_input_data() - ensure returned data is dict[str, str]
[compatibility] add class wrapper to provide the depreciation message

[ModelicaSystem] fix / improve wrapper functions for v4.0.0 compatibility

[ModelicaSystemABC] additional checks for setInputs()

[test_ModelicaSystemOMC] add tests for setInputs()

[__init__] define ModelicaSystemDoE at the right point (=> compatibility layer)

[__init__] remove duplicate 'OMCSessionABC' in __all__
[ModelicaSystemABC] remove code for (depreciated) arguments in set*() methods

* define code in the compatibility layer in class ModelicaSystem

[test_ModelicaSystem(OMC)] update tests

* for new version: remove usage of old definition
* for compatibility version: test old definition
[OMCSessionABC] remove execute(); still available in compatibility v4.0.0

[ModelicaSystem] define _set_compatibility_helper() as static

[ModelExecutionCmd] remove depreciated simflags

[test_ModelSystemCmd/ModelExecutionCmd] fix test due to changes

[ModelicaSystemCmd] cleanup - do not define (unused / not useable) class
@syntron syntron force-pushed the I002-setInputsCSV branch from bf405db to 56a787c Compare March 9, 2026 19:46
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