From a40800f816213e6063e5c921e639ca1e7d15dfea Mon Sep 17 00:00:00 2001
From: Ugo Albanese <ugo.albanese@santannapisa.it>
Date: Wed, 1 Apr 2020 14:45:32 +0000
Subject: [PATCH] =?UTF-8?q?Fusion=20effectu=C3=A9e=20add-populations-fix-N?=
 =?UTF-8?q?RRPLT-7799=20(pull=20request=20#21)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[NRRPLT-7799] updated use of load_brain and load_population from kwargs to dict

* [NRRPLT-7799] Update use of load_brain and load_population from kwargs to dict

Approuvé par : Eloy Retamino
Approuvé par : Stefano Nardo
---
 bitbucket-pipelines.yml                                      | 5 ++++-
 .../cle/DistributedPyNNControlAdapter.py                     | 4 ++--
 .../hbp_nrp_distributed_nest/launch/NestBrainProcess.py      | 4 ++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
index d62b366..69c25fc 100644
--- a/bitbucket-pipelines.yml
+++ b/bitbucket-pipelines.yml
@@ -13,9 +13,12 @@ pipelines:
         script:
           # Branch dependencies (ex-gerrit topic)
           - git archive --remote=ssh://git@bitbucket.org/hbpneurorobotics/admin-scripts.git refs/heads/master nrp_branch_topic_checkout | tar xf -
-          - . ./nrp_branch_topic_checkout admin-scripts user-scripts ExDBackend ExperimentControl CLE Experiments Models
+          - . ./nrp_branch_topic_checkout admin-scripts user-scripts ExDBackend ExperimentControl CLE Experiments Models GazeboRosPackages
           - cd $BITBUCKET_CLONE_DIR
 
+          # This plan depends on GazeboRosPackages being built
+          - pushd $HBP/GazeboRosPackages && rm -rf build devel && catkin_make && popd && cd $BITBUCKET_CLONE_DIR
+
           # Configure build has to be placed before make devinstall
           - export VIRTUAL_ENV_PATH=$VIRTUAL_ENV
           - export NRP_INSTALL_MODE=dev
diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/cle/DistributedPyNNControlAdapter.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/cle/DistributedPyNNControlAdapter.py
index 9114b55..aca198a 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/cle/DistributedPyNNControlAdapter.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/cle/DistributedPyNNControlAdapter.py
@@ -37,7 +37,7 @@ class DistributedPyNNControlAdapter(PyNNControlAdapter):
     simulation steps.
     """
 
-    def load_brain(self, network_file, **populations):
+    def load_brain(self, network_file, populations):
         """
         Notify all remote brain processes to load the brain with population definitions
         specified.
@@ -59,7 +59,7 @@ class DistributedPyNNControlAdapter(PyNNControlAdapter):
 
         # run the actual brain load on this process
         super(DistributedPyNNControlAdapter, self).load_brain(network_file)
-        super(DistributedPyNNControlAdapter, self).load_populations(**populations)
+        super(DistributedPyNNControlAdapter, self).load_populations(populations)
 
     def run_step(self, dt):
         """
diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
index 8369213..38efbec 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
@@ -71,7 +71,7 @@ class NestBrainProcess(object):
         self._brain_controller = PyNNControlAdapter(sim)
         self._brain_controller.initialize()
         self._brain_controller.load_brain(sim_config.brain_model.resource_path.abs_path)
-        self._brain_controller.load_populations(**sim_config.get_populations_dict())
+        self._brain_controller.load_populations(sim_config.get_populations_dict())
 
         # spawn the communication adapter for use as needed
         self._brain_communicator = PyNNNestCommunicationAdapter()
@@ -281,7 +281,7 @@ class NestBrainProcess(object):
             # discard any previously loaded brain and load the new spec
             self._brain_controller.shutdown()
             self._brain_controller.load_brain(params['file'])
-            self._brain_controller.load_populations(**params['populations'])
+            self._brain_controller.load_populations(params['populations'])
 
             # reinitialize the communication adapter to connect to the "new" brain
             self._brain_communicator.shutdown()
-- 
GitLab