diff --git a/info_node/controllers/arbor_controller.py b/info_node/controllers/arbor_controller.py index 807238937441f0abb2c2290c4debf5f22405213f..9d375b0bca451316b48e7892345d3eb3e18088ce 100644 --- a/info_node/controllers/arbor_controller.py +++ b/info_node/controllers/arbor_controller.py @@ -1,14 +1,15 @@ import connexion import six -from info_node.models.arbor_neuron_properties import ArborNeuronProperties # noqa: E501 +from info_node.models.arbor_cell_properties import ArborCellProperties # noqa: E501 +from info_node.models.probe import Probe # noqa: E501 from info_node.models.simulation_time_info import SimulationTimeInfo # noqa: E501 from info_node.models.status import Status # noqa: E501 from info_node import util def arbor_get_attributes(): # noqa: E501 - """Retrieves a list of measurable attributes + """Retrieves the list of all attributes. # noqa: E501 @@ -18,8 +19,8 @@ def arbor_get_attributes(): # noqa: E501 return 'do some magic!' -def arbor_get_neuron_ids(): # noqa: E501 - """Retrieves the list of all neuron IDs. +def arbor_get_cell_ids(): # noqa: E501 + """Retrieves the list of all cell IDs. # noqa: E501 @@ -29,15 +30,28 @@ def arbor_get_neuron_ids(): # noqa: E501 return 'do some magic!' -def arbor_get_neuron_properties(gids=None): # noqa: E501 +def arbor_get_cell_properties(cell_ids=None): # noqa: E501 """Retrieves the properties of the specified neurons. # noqa: E501 - :param gids: A list of neuron IDs queried for properties. - :type gids: List[int] + :param cell_ids: A list of cell IDs queried for properties. + :type cell_ids: List[int] - :rtype: List[ArborNeuronProperties] + :rtype: List[ArborCellProperties] + """ + return 'do some magic!' + + +def arbor_get_probes(attribute=None): # noqa: E501 + """Retrieves the list of all probes for a given attribute (optional). + + # noqa: E501 + + :param attribute: The attribute measured for which existing probes will be returned. + :type attribute: str + + :rtype: List[Probe] """ return 'do some magic!' @@ -53,26 +67,47 @@ def arbor_get_simulation_time_info(): # noqa: E501 return 'do some magic!' -def arbor_put_attributes(attributes=None): # noqa: E501 - """Puts the available attributes +def arbor_put_attributes(attributes): # noqa: E501 + """Registers attributes. # noqa: E501 - :param attributes: - :type attributes: List[str] + :param attributes: A list of attributes. + :type attributes: List[] + + :rtype: Status + """ + return 'do some magic!' + + +def arbor_put_cell_ids(cell_ids, address): # noqa: E501 + """Registers a cell by ID. + + # noqa: E501 + + :param cell_ids: + :type cell_ids: List[int] + :param address: Address of the node. + :type address: str :rtype: Status """ return 'do some magic!' -def arbor_put_neuron_ids(gids, address): # noqa: E501 - """Registers a neuron by ID. +def arbor_put_probe(probe_ids, cell_ids, segment_ids, positions, address=None): # noqa: E501 + """Registers probes. # noqa: E501 - :param gids: - :type gids: List[int] + :param probe_ids: + :type probe_ids: List[int] + :param cell_ids: + :type cell_ids: List[int] + :param segment_ids: + :type segment_ids: List[int] + :param positions: + :type positions: List[float] :param address: Address of the node. :type address: str @@ -96,18 +131,18 @@ def arbor_put_time(time, node_address): # noqa: E501 return 'do some magic!' -def arbor_set_neuron_properties(properties): # noqa: E501 - """Sends the properties of the specified neurons. +def arbor_set_cell_properties(properties): # noqa: E501 + """Sends the properties of the specified cells. # noqa: E501 - :param properties: A list of neuron IDs queried for properties. + :param properties: A list of cell properties. :type properties: list | bytes :rtype: Status """ if connexion.request.is_json: - properties = [ArborNeuronProperties.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 + properties = [ArborCellProperties.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 return 'do some magic!' diff --git a/info_node/models/__init__.py b/info_node/models/__init__.py index 43105514439041df06b1edb9e7bdfb0657b93fa8..31f3672569e7f8ca5711d6a51bc37ad77a50bc74 100644 --- a/info_node/models/__init__.py +++ b/info_node/models/__init__.py @@ -3,9 +3,10 @@ # flake8: noqa from __future__ import absolute_import # import models into model package -from info_node.models.arbor_neuron_properties import ArborNeuronProperties +from info_node.models.arbor_cell_properties import ArborCellProperties from info_node.models.multimeter_info import MultimeterInfo from info_node.models.multimeter_info_inner import MultimeterInfoInner from info_node.models.nest_neuron_properties import NestNeuronProperties +from info_node.models.probe import Probe from info_node.models.simulation_time_info import SimulationTimeInfo from info_node.models.status import Status diff --git a/info_node/models/arbor_cell_properties.py b/info_node/models/arbor_cell_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..e74ef49a5036c09e8bb47d0ef0d379b63d46d6ab --- /dev/null +++ b/info_node/models/arbor_cell_properties.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from info_node.models.base_model_ import Model +from info_node import util + + +class ArborCellProperties(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 + """ArborCellProperties - a model defined in Swagger + + :param gid: The gid of this ArborCellProperties. # noqa: E501 + :type gid: int + :param properties: The properties of this ArborCellProperties. # 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) -> 'ArborCellProperties': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ArborCellProperties of this ArborCellProperties. # noqa: E501 + :rtype: ArborCellProperties + """ + return util.deserialize_model(dikt, cls) + + @property + def gid(self) -> int: + """Gets the gid of this ArborCellProperties. + + + :return: The gid of this ArborCellProperties. + :rtype: int + """ + return self._gid + + @gid.setter + def gid(self, gid: int): + """Sets the gid of this ArborCellProperties. + + + :param gid: The gid of this ArborCellProperties. + :type gid: int + """ + + self._gid = gid + + @property + def properties(self) -> object: + """Gets the properties of this ArborCellProperties. + + + :return: The properties of this ArborCellProperties. + :rtype: object + """ + return self._properties + + @properties.setter + def properties(self, properties: object): + """Sets the properties of this ArborCellProperties. + + + :param properties: The properties of this ArborCellProperties. + :type properties: object + """ + + self._properties = properties diff --git a/info_node/models/probe.py b/info_node/models/probe.py new file mode 100644 index 0000000000000000000000000000000000000000..222a3a4907405217afc48e8ff0af017f3d339886 --- /dev/null +++ b/info_node/models/probe.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from info_node.models.base_model_ import Model +from info_node import util + + +class Probe(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, cell_id: int=None, segment_id: int=None, position: float=None): # noqa: E501 + """Probe - a model defined in Swagger + + :param id: The id of this Probe. # noqa: E501 + :type id: int + :param cell_id: The cell_id of this Probe. # noqa: E501 + :type cell_id: int + :param segment_id: The segment_id of this Probe. # noqa: E501 + :type segment_id: int + :param position: The position of this Probe. # noqa: E501 + :type position: float + """ + self.swagger_types = { + 'id': int, + 'cell_id': int, + 'segment_id': int, + 'position': float + } + + self.attribute_map = { + 'id': 'id', + 'cell_id': 'cell_id', + 'segment_id': 'segment_id', + 'position': 'position' + } + + self._id = id + self._cell_id = cell_id + self._segment_id = segment_id + self._position = position + + @classmethod + def from_dict(cls, dikt) -> 'Probe': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Probe of this Probe. # noqa: E501 + :rtype: Probe + """ + return util.deserialize_model(dikt, cls) + + @property + def id(self) -> int: + """Gets the id of this Probe. + + + :return: The id of this Probe. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id: int): + """Sets the id of this Probe. + + + :param id: The id of this Probe. + :type id: int + """ + + self._id = id + + @property + def cell_id(self) -> int: + """Gets the cell_id of this Probe. + + + :return: The cell_id of this Probe. + :rtype: int + """ + return self._cell_id + + @cell_id.setter + def cell_id(self, cell_id: int): + """Sets the cell_id of this Probe. + + + :param cell_id: The cell_id of this Probe. + :type cell_id: int + """ + + self._cell_id = cell_id + + @property + def segment_id(self) -> int: + """Gets the segment_id of this Probe. + + + :return: The segment_id of this Probe. + :rtype: int + """ + return self._segment_id + + @segment_id.setter + def segment_id(self, segment_id: int): + """Sets the segment_id of this Probe. + + + :param segment_id: The segment_id of this Probe. + :type segment_id: int + """ + + self._segment_id = segment_id + + @property + def position(self) -> float: + """Gets the position of this Probe. + + + :return: The position of this Probe. + :rtype: float + """ + return self._position + + @position.setter + def position(self, position: float): + """Sets the position of this Probe. + + + :param position: The position of this Probe. + :type position: float + """ + + self._position = position diff --git a/info_node/swagger/swagger.yaml b/info_node/swagger/swagger.yaml index eb5cb42c5a7b1279d5fc6b7e3bce5605320cdc2c..00f931d2bc2fdaa52216f4bb9a87e657f53ec378 100644 --- a/info_node/swagger/swagger.yaml +++ b/info_node/swagger/swagger.yaml @@ -216,8 +216,8 @@ paths: items: type: "string" example: - - "Voltage" - - "Current" + - "Voltage" + - "Current" 400: description: "Operation failed." schema: diff --git a/requirements.txt b/requirements.txt index ceb03e66156965778e65d1d085b99f39e5eeb6b8..5fc55ba75b9b9d7121da019910b0f4e599e88d3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -connexion == 1.1.15 +connexion == 2.6.0 python_dateutil == 2.6.0 setuptools >= 21.0.0 pandas