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
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
Commits
26353fb2
Commit
26353fb2
authored
5 years ago
by
Jan Müller
Browse files
Options
Downloads
Patches
Plain Diff
Update nest_controller
parent
abab63d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
access_node/controllers/nest_controller.py
+26
-9
26 additions, 9 deletions
access_node/controllers/nest_controller.py
with
26 additions
and
9 deletions
access_node/controllers/nest_controller.py
+
26
−
9
View file @
26353fb2
...
@@ -11,6 +11,7 @@ from access_node import util
...
@@ -11,6 +11,7 @@ from access_node import util
import
json
import
json
import
requests
import
requests
def
get_attributes
():
# noqa: E501
def
get_attributes
():
# noqa: E501
"""
Retrieves the details of per-neuron attributes.
"""
Retrieves the details of per-neuron attributes.
...
@@ -46,14 +47,29 @@ def get_data(attribute, simulation_steps=None, neuron_ids=None): # noqa: E501
...
@@ -46,14 +47,29 @@ def get_data(attribute, simulation_steps=None, neuron_ids=None): # noqa: E501
dist_nodes
=
json
.
load
(
f
)
dist_nodes
=
json
.
load
(
f
)
addresses
=
dist_nodes
[
'
addresses
'
]
addresses
=
dist_nodes
[
'
addresses
'
]
data
=
Data
([],[],[])
if
simulation_steps
!=
None
:
first_ts
=
simulation_steps
[
0
]
last_ts
=
simulation_steps
[
-
1
]
num_ts
=
else
:
first_ts
=
get_timestep
()
last_ts
=
first_ts
*
get_simulation_step_count
()
count
=
get_simulation_step_count
()
timesteps
=
[
first_ts
*
x
for
x
in
range
(
count
)]
if
neuron_ids
!=
None
:
ids
=
neuron_ids
else
:
ids
=
get_neuron_ids
()
data
=
Data
([
timesteps
[
0
],
timesteps
[
-
1
]],
ids
,
[[
None
]
*
len
(
timesteps
)
for
x
in
range
(
len
(
ids
))])
for
address
in
addresses
:
for
address
in
addresses
:
response
=
requests
.
get
(
address
+
'
/data
'
,
params
=
{
"
attribute
"
:
attribute
,
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
response
=
requests
.
get
(
address
+
'
/data
'
,
params
=
{
for
x
in
range
(
len
(
response
[
'
simulation_steps
'
])):
"
attribute
"
:
attribute
,
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
data
.
simulation_steps
.
append
(
response
[
'
simulation_steps
'
][
x
])
for
x
in
range
(
len
(
response
[
'
neuron_ids
'
])):
data
.
neuron_ids
.
append
(
response
[
'
neuron_ids
'
][
x
])
data
.
values
[
data
.
neuron_ids
.
index
(
data
.
values
.
append
(
response
[
'
data
'
][
x
])
response
[
'
neuron_ids
'
][
x
])]
=
response
[
'
data
'
][
x
]
#Sort?
return
data
return
data
...
@@ -106,9 +122,10 @@ def get_spikes(simulation_steps=None, neuron_ids=None): # noqa: E501
...
@@ -106,9 +122,10 @@ def get_spikes(simulation_steps=None, neuron_ids=None): # noqa: E501
dist_nodes
=
json
.
load
(
f
)
dist_nodes
=
json
.
load
(
f
)
addresses
=
dist_nodes
[
'
addresses
'
]
addresses
=
dist_nodes
[
'
addresses
'
]
spikes
=
Spikes
([],[])
spikes
=
Spikes
([],
[])
for
address
in
addresses
:
for
address
in
addresses
:
response
=
requests
.
get
(
address
+
'
/spikes
'
,
params
=
{
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
response
=
requests
.
get
(
address
+
'
/spikes
'
,
params
=
{
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
for
x
in
range
(
len
(
response
[
'
simulation_steps
'
])):
for
x
in
range
(
len
(
response
[
'
simulation_steps
'
])):
spikes
.
simulation_steps
.
append
(
response
[
'
simulation_steps
'
][
x
])
spikes
.
simulation_steps
.
append
(
response
[
'
simulation_steps
'
][
x
])
spikes
.
neuron_ids
.
append
(
response
[
'
neuron_ids
'
][
x
])
spikes
.
neuron_ids
.
append
(
response
[
'
neuron_ids
'
][
x
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment