Repository navigation
ModelicaSystem only useable locally - with possible solutions #315
Description
Activity
A solution is available! Please check PR #333 for a branch which contains all changes listed below
PRs:
(1) NO additional dependencies
- 0=>1 (PR OMCPath #317) => milestone 4.1.0
- 0=>1 (PR [ModelicaSystem] update handling of work directory #329)
- 0=>1 (PR ModelicaSystem.linearize() -> do not execute python file #320)
- 0=>1 (PR ModelicaSystem - remove xml_file as class variable #321)
- 0=>1 (PR [ModelicaSystem] prepare OMCPath #330)
- 0=>1 (PR ModelicaSystem - rewrite set*() functions #314)
- 0=>2 (PR [OMCSessionRunData] run executable via OMCSessionZMQ #331) => milestone 4.1.0
- 0=>2 (PR [OMCProcess*] use pathlib #332) => milestone 4.1.0
- 0=>3 (PR new class ModelicaSystemDoE #312) => milestone 4.1.0
(2) WITH dependencies
- 1=>2 (PR ModelicaSystem - use OMCPath #322) - (OMCPath, ModelicaSystem_workdir, ModelicaSystem_linearize, ModelicaSystem_xml, ModelicaSystem_rewrite_set_functions, ModelicaSystem_prepare_OMCPath) => milestone 4.1.0
- 2=>3 (PR ModelicaSystemCMD - use OMCPath #324) - (ModelicaSystem_use_OMCPath, OMCSession_executable, OMCProcess_pathlib) => milestone 4.1.0
- 3=>4 (PR [ModelicaSystemDoE] use OMCPath #333) - (ModelicaSystemCmd_use_OMCPath, ModelicaSystemDoE) => milestone 4.1.0
(3) small changes (NO additional dependency)
... to be defined as PR ...
@Sonyoyo could you please test on WSL?
Updated data / additional PRs
(1) NO additional dependencies
(2) WITH dependencies
- 4=>5 (PR [ModelicaSystem] rename getconn => session #334) [ModelicaSystem] rename _getconn => _session and add get_session() => milestone 4.1.0
- 4=>5 (PR Reorder imports #344) reorder imports => milestone 4.1.0
(3) small changes (NO additional dependency)
- 0=>? (PR [OMCProcessDocker*] update exception message - make them specific to … #336) OMCProcessDocker
- 0=>? (PR [OMCProcess*] add docstrings #337) OMCProcess_docstrings
- 0=>? (PR [ModelicaSystem] small changes #338) ModelicaSystem_small_changes
- 0=>? (PR [ModelicaSystemCmd] spelling fix #339) ModelicaSystemCmd_spelling_fix
- 0=>? (PR [ModelicaSystem] add type hints for requestApi() and use kwargs for all calls #340) ModelicaSystem_requestApi
- 0=>? (PR [ModelicaSystemCmd] update arg_set() #341) ModelicaSystemCmd_arg_set
- 0=>? (PR [OMCProcessDocker*] fix unused variable #342) OMCProcessDocker_unused_variable
- 0=>? (PR [ModelicaSystem] improve handling of variable filter in buildModel() #343) ModelicaSystem_buildModel
just as reference: PR #308 would be something for the next big release / version 5.0.0 or so
update how to REMOVE depreciated functionality (milestone 5.0.0 or later?):
- (PR Remove deprecated code in ModelicaSystem set*() functions #347) => PR ModelicaSystem - rewrite set*() functions #314, PR [ModelicaSystem] improve set functions #345
- (PR Remove deprecated parts of OMCPath #346) => PR OMCPath #317
- (PR Remove deprecated functionality #308) => PR Refactor file structure #257, PR Add modelica system cmd #279
@adeas31 With this I'm done ;-)
- small updates / cleanups for 4.0.0
- bigger changes for 4.1.0 (ModelicaSystemDoE, OMCPath and related changes)
- cleanup for 5.0.0 (remove all depreciated functionality; see comment above)
Perhaps (an idea I'm plaing with) some additional cleanup for 4.1.0 (merge OMCSessionZMQ into OMCProcess + lots of renames to cleanup the namespace / usage of session)
I have assign milestones to all open PRs now. You can double check.
Below are the points I found:
-
PR Remove deprecated parts of OMCPath #346 => milestone 5.0.0
-
PR [DummyPopen] fix exception on timeout for wait() #323 => milestone 4.0.0
-
PR Better interface for
setParameters#326 is resolved in PR [ModelicaSystem] improve set functions #345 => milestone 4.1.0 -
issue matplotlib.pyplot.savefig() breaks after useing model.linearize() #224 => resolved by PR ModelicaSystem.linearize() -> do not execute python file #320 / milestone 4.0.0
-
issue Handle process externally in ModelicaSystem.simulate and ModelicaSystem.linearized #230 => could be handled by PR [ModelicaSystemDoE] use OMCPath #333 & PR [OMCSessionRunData] run executable via OMCSessionZMQ #331 (execution independent of ModelicaSystem) => milestone 4.1.0
Reacted by Adeel Asghar-
@adeas31 please see the comment above for my updates; 2 PRs have no milestone and one other will be fixed by the defined PRs
This can be closed after the merge of all relevant parts
See discussion in PR #309 – ModelicaSystem can only be used locally due to dependencies on access to the file system where OMC is running as well as the need to call the compiled model executable. This limits the usage of the class as it cannot be used with docker or WSL.
There are the following problems to solve (and possible solutions):
need of file system interactions => solution: create OMCPath, an implementation of a pathlib.Path object which uses OMC as backend (see detailed analyses which functionality is needed in PR [ModelicaSystem] only local omc process allowed #309)
run executable => solution: include a basic functionality within OMCSessionZMQ / OMCProcess* which allows to just(!) call the executable; this would abstract this functionality, i.e. it would prepend the command with ‘docker …’ or ‘wsl …’ as needed (but would also introduce another link / dependency to the system where OMC is running). Here it would be helpful if this could be coded such that it only returns the command to call (as list). Thus, ModelicaSystemCmd would stay independent of the OMCSessionZMQ instance.
library search path => solution: see (2); for this item, a solution is needed, even if (1) and (2) are not considered – does models executable using external libraries (example: SDF) run at all using ModelicaSystem with Linux? how to get the needed paths?
@adeas31 feel free to provide your thoughts