cklb / pymoskito

Python based modular control simulation kickass toolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correct initialization of a module

TanDro opened this issue · comments

If an error in the init of a module happens, there is only the check

if all([mod in self._sim_modules
for mod in Simulator.static_module_list]):
return True

but the simulation starts still. Is there a currently implemented possibility to test, if the init was correct?
Background: I run cmake in the init of some new modules and it can happen, that the command fails.

The check you mentioned above only makes sure that all modules which are mandatory for the simulation are actually created.
To reach this check, the 'init' calls of all selected routines must not raise any exception.
If such an exception is raised, the whole application crashes immediately, which can indeed be done better.
Do you want to test the correct behaviour without running a simulation or which other kind of response are you expecting?

Okay, it was not sure, if there is another function, that handle these behaviour.
I do some make stuff in the init to build a library from c source. Now I have added a little exception handling of the initialization of a module. Tank you.