diff --git a/bluepysnap/edges/edges.py b/bluepysnap/edges/edges.py index 8d5858b6..88ad2cc1 100644 --- a/bluepysnap/edges/edges.py +++ b/bluepysnap/edges/edges.py @@ -82,11 +82,9 @@ def ids(self, group=None, sample=None, limit=None): fun = lambda x: (x.ids(group), x.name) return self._get_ids_from_pop(fun, CircuitEdgeIds, sample=sample, limit=limit) - def get(self, - edge_ids=None, - properties=None, - include_empty=False - ): # pylint: disable=arguments-renamed + def get( + self, edge_ids=None, properties=None, include_empty=False + ): # pylint: disable=arguments-renamed """Edge properties by iterating populations. Args: @@ -152,13 +150,7 @@ def efferent_nodes(self, source, unique=True): result.unique(inplace=True) return result - def pathway_edges( - self, - source=None, - target=None, - properties=None, - include_empty=False - ): + def pathway_edges(self, source=None, target=None, properties=None, include_empty=False): """Get edges corresponding to ``source`` -> ``target`` connections. Args: diff --git a/bluepysnap/nodes/nodes.py b/bluepysnap/nodes/nodes.py index 6d80ffde..e8caff2b 100644 --- a/bluepysnap/nodes/nodes.py +++ b/bluepysnap/nodes/nodes.py @@ -120,7 +120,9 @@ def ids(self, group=None, sample=None, limit=None): fun = lambda x: (x.ids(group, raise_missing_property=False), x.name) return self._get_ids_from_pop(fun, CircuitNodeIds, sample=sample, limit=limit) - def get(self, group=None, properties=None, include_empty=False): # pylint: disable=arguments-differ + def get( + self, group=None, properties=None, include_empty=False + ): # pylint: disable=arguments-differ """Node properties by iterating populations. Args: @@ -130,7 +132,7 @@ def get(self, group=None, properties=None, include_empty=False): # pylint: disa properties (str/list): If specified, return only the properties in the list. Otherwise return all properties. - + include_empty: whether to include populations for which the query is empty Returns: diff --git a/tests/test_edges.py b/tests/test_edges.py index 36e2a687..7d016788 100644 --- a/tests/test_edges.py +++ b/tests/test_edges.py @@ -473,10 +473,7 @@ def test_pathway_edges(self): ) # check that 'include_empty' kwarg works - tested = self.test_obj.pathway_edges( - source=[1], - properties=properties, - include_empty=True) + tested = self.test_obj.pathway_edges(source=[1], properties=properties, include_empty=True) expected = pd.DataFrame( {prop: [] for prop in properties}, diff --git a/tests/test_nodes.py b/tests/test_nodes.py index 93cee76e..ef97bfba 100644 --- a/tests/test_nodes.py +++ b/tests/test_nodes.py @@ -365,25 +365,19 @@ def test_get(self): with pytest.raises(BluepySnapError, match="Unknown properties required: {'unknown'}"): next(self.test_obj.get(properties="unknown")) - - tested = pd.concat([ - df for _, df in self.test_obj.get({'layer': 10}, include_empty=True) - ]) + + tested = pd.concat([df for _, df in self.test_obj.get({"layer": 10}, include_empty=True)]) expected = pd.DataFrame( {p: [] for p in list(self.test_obj.property_names)}, - index=pd.MultiIndex.from_tuples( - [], - names=["population", "node_ids"] - ) + index=pd.MultiIndex.from_tuples([], names=["population", "node_ids"]), ) pdt.assert_frame_equal( - tested.sort_index(axis=1), - expected.sort_index(axis=1), - check_dtype=False, - check_index_type=False + tested.sort_index(axis=1), + expected.sort_index(axis=1), + check_dtype=False, + check_index_type=False, ) - def test_functionality_with_separate_node_set(self): with pytest.raises(BluepySnapError, match="Undefined node set"): self.test_obj.ids("ExtraLayer2")