Skip to content
Snippets Groups Projects
Commit d692548f authored by Jan Müller's avatar Jan Müller
Browse files

Update Data layout

parent 26353fb2
No related branches found
No related tags found
No related merge requests found
...@@ -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()
......
...@@ -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_steps: 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_steps(self) -> List[float]: def first_simulation_step(self) -> float:
"""Gets the simulation_steps 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
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment