diff --git a/hbp_nrp_virtual_coach/pynrp/simulation.py b/hbp_nrp_virtual_coach/pynrp/simulation.py index ea5b829821759012f4c4225e62409714d231787d..1b8de4890971c2c0632de275b665b9a6bce241e0 100644 --- a/hbp_nrp_virtual_coach/pynrp/simulation.py +++ b/hbp_nrp_virtual_coach/pynrp/simulation.py @@ -92,7 +92,7 @@ class Simulation(object): # pylint: disable=too-many-locals, too-many-arguments def launch(self, experiment_id, experiment_conf, server, reservation, cloned=True, - storage_token=None, brain_processes=1, profiler='disabled'): + storage_token=None, brain_processes=1, profiler='disabled', recordingPath=None): """ Attempt to launch and initialize the given experiment on the given servers. This should not be directly invoked by users, use the VirtualCoach interface to validate @@ -107,6 +107,7 @@ class Simulation(object): :param storage_token: A string representing the token for storage authorization. :param brain_processes: Number of mpi processes in the brain simulation. :param profiler: profiler option. Possible values are: disabled, cle_step and cprofile. + :param recordingPath: (optional) the path to a the zip of a recording. """ assert isinstance(experiment_id, string_types) assert isinstance(experiment_conf, string_types) @@ -142,7 +143,8 @@ class Simulation(object): 'experimentConfiguration': experiment_conf, 'gzserverHost': self.__server_info['serverJobLocation'], 'reservation': reservation, - 'private': cloned} + 'private': cloned, + 'playbackPath': recordingPath} status_code, sim_json = self.__http_client.post(url, sim_info) diff --git a/hbp_nrp_virtual_coach/pynrp/tests/test_virtual_coach.py b/hbp_nrp_virtual_coach/pynrp/tests/test_virtual_coach.py index 74053713082a938143faca4b0fde261d293b6a3d..c5fef8b4cca7ce3c80ca18439c6748c920364e2c 100644 --- a/hbp_nrp_virtual_coach/pynrp/tests/test_virtual_coach.py +++ b/hbp_nrp_virtual_coach/pynrp/tests/test_virtual_coach.py @@ -384,7 +384,7 @@ mock-server-5 self._vc._VirtualCoach__http_headers = {'Authorization': 'token'} def launch(experiment_id, experiment_conf, server, reservation, cloned, token, - brain_processes=1, profiler='disabled'): + brain_processes=1, profiler='disabled', recordingPath=None): if server == 'mock-server-1': raise Exception('fake failure!') return True diff --git a/hbp_nrp_virtual_coach/pynrp/virtual_coach.py b/hbp_nrp_virtual_coach/pynrp/virtual_coach.py index 99149021b6bf669f794e35ca9f94fc37168002f4..da450c94af8cb8e8e30e11b63f1fe90c11ebf02d 100644 --- a/hbp_nrp_virtual_coach/pynrp/virtual_coach.py +++ b/hbp_nrp_virtual_coach/pynrp/virtual_coach.py @@ -215,9 +215,10 @@ class VirtualCoach(object): return token + # pylint: disable-msg=too-many-locals def launch_experiment(self, experiment_id, server=None, reservation=None, cloned=True, brain_processes=1, - profiler='disabled'): + profiler='disabled', recordingPath=None): """ Attempts to launch a simulation with the given parameters. If no server is explicitly given then all available backend servers will be tried. Only cloned experiments to the Storage @@ -234,6 +235,7 @@ class VirtualCoach(object): :param brain_processes: (optional) Number of mpi processes in the brain simulation. :param profiler: (optional) profiler option. Possible values are: disabled, cle_step and cprofile. + :param recordingPath: (optional) the path to a the zip of a recording. """ assert isinstance(experiment_id, string_types) assert isinstance(server, (string_types, type(None))) @@ -274,8 +276,8 @@ class VirtualCoach(object): sim = Simulation(self.__http_client, self.__config, self) for server_i in servers: try: - if sim.launch(experiment_id, str(experiment_conf), str(server_i), - reservation, cloned, self.__storage_token, brain_processes, profiler): + if sim.launch(experiment_id, str(experiment_conf), str(server_i), reservation, + cloned, self.__storage_token, brain_processes, profiler, recordingPath): return sim # pylint: disable=broad-except