From 2b741a155bd0fb3c03e9e3d1921c653d27411de2 Mon Sep 17 00:00:00 2001 From: Joni Herttuainen Date: Mon, 11 Mar 2024 14:42:40 +0100 Subject: [PATCH] Create aliases for '{a,e}fferent_{edges,nodes}' --- bluepysnap/edges/edge_population.py | 6 ++++++ bluepysnap/edges/edges.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/bluepysnap/edges/edge_population.py b/bluepysnap/edges/edge_population.py index c7cdf05d..fe131715 100644 --- a/bluepysnap/edges/edge_population.py +++ b/bluepysnap/edges/edge_population.py @@ -627,6 +627,12 @@ def spatial_synapse_index(self): raise BluepySnapError(f"It appears {self.name} does not have synapse indices") return open_index(index_dir) + # ALIASES + edges_by_source = efferent_edges + edges_by_target = afferent_edges + target_nodes_by_source = efferent_nodes + source_nodes_by_target = afferent_nodes + def __getstate__(self): """Make EdgePopulation pickle-able, without storing state of caches.""" return self._circuit, self.name diff --git a/bluepysnap/edges/edges.py b/bluepysnap/edges/edges.py index 6140b337..2bcff28a 100644 --- a/bluepysnap/edges/edges.py +++ b/bluepysnap/edges/edges.py @@ -250,6 +250,12 @@ def iter_connections( return_edge_count=return_edge_count, ) + # ALIASES + edges_by_source = efferent_edges + edges_by_target = afferent_edges + target_nodes_by_source = efferent_nodes + source_nodes_by_target = afferent_nodes + def __getstate__(self): """Make Edges pickle-able, without storing state of caches.""" return self._circuit