Skip to content
Snippets Groups Projects
Commit cad00e9e authored by Ugo Albanese's avatar Ugo Albanese Committed by Axel von Arnim
Browse files

Merged in remove-unrelevant-reset-mode-NRRPLT-6658 (pull request #4)


[NRRPLT-6658] Rename setBrain service 'additional_populations' parameter to 'brain_populations'.

Change-Id: Id38677fa3d4c6a6cd9ca8683ccb16bbb874ca4a5

Approved-by: default avatarMahmoud Akl <mahmoud.akl@tum.de>
parent fcd55edd
No related branches found
No related tags found
No related merge requests found
......@@ -592,7 +592,7 @@ class Simulation(object):
self.save_transfer_functions()
self.__save_experiment_data('brain', {'data': pynn_script,
'additional_populations': populations})
'brain_populations': populations})
def save_csv(self):
"""
......@@ -689,7 +689,7 @@ class Simulation(object):
# change_population is set to 2, which means proceed with no replace_population action
body = {'data': brain_script, 'data_type': old_data_type, 'brain_type': old_brain_type,
'additional_populations': neural_population, 'change_population': change_population}
'brain_populations': neural_population, 'change_population': change_population}
url = '%s/%s' % (self.__sim_url, self.__config['simulation-scripts']['brain'])
......@@ -709,7 +709,7 @@ class Simulation(object):
self.__logger.info(err)
self.__logger.info('Attempting to restore the old Brain.')
body['data'] = old_brain
body['additional_populations'] = old_populations
body['brain_populations'] = old_populations
status_code, _ = self.__http_client.put(url, body=json.dumps(body))
if status_code != httplib.OK:
......@@ -742,7 +742,7 @@ class Simulation(object):
Gets the Neuron populations defined within the brain as a dictionary indexed by population
names.
"""
return self.__get_simulation_scripts('brain')['additional_populations']
return self.__get_simulation_scripts('brain')['brain_populations']
def edit_populations(self, populations):
"""
......
......@@ -369,7 +369,7 @@ class TestSimulation(unittest.TestCase):
def test_get_brain_and_populations(self):
self._sim._Simulation__get_simulation_scripts = Mock()
self._sim._Simulation__get_simulation_scripts.return_value = {'data': 'foo',
'additional_populations': 'bar'}
'brain_populations': 'bar'}
self._sim.get_populations()
self._sim._Simulation__get_simulation_scripts.assert_called_once()
self._sim._Simulation__get_simulation_scripts.assert_called_with('brain')
......@@ -483,7 +483,7 @@ class TestSimulation(unittest.TestCase):
self._sim.save_brain()
self._sim._Simulation__http_client.put.assert_called_once_with(
'%s/experiment/%s/brain' % (serverurl, exp_id),
body={'additional_populations': populations,'data': 'some brain code'})
body={'brain_populations': populations,'data': 'some brain code'})
self._sim._Simulation__http_client.post = Mock(return_value=(httplib.OK, None))
self._sim.save_world()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment