Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
access-node
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LuFG VR VIS
VR-Group
In Situ Pipeline
access-node
Merge requests
!7
Remove redundant code and use existing functions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Remove redundant code and use existing functions
feature/Fix_spikes_per_population
into
develop
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Remove redundant code and use existing functions
Jan Delember
requested to merge
feature/Fix_spikes_per_population
into
develop
Jul 28, 2020
Overview
0
Commits
2
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
c1cee84c
2 commits,
Jul 28, 2020
1 file
+
2
−
55
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
access_node/controllers/nest_controller.py
+
2
−
55
View file @ c1cee84c
Edit in single-file editor
Open in Web IDE
Show full file
@@ -321,60 +321,7 @@ def nest_get_spikes_by_population(population_id, _from=None, to=None, offset=Non
:rtype: Spikes
"""
con
=
connect_to_database
()
cur
=
con
.
cursor
()
cur
.
execute
(
"
SELECT address FROM nest_simulation_node
"
)
nodes
.
nest_simulation_nodes
=
[
i
[
0
]
for
i
in
cur
.
fetchall
()]
con
.
close
()
print
(
"
Updated simumlation nodes:
"
+
str
(
nodes
.
nest_simulation_nodes
))
gids
=
nest_get_gids_in_population
(
population_id
)
return
nest_get_spikes
(
_from
,
to
,
gids
,
offset
,
limit
)
spikes
=
Spikes
([],
[])
for
node
in
nodes
.
nest_simulation_nodes
:
response
=
requests
.
get
(
node
+
'
/spikes
'
,
params
=
{
"
from
"
:
_from
,
"
to
"
:
to
,
"
population
"
:
population_id
})
try
:
response_json
=
response
.
json
()
spikes
.
simulation_times
.
extend
(
response_json
[
'
simulation_times
'
])
spikes
.
gids
.
extend
(
response_json
[
'
gids
'
])
except
:
pass
# # sort
# sorted_ids = [x for _, x in sorted(
# zip(spikes.simulation_times, spikes.gids))]
# spikes.gids = sorted_ids
# spikes.simulation_times.sort()
# # offset and limit
# if (offset is None):
# offset = 0
# if (limit is None or (limit + offset) > len(spikes.gids)):
# limit = len(spikes.gids) - offset
# spikes.gids = spikes.gids[offset:offset+limit]
# spikes.simulation_times = spikes.simulation_times[offset:offset+limit]
return
spikes
# spikes = Spikes([], [])
# for node in nodes.nest_simulation_nodes:
# response = requests.get(
# node+'/population/$'+str(population_id)+'/spikes', params={"from": _from, "to": to}).json()
# for x in range(len(response['simulation_times'])):
# spikes.simulation_times.append(response['simulation_times'][x])
# spikes.gids.append(response['gids'][x])
# # sort
# sorted_ids = [x for _, x in sorted(
# zip(spikes.simulation_times, spikes.gids))]
# spikes.gids = sorted_ids
# spikes.simulation_times.sort()
# # offset and limit
# if (offset is None):
# offset = 0
# if (limit is None or (limit + offset) > len(spikes.gids)):
# limit = len(spikes.gids) - offset
# spikes.gids = spikes.gids[offset:offset+limit]
# spikes.simulation_times = spikes.simulation_times[offset:offset+limit]
# return spikes
\ No newline at end of file
Loading