From 0f1f5ed5d37031d9d5b3fa8c9b1ba14bb88f6a78 Mon Sep 17 00:00:00 2001 From: Joni Herttuainen Date: Wed, 18 Oct 2023 17:34:23 +0200 Subject: [PATCH 1/3] Fix docstrings: Nodes.get, Edges.get --- bluepysnap/edges/edges.py | 6 +++--- bluepysnap/nodes/nodes.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bluepysnap/edges/edges.py b/bluepysnap/edges/edges.py index 276d083f..a9e23f20 100644 --- a/bluepysnap/edges/edges.py +++ b/bluepysnap/edges/edges.py @@ -90,9 +90,9 @@ def get(self, edge_ids=None, properties=None): # pylint: disable=arguments-rena If set to None ids are returned. Returns: - pandas.Series/pandas.DataFrame: - - A pandas Series indexed by edge IDs if ``properties`` is scalar. - - A pandas DataFrame indexed by edge IDs if ``properties`` is list. + generator: yields tuples of ``(, pandas.DataFrame|pandas.Series)``: + - Series indexed by edge IDs if ``properties`` is scalar. + - DataFrame indexed by edge IDs if ``properties`` is list. Notes: The Edges.property_names function will give you all the usable properties diff --git a/bluepysnap/nodes/nodes.py b/bluepysnap/nodes/nodes.py index 146afdb4..d0157dcf 100644 --- a/bluepysnap/nodes/nodes.py +++ b/bluepysnap/nodes/nodes.py @@ -132,8 +132,8 @@ def get(self, group=None, properties=None): # pylint: disable=arguments-differ Otherwise return all properties. Returns: - pandas.DataFrame: Return a pandas DataFrame indexed by NodeCircuitIds containing the - properties from ``properties``. + generator: yields tuples of ``(, pandas.DataFrame)``: + - DataFrame indexed by NodeCircuitIds containing the properties from ``properties``. Notes: The NodePopulation.property_names function will give you all the usable properties From 7bc54c8b72eaa2418bd6be710ce13a93575aadd4 Mon Sep 17 00:00:00 2001 From: Joni Herttuainen Date: Wed, 18 Oct 2023 17:57:44 +0200 Subject: [PATCH 2/3] Further clarify docstring --- bluepysnap/edges/edges.py | 2 +- bluepysnap/nodes/nodes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bluepysnap/edges/edges.py b/bluepysnap/edges/edges.py index a9e23f20..0313e4d4 100644 --- a/bluepysnap/edges/edges.py +++ b/bluepysnap/edges/edges.py @@ -82,7 +82,7 @@ def ids(self, group=None, sample=None, limit=None): return self._get_ids_from_pop(fun, CircuitEdgeIds, sample=sample, limit=limit) def get(self, edge_ids=None, properties=None): # pylint: disable=arguments-renamed - """Edge properties as pandas DataFrame. + """Edge properties by iterating populations. Args: edge_ids (int/CircuitEdgeId/CircuitEdgeIds/sequence): same as Edges.ids(). diff --git a/bluepysnap/nodes/nodes.py b/bluepysnap/nodes/nodes.py index d0157dcf..5883cb30 100644 --- a/bluepysnap/nodes/nodes.py +++ b/bluepysnap/nodes/nodes.py @@ -121,7 +121,7 @@ def ids(self, group=None, sample=None, limit=None): return self._get_ids_from_pop(fun, CircuitNodeIds, sample=sample, limit=limit) def get(self, group=None, properties=None): # pylint: disable=arguments-differ - """Node properties as a pandas DataFrame. + """Node properties by iterating populations. Args: group (CircuitNodeIds/int/sequence/str/mapping/None): Which nodes will have their From 90447e5f1e175f3f5c1fd9b4cea04d6616af104f Mon Sep 17 00:00:00 2001 From: Joni Herttuainen Date: Thu, 19 Oct 2023 11:15:28 +0200 Subject: [PATCH 3/3] further fix docstrings: return value on Edges.get, typo on Nodes.get --- bluepysnap/edges/edges.py | 5 ++--- bluepysnap/nodes/nodes.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bluepysnap/edges/edges.py b/bluepysnap/edges/edges.py index 0313e4d4..17c0d243 100644 --- a/bluepysnap/edges/edges.py +++ b/bluepysnap/edges/edges.py @@ -90,9 +90,8 @@ def get(self, edge_ids=None, properties=None): # pylint: disable=arguments-rena If set to None ids are returned. Returns: - generator: yields tuples of ``(, pandas.DataFrame|pandas.Series)``: - - Series indexed by edge IDs if ``properties`` is scalar. - - DataFrame indexed by edge IDs if ``properties`` is list. + generator: yields tuples of ``(, pandas.DataFrame)``: + - DataFrame indexed by CircuitEdgeIds containing the properties from ``properties``. Notes: The Edges.property_names function will give you all the usable properties diff --git a/bluepysnap/nodes/nodes.py b/bluepysnap/nodes/nodes.py index 5883cb30..f97e00be 100644 --- a/bluepysnap/nodes/nodes.py +++ b/bluepysnap/nodes/nodes.py @@ -133,7 +133,7 @@ def get(self, group=None, properties=None): # pylint: disable=arguments-differ Returns: generator: yields tuples of ``(, pandas.DataFrame)``: - - DataFrame indexed by NodeCircuitIds containing the properties from ``properties``. + - DataFrame indexed by CircuitNodeIds containing the properties from ``properties``. Notes: The NodePopulation.property_names function will give you all the usable properties