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

Regenerate files from swagger.yaml

parent 028bd670
No related branches found
No related tags found
1 merge request!4Feature/add arbor support
import connexion
import six
from access_node.models.arbor_measurement import ArborMeasurement # noqa: E501
from access_node.models.arbor_neuron_properties import ArborNeuronProperties # noqa: E501
from access_node.models.simulation_time_info import SimulationTimeInfo # noqa: E501
from access_node.models.spikes import Spikes # noqa: E501
from access_node import util
def arbor_get_attributes(): # noqa: E501
"""Retrieves a list of measurable attributes
# noqa: E501
:rtype: List[str]
"""
return 'do some magic!'
def arbor_get_measurements(attribute, _from=None, to=None, neuron_ids=None, offset=None, limit=None): # noqa: E501
"""Retrieves the measurements for given attribute and neuron_ids (optional).
# noqa: E501
:param attribute: The attribute to query (e.g., 'V_m' for the membrane potential)
:type attribute: str
:param _from: The start time (including) to be queried.
:type _from: float
:param to: The end time (excluding) to be queried.
:type to: float
:param neuron_ids: A list of GIDs queried for spike data.
:type neuron_ids: List[int]
:param offset: The offset into the result.
:type offset: int
:param limit: The maximum of entries to be result.
:type limit: int
:rtype: ArborMeasurement
"""
return 'do some magic!'
def arbor_get_neuron_ids(): # noqa: E501
"""Retrieves the list of all neuron ids.
# noqa: E501
:rtype: List[int]
"""
return 'do some magic!'
def arbor_get_neuron_properties(neuron_ids=None): # noqa: E501
"""Retrieves the properties of the specified neurons.
# noqa: E501
:param neuron_ids: A list of neuron IDs queried for properties.
:type neuron_ids: List[int]
:rtype: List[ArborNeuronProperties]
"""
return 'do some magic!'
def arbor_get_simulation_time_info(): # noqa: E501
"""Retrieves simulation time information.
# noqa: E501
:rtype: SimulationTimeInfo
"""
return 'do some magic!'
def arbor_get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501
"""Retrieves the spikes for the given simulation steps (optional) and GIDS (optional).
# noqa: E501
:param _from: The start time (including) to be queried.
:type _from: float
:param to: The end time (excluding) to be queried.
:type to: float
:param gids: A list of GIDs queried for spike data.
:type gids: List[int]
:param offset: The offset into the result.
:type offset: int
:param limit: The maximum of entries to be result.
:type limit: int
:rtype: Spikes
"""
return 'do some magic!'
import connexion
import six
from access_node.models.neuron_properties import NeuronProperties # noqa: E501
from access_node.models.multimeter_info import MultimeterInfo # noqa: E501
from access_node.models.multimeter_measurement import MultimeterMeasurement # noqa: E501
from access_node.models.nest_neuron_properties import NestNeuronProperties # noqa: E501
from access_node.models.simulation_time_info import SimulationTimeInfo # noqa: E501
from access_node.models.spikes import Spikes # noqa: E501
from access_node import util
......@@ -9,8 +11,7 @@ from access_node import util
from access_node.models.nodes import nodes
import requests
def get_gids(): # noqa: E501
def nest_get_gids(): # noqa: E501
"""Retrieves the list of all GID.
# noqa: E501
......@@ -22,7 +23,7 @@ def get_gids(): # noqa: E501
return gids
def get_gids_in_population(population_id): # noqa: E501
def nest_get_gids_in_population(population_id): # noqa: E501
"""Retrieves the list of all neuron IDs.
# noqa: E501
......@@ -37,7 +38,43 @@ def get_gids_in_population(population_id): # noqa: E501
return gids
def get_neuron_properties(gids=None): # noqa: E501
def nest_get_multimeter_info(): # noqa: E501
"""Retrieves the measurements for a multimeter (optional) and GIDS (optional).
# noqa: E501
:rtype: MultimeterInfo
"""
return 'do some magic!'
def nest_get_multimeter_measurements(multimeter_id, attribute, _from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501
"""Retrieves the measurements for a multimeter (optional) and GIDS (optional).
# noqa: E501
:param multimeter_id: The multimeter to query
:type multimeter_id:
:param attribute: The attribute to query (e.g., 'V_m' for the membrane potential)
:type attribute: str
:param _from: The start time (including) to be queried.
:type _from: float
:param to: The end time (excluding) to be queried.
:type to: float
:param gids: A list of GIDs queried for spike data.
:type gids: List[int]
:param offset: The offset into the result.
:type offset: int
:param limit: The maximum of entries to be result.
:type limit: int
:rtype: MultimeterMeasurement
"""
return 'do some magic!'
def nest_get_neuron_properties(gids=None): # noqa: E501
"""Retrieves the properties of the specified neurons.
# noqa: E501
......@@ -45,13 +82,13 @@ def get_neuron_properties(gids=None): # noqa: E501
:param gids: A list of GIDs queried for properties.
:type gids: List[int]
:rtype: List[NeuronProperties]
:rtype: List[NestNeuronProperties]
"""
properties = requests.get(nodes.info_node+'/neuron_properties').json()
return properties
def get_populations(): # noqa: E501
def nest_get_populations(): # noqa: E501
"""Retrieves the list of all population IDs.
# noqa: E501
......@@ -63,7 +100,7 @@ def get_populations(): # noqa: E501
return populations
def get_simulation_time_info(): # noqa: E501
def nest_get_simulation_time_info(): # noqa: E501
"""Retrieves simulation time information.
# noqa: E501
......@@ -75,7 +112,7 @@ def get_simulation_time_info(): # noqa: E501
return time_info
def get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501
def nest_get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501
"""Retrieves the spikes for the given simulation steps (optional) and GIDS (optional).
# noqa: E501
......@@ -118,7 +155,7 @@ def get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa
return spikes
def get_spikes_by_population(population_id, _from=None, to=None, offset=None, limit=None): # noqa: E501
def nest_get_spikes_by_population(population_id, _from=None, to=None, offset=None, limit=None): # noqa: E501
"""Retrieves the spikes for the given simulation steps (optional) and population.
# noqa: E501
......
......@@ -3,6 +3,11 @@
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from access_node.models.neuron_properties import NeuronProperties
from access_node.models.arbor_measurement import ArborMeasurement
from access_node.models.arbor_neuron_properties import ArborNeuronProperties
from access_node.models.multimeter_info import MultimeterInfo
from access_node.models.multimeter_info_inner import MultimeterInfoInner
from access_node.models.multimeter_measurement import MultimeterMeasurement
from access_node.models.nest_neuron_properties import NestNeuronProperties
from access_node.models.simulation_time_info import SimulationTimeInfo
from access_node.models.spikes import Spikes
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node import util
class ArborMeasurement(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, simulation_times: List[float]=None, gids: List[int]=None, values: List[float]=None): # noqa: E501
"""ArborMeasurement - a model defined in Swagger
:param simulation_times: The simulation_times of this ArborMeasurement. # noqa: E501
:type simulation_times: List[float]
:param gids: The gids of this ArborMeasurement. # noqa: E501
:type gids: List[int]
:param values: The values of this ArborMeasurement. # noqa: E501
:type values: List[float]
"""
self.swagger_types = {
'simulation_times': List[float],
'gids': List[int],
'values': List[float]
}
self.attribute_map = {
'simulation_times': 'simulation_times',
'gids': 'gids',
'values': 'values'
}
self._simulation_times = simulation_times
self._gids = gids
self._values = values
@classmethod
def from_dict(cls, dikt) -> 'ArborMeasurement':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The ArborMeasurement of this ArborMeasurement. # noqa: E501
:rtype: ArborMeasurement
"""
return util.deserialize_model(dikt, cls)
@property
def simulation_times(self) -> List[float]:
"""Gets the simulation_times of this ArborMeasurement.
This array is always sorted. # noqa: E501
:return: The simulation_times of this ArborMeasurement.
:rtype: List[float]
"""
return self._simulation_times
@simulation_times.setter
def simulation_times(self, simulation_times: List[float]):
"""Sets the simulation_times of this ArborMeasurement.
This array is always sorted. # noqa: E501
:param simulation_times: The simulation_times of this ArborMeasurement.
:type simulation_times: List[float]
"""
self._simulation_times = simulation_times
@property
def gids(self) -> List[int]:
"""Gets the gids of this ArborMeasurement.
:return: The gids of this ArborMeasurement.
:rtype: List[int]
"""
return self._gids
@gids.setter
def gids(self, gids: List[int]):
"""Sets the gids of this ArborMeasurement.
:param gids: The gids of this ArborMeasurement.
:type gids: List[int]
"""
self._gids = gids
@property
def values(self) -> List[float]:
"""Gets the values of this ArborMeasurement.
This array contains the measured values for each gid and time to get the value for gid n at time t you have to use the index n * length(simulation_times) + t # noqa: E501
:return: The values of this ArborMeasurement.
:rtype: List[float]
"""
return self._values
@values.setter
def values(self, values: List[float]):
"""Sets the values of this ArborMeasurement.
This array contains the measured values for each gid and time to get the value for gid n at time t you have to use the index n * length(simulation_times) + t # noqa: E501
:param values: The values of this ArborMeasurement.
:type values: List[float]
"""
self._values = values
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node import util
class ArborNeuronProperties(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, neuron_id: int=None, properties: object=None): # noqa: E501
"""ArborNeuronProperties - a model defined in Swagger
:param neuron_id: The neuron_id of this ArborNeuronProperties. # noqa: E501
:type neuron_id: int
:param properties: The properties of this ArborNeuronProperties. # noqa: E501
:type properties: object
"""
self.swagger_types = {
'neuron_id': int,
'properties': object
}
self.attribute_map = {
'neuron_id': 'neuron_id',
'properties': 'properties'
}
self._neuron_id = neuron_id
self._properties = properties
@classmethod
def from_dict(cls, dikt) -> 'ArborNeuronProperties':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The ArborNeuronProperties of this ArborNeuronProperties. # noqa: E501
:rtype: ArborNeuronProperties
"""
return util.deserialize_model(dikt, cls)
@property
def neuron_id(self) -> int:
"""Gets the neuron_id of this ArborNeuronProperties.
:return: The neuron_id of this ArborNeuronProperties.
:rtype: int
"""
return self._neuron_id
@neuron_id.setter
def neuron_id(self, neuron_id: int):
"""Sets the neuron_id of this ArborNeuronProperties.
:param neuron_id: The neuron_id of this ArborNeuronProperties.
:type neuron_id: int
"""
self._neuron_id = neuron_id
@property
def properties(self) -> object:
"""Gets the properties of this ArborNeuronProperties.
:return: The properties of this ArborNeuronProperties.
:rtype: object
"""
return self._properties
@properties.setter
def properties(self, properties: object):
"""Sets the properties of this ArborNeuronProperties.
:param properties: The properties of this ArborNeuronProperties.
:type properties: object
"""
self._properties = properties
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node.models.multimeter_info_inner import MultimeterInfoInner # noqa: F401,E501
from access_node import util
class MultimeterInfo(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self): # noqa: E501
"""MultimeterInfo - a model defined in Swagger
"""
self.swagger_types = {
}
self.attribute_map = {
}
@classmethod
def from_dict(cls, dikt) -> 'MultimeterInfo':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The MultimeterInfo of this MultimeterInfo. # noqa: E501
:rtype: MultimeterInfo
"""
return util.deserialize_model(dikt, cls)
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node import util
class MultimeterInfoInner(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, id: int=None, attributes: List[str]=None, gids: List[int]=None): # noqa: E501
"""MultimeterInfoInner - a model defined in Swagger
:param id: The id of this MultimeterInfoInner. # noqa: E501
:type id: int
:param attributes: The attributes of this MultimeterInfoInner. # noqa: E501
:type attributes: List[str]
:param gids: The gids of this MultimeterInfoInner. # noqa: E501
:type gids: List[int]
"""
self.swagger_types = {
'id': int,
'attributes': List[str],
'gids': List[int]
}
self.attribute_map = {
'id': 'id',
'attributes': 'attributes',
'gids': 'gids'
}
self._id = id
self._attributes = attributes
self._gids = gids
@classmethod
def from_dict(cls, dikt) -> 'MultimeterInfoInner':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The MultimeterInfo_inner of this MultimeterInfoInner. # noqa: E501
:rtype: MultimeterInfoInner
"""
return util.deserialize_model(dikt, cls)
@property
def id(self) -> int:
"""Gets the id of this MultimeterInfoInner.
:return: The id of this MultimeterInfoInner.
:rtype: int
"""
return self._id
@id.setter
def id(self, id: int):
"""Sets the id of this MultimeterInfoInner.
:param id: The id of this MultimeterInfoInner.
:type id: int
"""
self._id = id
@property
def attributes(self) -> List[str]:
"""Gets the attributes of this MultimeterInfoInner.
:return: The attributes of this MultimeterInfoInner.
:rtype: List[str]
"""
return self._attributes
@attributes.setter
def attributes(self, attributes: List[str]):
"""Sets the attributes of this MultimeterInfoInner.
:param attributes: The attributes of this MultimeterInfoInner.
:type attributes: List[str]
"""
self._attributes = attributes
@property
def gids(self) -> List[int]:
"""Gets the gids of this MultimeterInfoInner.
:return: The gids of this MultimeterInfoInner.
:rtype: List[int]
"""
return self._gids
@gids.setter
def gids(self, gids: List[int]):
"""Sets the gids of this MultimeterInfoInner.
:param gids: The gids of this MultimeterInfoInner.
:type gids: List[int]
"""
self._gids = gids
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node import util
class MultimeterMeasurement(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, simulation_times: List[float]=None, gids: List[int]=None, values: List[float]=None): # noqa: E501
"""MultimeterMeasurement - a model defined in Swagger
:param simulation_times: The simulation_times of this MultimeterMeasurement. # noqa: E501
:type simulation_times: List[float]
:param gids: The gids of this MultimeterMeasurement. # noqa: E501
:type gids: List[int]
:param values: The values of this MultimeterMeasurement. # noqa: E501
:type values: List[float]
"""
self.swagger_types = {
'simulation_times': List[float],
'gids': List[int],
'values': List[float]
}
self.attribute_map = {
'simulation_times': 'simulation_times',
'gids': 'gids',
'values': 'values'
}
self._simulation_times = simulation_times
self._gids = gids
self._values = values
@classmethod
def from_dict(cls, dikt) -> 'MultimeterMeasurement':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The MultimeterMeasurement of this MultimeterMeasurement. # noqa: E501
:rtype: MultimeterMeasurement
"""
return util.deserialize_model(dikt, cls)
@property
def simulation_times(self) -> List[float]:
"""Gets the simulation_times of this MultimeterMeasurement.
This array is always sorted. # noqa: E501
:return: The simulation_times of this MultimeterMeasurement.
:rtype: List[float]
"""
return self._simulation_times
@simulation_times.setter
def simulation_times(self, simulation_times: List[float]):
"""Sets the simulation_times of this MultimeterMeasurement.
This array is always sorted. # noqa: E501
:param simulation_times: The simulation_times of this MultimeterMeasurement.
:type simulation_times: List[float]
"""
self._simulation_times = simulation_times
@property
def gids(self) -> List[int]:
"""Gets the gids of this MultimeterMeasurement.
:return: The gids of this MultimeterMeasurement.
:rtype: List[int]
"""
return self._gids
@gids.setter
def gids(self, gids: List[int]):
"""Sets the gids of this MultimeterMeasurement.
:param gids: The gids of this MultimeterMeasurement.
:type gids: List[int]
"""
self._gids = gids
@property
def values(self) -> List[float]:
"""Gets the values of this MultimeterMeasurement.
This array contains the measured values for each gid and time to get the value for gid n at time t you have to use the index n * length(simulation_times) + t # noqa: E501
:return: The values of this MultimeterMeasurement.
:rtype: List[float]
"""
return self._values
@values.setter
def values(self, values: List[float]):
"""Sets the values of this MultimeterMeasurement.
This array contains the measured values for each gid and time to get the value for gid n at time t you have to use the index n * length(simulation_times) + t # noqa: E501
:param values: The values of this MultimeterMeasurement.
:type values: List[float]
"""
self._values = values
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node import util
class NestNeuronProperties(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, gid: int=None, properties: object=None): # noqa: E501
"""NestNeuronProperties - a model defined in Swagger
:param gid: The gid of this NestNeuronProperties. # noqa: E501
:type gid: int
:param properties: The properties of this NestNeuronProperties. # noqa: E501
:type properties: object
"""
self.swagger_types = {
'gid': int,
'properties': object
}
self.attribute_map = {
'gid': 'gid',
'properties': 'properties'
}
self._gid = gid
self._properties = properties
@classmethod
def from_dict(cls, dikt) -> 'NestNeuronProperties':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The NestNeuronProperties of this NestNeuronProperties. # noqa: E501
:rtype: NestNeuronProperties
"""
return util.deserialize_model(dikt, cls)
@property
def gid(self) -> int:
"""Gets the gid of this NestNeuronProperties.
:return: The gid of this NestNeuronProperties.
:rtype: int
"""
return self._gid
@gid.setter
def gid(self, gid: int):
"""Sets the gid of this NestNeuronProperties.
:param gid: The gid of this NestNeuronProperties.
:type gid: int
"""
self._gid = gid
@property
def properties(self) -> object:
"""Gets the properties of this NestNeuronProperties.
:return: The properties of this NestNeuronProperties.
:rtype: object
"""
return self._properties
@properties.setter
def properties(self, properties: object):
"""Sets the properties of this NestNeuronProperties.
:param properties: The properties of this NestNeuronProperties.
:type properties: object
"""
self._properties = properties
# coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from access_node.models.arbor_measurement import ArborMeasurement # noqa: E501
from access_node.models.arbor_neuron_properties import ArborNeuronProperties # noqa: E501
from access_node.models.simulation_time_info import SimulationTimeInfo # noqa: E501
from access_node.models.spikes import Spikes # noqa: E501
from access_node.test import BaseTestCase
class TestArborController(BaseTestCase):
"""ArborController integration test stubs"""
def test_arbor_get_attributes(self):
"""Test case for arbor_get_attributes
Retrieves a list of measurable attributes
"""
response = self.client.open(
'//arbor/attributes',
method='GET')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_arbor_get_measurements(self):
"""Test case for arbor_get_measurements
Retrieves the measurements for given attribute and neuron_ids (optional).
"""
query_string = [('attribute', 'attribute_example'),
('_from', 1.2),
('to', 1.2),
('neuron_ids', 56),
('offset', 56),
('limit', 56)]
response = self.client.open(
'//arbor/measurements',
method='GET',
content_type='application/json',
query_string=query_string)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_arbor_get_neuron_ids(self):
"""Test case for arbor_get_neuron_ids
Retrieves the list of all neuron ids.
"""
response = self.client.open(
'//arbor/neuron_ids',
method='GET')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_arbor_get_neuron_properties(self):
"""Test case for arbor_get_neuron_properties
Retrieves the properties of the specified neurons.
"""
query_string = [('neuron_ids', 56)]
response = self.client.open(
'//arbor/neuron_properties',
method='GET',
query_string=query_string)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_arbor_get_simulation_time_info(self):
"""Test case for arbor_get_simulation_time_info
Retrieves simulation time information.
"""
response = self.client.open(
'//arbor/simulation_time_info',
method='GET')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_arbor_get_spikes(self):
"""Test case for arbor_get_spikes
Retrieves the spikes for the given simulation steps (optional) and GIDS (optional).
"""
query_string = [('_from', 1.2),
('to', 1.2),
('gids', 56),
('offset', 56),
('limit', 56)]
response = self.client.open(
'//arbor/spikes',
method='GET',
content_type='application/json',
query_string=query_string)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
if __name__ == '__main__':
import unittest
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment