diff --git a/neurax/modules/base.py b/neurax/modules/base.py index 593bf0cc..cd03922b 100644 --- a/neurax/modules/base.py +++ b/neurax/modules/base.py @@ -573,7 +573,7 @@ def show( self.view, channel_name, indices, params, states ) - def set_global_index_and_index(nodes): + def set_global_index_and_index(self, nodes): """Use the global compartment, branch, and cell index as the index.""" nodes = nodes.drop("controlled_by_param", axis=1) nodes = nodes.drop("comp_index", axis=1) diff --git a/neurax/modules/branch.py b/neurax/modules/branch.py index c179a580..9f31e321 100644 --- a/neurax/modules/branch.py +++ b/neurax/modules/branch.py @@ -60,9 +60,9 @@ def __getattr__(self, key): if key == "comp": view = deepcopy(self.nodes) - view["original_comp_index"] = view["comp_index"] - view["original_branch_index"] = view["branch_index"] - view["original_cell_index"] = view["cell_index"] + view["global_comp_index"] = view["comp_index"] + view["global_branch_index"] = view["branch_index"] + view["global_cell_index"] = view["cell_index"] return CompartmentView(self, view) elif key in self.group_views: return self.group_views[key] diff --git a/neurax/modules/cell.py b/neurax/modules/cell.py index 54bcbe0d..4c34ad65 100644 --- a/neurax/modules/cell.py +++ b/neurax/modules/cell.py @@ -85,9 +85,9 @@ def __getattr__(self, key): if key == "branch": view = deepcopy(self.nodes) - view["original_comp_index"] = view["comp_index"] - view["original_branch_index"] = view["branch_index"] - view["original_cell_index"] = view["cell_index"] + view["global_comp_index"] = view["comp_index"] + view["global_branch_index"] = view["branch_index"] + view["global_cell_index"] = view["cell_index"] return BranchView(self, view) elif key in self.group_views: return self.group_views[key] diff --git a/neurax/modules/network.py b/neurax/modules/network.py index d6c19a5b..7f78f29d 100644 --- a/neurax/modules/network.py +++ b/neurax/modules/network.py @@ -80,9 +80,9 @@ def __getattr__(self, key): if key == "cell": view = deepcopy(self.nodes) - view["original_comp_index"] = view["comp_index"] - view["original_branch_index"] = view["branch_index"] - view["original_cell_index"] = view["cell_index"] + view["global_comp_index"] = view["comp_index"] + view["global_branch_index"] = view["branch_index"] + view["global_cell_index"] = view["cell_index"] return CellView(self, view) elif key in self.synapse_names: return SynapseView(self, self.syn_edges, key) diff --git a/tutorials/01_small_network.ipynb b/tutorials/01_small_network.ipynb index 807a7e15..e737bf89 100644 --- a/tutorials/01_small_network.ipynb +++ b/tutorials/01_small_network.ipynb @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 58, "id": "0e225f21", "metadata": {}, "outputs": [], @@ -76,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 59, "id": "9b671afc", "metadata": {}, "outputs": [], @@ -94,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 60, "id": "9819bbf4", "metadata": {}, "outputs": [], @@ -105,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 61, "id": "e89ededa-18ed-4184-860d-93c59e653201", "metadata": {}, "outputs": [], @@ -135,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 62, "id": "70c241e7", "metadata": {}, "outputs": [], @@ -147,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 63, "id": "564e96a7", "metadata": {}, "outputs": [], @@ -165,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 64, "id": "22f304f0", "metadata": {}, "outputs": [ @@ -198,7 +198,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 65, "id": "e277f94b", "metadata": {}, "outputs": [], @@ -208,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 66, "id": "f2129ef3", "metadata": {}, "outputs": [], @@ -229,7 +229,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 67, "id": "1dffee93", "metadata": {}, "outputs": [], @@ -247,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 68, "id": "1c989a32", "metadata": {}, "outputs": [], @@ -265,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "d6d4d560", "metadata": {}, "outputs": [], @@ -288,16 +288,183 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 56, + "id": "ae789787-226f-463e-a3a0-b80a26026489", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + " | original_comp_index | \n", + "original_branch_index | \n", + "original_cell_index | \n", + "
---|---|---|---|
7 | \n", + "7 | \n", + "0 | \n", + "0 | \n", + "
127 | \n", + "127 | \n", + "15 | \n", + "1 | \n", + "
247 | \n", + "247 | \n", + "30 | \n", + "2 | \n", + "
367 | \n", + "367 | \n", + "45 | \n", + "3 | \n", + "
487 | \n", + "487 | \n", + "60 | \n", + "4 | \n", + "
607 | \n", + "607 | \n", + "75 | \n", + "5 | \n", + "
727 | \n", + "727 | \n", + "90 | \n", + "6 | \n", + "
847 | \n", + "847 | \n", + "105 | \n", + "7 | \n", + "
967 | \n", + "967 | \n", + "120 | \n", + "8 | \n", + "
1087 | \n", + "1087 | \n", + "135 | \n", + "9 | \n", + "
1207 | \n", + "1207 | \n", + "150 | \n", + "10 | \n", + "
1327 | \n", + "1327 | \n", + "165 | \n", + "11 | \n", + "
1447 | \n", + "1447 | \n", + "180 | \n", + "12 | \n", + "
1567 | \n", + "1567 | \n", + "195 | \n", + "13 | \n", + "
1687 | \n", + "1687 | \n", + "210 | \n", + "14 | \n", + "
1807 | \n", + "1807 | \n", + "225 | \n", + "15 | \n", + "