Skip to content
Snippets Groups Projects
Commit 91397365 authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Disable sorting temporarily

parent f440dde3
No related branches found
No related tags found
No related merge requests found
Pipeline #163369 passed
...@@ -310,24 +310,23 @@ def nest_get_spikes_by_population(population_id, _from=None, to=None, offset=Non ...@@ -310,24 +310,23 @@ def nest_get_spikes_by_population(population_id, _from=None, to=None, offset=Non
spikes = Spikes([], []) spikes = Spikes([], [])
for node in nodes.nest_simulation_nodes: for node in nodes.nest_simulation_nodes:
response = requests.get( response = requests.get(
node+'/spikes', params={"from": _from, "to": to}).json() node+'/spikes', params={"from": _from, "to": to, "population": population_id}).json()
for x in range(len(response['simulation_times'])): spikes.simulation_times.extend(response['simulation_times'])
spikes.simulation_times.append(response['simulation_times'][x]) spikes.gids.extend(response['gids'])
spikes.gids.append(response['gids'][x])
# sort # # sort
sorted_ids = [x for _, x in sorted( # sorted_ids = [x for _, x in sorted(
zip(spikes.simulation_times, spikes.gids))] # zip(spikes.simulation_times, spikes.gids))]
spikes.gids = sorted_ids # spikes.gids = sorted_ids
spikes.simulation_times.sort() # spikes.simulation_times.sort()
# offset and limit # # offset and limit
if (offset is None): # if (offset is None):
offset = 0 # offset = 0
if (limit is None or (limit + offset) > len(spikes.gids)): # if (limit is None or (limit + offset) > len(spikes.gids)):
limit = len(spikes.gids) - offset # limit = len(spikes.gids) - offset
spikes.gids = spikes.gids[offset:offset+limit] # spikes.gids = spikes.gids[offset:offset+limit]
spikes.simulation_times = spikes.simulation_times[offset:offset+limit] # spikes.simulation_times = spikes.simulation_times[offset:offset+limit]
return spikes return spikes
# spikes = Spikes([], []) # spikes = Spikes([], [])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment