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
Commits
d692548f
Commit
d692548f
authored
5 years ago
by
Jan Müller
Browse files
Options
Downloads
Patches
Plain Diff
Update Data layout
parent
26353fb2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
access_node/controllers/nest_controller.py
+4
-7
4 additions, 7 deletions
access_node/controllers/nest_controller.py
access_node/models/data.py
+49
-23
49 additions, 23 deletions
access_node/models/data.py
access_node/swagger/swagger.yaml
+19
-13
19 additions, 13 deletions
access_node/swagger/swagger.yaml
with
72 additions
and
43 deletions
access_node/controllers/nest_controller.py
+
4
−
7
View file @
d692548f
...
@@ -48,22 +48,19 @@ def get_data(attribute, simulation_steps=None, neuron_ids=None): # noqa: E501
...
@@ -48,22 +48,19 @@ def get_data(attribute, simulation_steps=None, neuron_ids=None): # noqa: E501
addresses
=
dist_nodes
[
'
addresses
'
]
addresses
=
dist_nodes
[
'
addresses
'
]
if
simulation_steps
!=
None
:
if
simulation_steps
!=
None
:
num_ts
=
len
(
simulation_steps
)
first_ts
=
simulation_steps
[
0
]
first_ts
=
simulation_steps
[
0
]
last_ts
=
simulation_steps
[
-
1
]
num_ts
=
else
:
else
:
num_ts
=
get_simulation_step_count
()
first_ts
=
get_timestep
()
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
:
if
neuron_ids
!=
None
:
ids
=
neuron_ids
ids
=
neuron_ids
else
:
else
:
ids
=
get_neuron_ids
()
ids
=
get_neuron_ids
()
data
=
Data
(
[
timesteps
[
0
],
timesteps
[
-
1
]]
,
ids
,
data
=
Data
(
first_ts
,
num_ts
,
ids
,
[[
None
]
*
len
(
timesteps
)
for
x
in
range
(
len
(
ids
))])
[[
None
]
*
num_ts
for
x
in
range
(
len
(
ids
))])
for
address
in
addresses
:
for
address
in
addresses
:
response
=
requests
.
get
(
address
+
'
/data
'
,
params
=
{
response
=
requests
.
get
(
address
+
'
/data
'
,
params
=
{
"
attribute
"
:
attribute
,
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
"
attribute
"
:
attribute
,
"
simulation_steps
"
:
simulation_steps
,
"
neuron_ids
"
:
neuron_ids
}).
json
()
...
...
This diff is collapsed.
Click to expand it.
access_node/models/data.py
+
49
−
23
View file @
d692548f
...
@@ -15,29 +15,34 @@ class Data(Model):
...
@@ -15,29 +15,34 @@ class Data(Model):
Do not edit the class manually.
Do not edit the class manually.
"""
"""
def
__init__
(
self
,
simulation_step
s
:
List
[
float
]
=
None
,
neuron_ids
:
List
[
float
]
=
None
,
values
:
List
[
float
]
=
None
):
# noqa: E501
def
__init__
(
self
,
first_
simulation_step
:
float
=
None
,
num_simulation_steps
:
float
=
None
,
neuron_ids
:
List
[
float
]
=
None
,
values
:
List
[
List
[
float
]
]
=
None
):
# noqa: E501
"""
Data - a model defined in Swagger
"""
Data - a model defined in Swagger
:param simulation_steps: The simulation_steps of this Data. # noqa: E501
:param first_simulation_step: The first_simulation_step of this Data. # noqa: E501
:type simulation_steps: List[float]
:type first_simulation_step: float
:param num_simulation_steps: The num_simulation_steps of this Data. # noqa: E501
:type num_simulation_steps: float
:param neuron_ids: The neuron_ids of this Data. # noqa: E501
:param neuron_ids: The neuron_ids of this Data. # noqa: E501
:type neuron_ids: List[float]
:type neuron_ids: List[float]
:param values: The values of this Data. # noqa: E501
:param values: The values of this Data. # noqa: E501
:type values: List[float]
:type values:
List[
List[float]
]
"""
"""
self
.
swagger_types
=
{
self
.
swagger_types
=
{
'
simulation_steps
'
:
List
[
float
],
'
first_simulation_step
'
:
float
,
'
num_simulation_steps
'
:
float
,
'
neuron_ids
'
:
List
[
float
],
'
neuron_ids
'
:
List
[
float
],
'
values
'
:
List
[
float
]
'
values
'
:
List
[
List
[
float
]
]
}
}
self
.
attribute_map
=
{
self
.
attribute_map
=
{
'
simulation_steps
'
:
'
simulation_steps
'
,
'
first_simulation_step
'
:
'
first_simulation_step
'
,
'
num_simulation_steps
'
:
'
num_simulation_steps
'
,
'
neuron_ids
'
:
'
neuron_ids
'
,
'
neuron_ids
'
:
'
neuron_ids
'
,
'
values
'
:
'
values
'
'
values
'
:
'
values
'
}
}
self
.
_simulation_steps
=
simulation_steps
self
.
_first_simulation_step
=
first_simulation_step
self
.
_num_simulation_steps
=
num_simulation_steps
self
.
_neuron_ids
=
neuron_ids
self
.
_neuron_ids
=
neuron_ids
self
.
_values
=
values
self
.
_values
=
values
...
@@ -53,25 +58,46 @@ class Data(Model):
...
@@ -53,25 +58,46 @@ class Data(Model):
return
util
.
deserialize_model
(
dikt
,
cls
)
return
util
.
deserialize_model
(
dikt
,
cls
)
@property
@property
def
simulation_step
s
(
self
)
->
List
[
float
]
:
def
first_
simulation_step
(
self
)
->
float
:
"""
Gets the simulation_step
s
of this Data.
"""
Gets the
first_
simulation_step of this Data.
:return: The simulation_steps of this Data.
:return: The first_simulation_step of this Data.
:rtype: List[float]
:rtype: float
"""
return
self
.
_first_simulation_step
@first_simulation_step.setter
def
first_simulation_step
(
self
,
first_simulation_step
:
float
):
"""
Sets the first_simulation_step of this Data.
:param first_simulation_step: The first_simulation_step of this Data.
:type first_simulation_step: float
"""
self
.
_first_simulation_step
=
first_simulation_step
@property
def
num_simulation_steps
(
self
)
->
float
:
"""
Gets the num_simulation_steps of this Data.
:return: The num_simulation_steps of this Data.
:rtype: float
"""
"""
return
self
.
_simulation_steps
return
self
.
_
num_
simulation_steps
@simulation_steps.setter
@
num_
simulation_steps.setter
def
simulation_steps
(
self
,
simulation_steps
:
List
[
float
]
):
def
num_
simulation_steps
(
self
,
num_
simulation_steps
:
float
):
"""
Sets the simulation_steps of this Data.
"""
Sets the
num_
simulation_steps of this Data.
:param simulation_steps: The simulation_steps of this Data.
:param
num_
simulation_steps: The
num_
simulation_steps of this Data.
:type simulation_steps:
List[
float
]
:type
num_
simulation_steps: float
"""
"""
self
.
_simulation_steps
=
simulation_steps
self
.
_
num_
simulation_steps
=
num_
simulation_steps
@property
@property
def
neuron_ids
(
self
)
->
List
[
float
]:
def
neuron_ids
(
self
)
->
List
[
float
]:
...
@@ -95,22 +121,22 @@ class Data(Model):
...
@@ -95,22 +121,22 @@ class Data(Model):
self
.
_neuron_ids
=
neuron_ids
self
.
_neuron_ids
=
neuron_ids
@property
@property
def
values
(
self
)
->
List
[
float
]:
def
values
(
self
)
->
List
[
List
[
float
]
]
:
"""
Gets the values of this Data.
"""
Gets the values of this Data.
:return: The values of this Data.
:return: The values of this Data.
:rtype: List[float]
:rtype:
List[
List[float]
]
"""
"""
return
self
.
_values
return
self
.
_values
@values.setter
@values.setter
def
values
(
self
,
values
:
List
[
float
]):
def
values
(
self
,
values
:
List
[
List
[
float
]
]
):
"""
Sets the values of this Data.
"""
Sets the values of this Data.
:param values: The values of this Data.
:param values: The values of this Data.
:type values: List[float]
:type values:
List[
List[float]
]
"""
"""
self
.
_values
=
values
self
.
_values
=
values
This diff is collapsed.
Click to expand it.
access_node/swagger/swagger.yaml
+
19
−
13
View file @
d692548f
...
@@ -197,9 +197,10 @@ definitions:
...
@@ -197,9 +197,10 @@ definitions:
Data
:
Data
:
type
:
"
object"
type
:
"
object"
properties
:
properties
:
simulation_steps
:
first_simulation_step
:
type
:
"
array"
type
:
"
number"
items
:
format
:
"
int64"
num_simulation_steps
:
type
:
"
number"
type
:
"
number"
format
:
"
int64"
format
:
"
int64"
neuron_ids
:
neuron_ids
:
...
@@ -208,16 +209,21 @@ definitions:
...
@@ -208,16 +209,21 @@ definitions:
type
:
"
number"
type
:
"
number"
format
:
"
int64"
format
:
"
int64"
values
:
values
:
type
:
"
array"
items
:
type
:
"
array"
type
:
"
array"
items
:
items
:
type
:
"
number"
type
:
"
number"
example
:
example
:
simulation_steps
:
first_simulation_step
:
-
0.1
-
1
-
0.2
num_simulation_steps
:
-
2
values
:
values
:
-
61.48
-
-
61.48
-
13.46
-
45.23
-
-
13.46
-
23.77
neuron_ids
:
neuron_ids
:
-
1
-
1
-
2
-
2
...
@@ -236,8 +242,8 @@ definitions:
...
@@ -236,8 +242,8 @@ definitions:
format
:
"
int64"
format
:
"
int64"
example
:
example
:
simulation_steps
:
simulation_steps
:
-
0.1
-
2
-
0.2
-
5
neuron_ids
:
neuron_ids
:
-
1
-
1
-
2
-
2
...
...
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