Rawvoi coupling monitors
Created by: dionperd
In this pull request from rawvoi_coupling_monitors branch I introduce the following new monitors:
- RawVoi, i.e., a Raw monitor for which the user can choose Vois
- Coupling, a Raw monitor for node_coupling,
- CouplingTemporalAverage, a TemporalAverage monitor for node_coupling.
The Coupling monitors set vois from cvars: self.voi = self.variables_of_interest if self.voi is None or self.voi.size == 0: self.voi = numpy.r_[:len(simulator.model.cvar)]
In order to shorten code, I have introduced _config_vois and _config_time methods to the base class Monitor, and to other monitors accordingly.
Some changes were needed in simulator.py:
The _loop_monitor_output() had to change to take node_coupling as argument and to choose whether to use the observed state or node_coupling, depending on whether the monitor is a Coupling monitor or not.
Moreover, we needed to compute the node_coupling of step + 1 just after looping history inside the call() and compute the node_coupling for start_step = self.current_step + 1 before getting in the integration loop, i.e., for the initial condition.
Finally, I have added tests for configuration in monitor_tests and for integration in simulator_test, following the example of other monitors.