From 95a6391a360bd5a9ac16cde730def5eb07f4450e Mon Sep 17 00:00:00 2001 From: Johannes Hjorth Date: Wed, 21 Aug 2024 15:53:43 +0200 Subject: [PATCH] Notebooks --- .../neuromodulation_bath.ipynb | 34 ++++++---------- .../neuromodulation_on_off.ipynb | 40 +++++++++++++------ 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/examples/notebooks/neuromodulation/neuromodulation_bath.ipynb b/examples/notebooks/neuromodulation/neuromodulation_bath.ipynb index 48028e4a6..9fee0caa8 100644 --- a/examples/notebooks/neuromodulation/neuromodulation_bath.ipynb +++ b/examples/notebooks/neuromodulation/neuromodulation_bath.ipynb @@ -53,9 +53,8 @@ "Writing networks/neuromodulation_bath/network-config.json\n", "Placing neurons\n", "Network path: networks/neuromodulation_bath\n", - "Creating missing directory networks/neuromodulation_bath/log\n", - "Created directory networks/neuromodulation_bath/log\n", "Reading SNUDDA_DATA=None from networks/neuromodulation_bath/network-config.json\n", + "Reading SNUDDA_DATA=/home/hjorth/HBP/Snudda/snudda/utils/../data from networks/neuromodulation_bath/network-synapses.hdf5\n", "No n_putative_points and putative_density, setting n_putative_points = 63\n", "(this must be larger than the number of neurons you want to place)\n", "Generating 63 points for networks/neuromodulation_bath/mesh/Cube-cube-mesh-2.917951293943981e-05.obj\n", @@ -66,9 +65,8 @@ "Execution time: 0.0s\n", "Touch detection\n", "Network path: networks/neuromodulation_bath\n", - "Creating missing directory networks/neuromodulation_bath/voxels\n", - "Created directory networks/neuromodulation_bath/voxels\n", "Reading SNUDDA_DATA=None from networks/neuromodulation_bath/network-config.json\n", + "Reading SNUDDA_DATA=/home/hjorth/HBP/Snudda/snudda/utils/../data from networks/neuromodulation_bath/network-synapses.hdf5\n", "No d_view specified, running distribute neurons in serial\n", "Processing hyper voxel : 0/27 (2 neurons)\n", "Processing hyper voxel : 1/27 (2 neurons)\n", @@ -81,14 +79,14 @@ "Reading SNUDDA_DATA=None from networks/neuromodulation_bath/network-config.json\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 0.5s\n", + "Execution time: 0.6s\n", "Prune synapses\n", "Network path: networks/neuromodulation_bath\n", "No file networks/neuromodulation_bath/pruning_merge_info.json\n", "Read 90 out of total 90 synapses\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 0.5s\n" + "Execution time: 0.6s\n" ] } ], @@ -140,13 +138,13 @@ "Writing spikes to networks/neuromodulation_bath/input-spikes.hdf5\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 2.8s\n" + "Execution time: 4.0s\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 2, @@ -161,18 +159,10 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "aa0341ff-115d-43f9-a46a-dd6cf074ca69", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "mpirun -n 1 snudda simulate networks/neuromodulation_bath --time 4.0 --simulation_config data/DA-bath-experiment.json --mechdir /home/hjorth/BasalGangliaData/data/neurons/mechanisms\n" - ] - } - ], + "outputs": [], "source": [ "sim_time = 4.0\n", "n_workers = 1\n", @@ -212,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "id": "d84ee6f3-4193-4509-ad4a-0d93dff5e3d9", "metadata": {}, "outputs": [ @@ -240,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 4, "id": "bd0f4edf-a622-490b-b39f-18f516975737", "metadata": {}, "outputs": [], @@ -252,7 +242,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 5, "id": "a63a7152-730e-4868-a81a-cc87fccaf9f4", "metadata": {}, "outputs": [ @@ -263,7 +253,7 @@ " scrolling=\"no\"\n", " width=\"1020px\"\n", " height=\"820\"\n", - " src=\"iframe_figures/figure_8.html\"\n", + " src=\"iframe_figures/figure_5.html\"\n", " frameborder=\"0\"\n", " allowfullscreen\n", ">\n" diff --git a/examples/notebooks/neuromodulation/neuromodulation_on_off.ipynb b/examples/notebooks/neuromodulation/neuromodulation_on_off.ipynb index cfdaa555a..41fb8bbf3 100644 --- a/examples/notebooks/neuromodulation/neuromodulation_on_off.ipynb +++ b/examples/notebooks/neuromodulation/neuromodulation_on_off.ipynb @@ -38,9 +38,6 @@ "name": "stdout", "output_type": "stream", "text": [ - "Jupyter environment detected. Enabling Open3D WebVisualizer.\n", - "[Open3D INFO] WebRTC GUI backend enabled.\n", - "[Open3D INFO] WebRTCWindowSystem: HTTP handshake server disabled.\n", "Reading connectivity from data/connectivity_v2.json\n", "Adding neurons: dspn from dir data/dspn\n", "Writing networks/neuromodulation_ON_OFF/network-config.json\n", @@ -52,7 +49,7 @@ "No n_putative_points and putative_density, setting n_putative_points = 63\n", "(this must be larger than the number of neurons you want to place)\n", "Generating 63 points for networks/neuromodulation_ON_OFF/mesh/Cube-cube-mesh-2.917951293943981e-05.obj\n", - "Filtering, keeping inside points: 3 / 25\n", + "Filtering, keeping inside points: 2 / 26\n", "neuron_name = 'dspn_0', num = 2, neuron_path = 'data/dspn/str-dspn-e150602_c1_D1-mWT-0728MSN01-v20211026'\n", "stop_parallel disabled, to keep pool running.\n", "\n", @@ -74,14 +71,14 @@ "Reading SNUDDA_DATA=None from networks/neuromodulation_ON_OFF/network-config.json\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 1.0s\n", + "Execution time: 0.5s\n", "Prune synapses\n", "Network path: networks/neuromodulation_ON_OFF\n", "No file networks/neuromodulation_ON_OFF/pruning_merge_info.json\n", - "Read 41 out of total 41 synapses\n", + "Read 31 out of total 31 synapses\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 1.0s\n" + "Execution time: 0.6s\n" ] } ], @@ -132,13 +129,13 @@ "Writing spikes to networks/neuromodulation_ON_OFF/input-spikes.hdf5\n", "stop_parallel disabled, to keep pool running.\n", "\n", - "Execution time: 1.2s\n" + "Execution time: 3.5s\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 2, @@ -186,6 +183,8 @@ "# sim_config_on = os.path.join(\"data\", \"da_experiment_on.json\")\n", "# sim_config_off = os.path.join(\"data\", \"da_experiment_off.json\")\n", "\n", + "snudda = None\n", + "\n", "sim_config_on = os.path.join(\"data\", \"da_experiment_on.json\")\n", "sim_config_off = os.path.join(\"data\", \"da_experiment_off.json\")\n", "\n", @@ -245,13 +244,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "0f3648c5-2f5f-4b5b-b438-5eb15bffdd61", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mpirun -n 1 snudda simulate networks/neuromodulation_ON_OFF --time 1 --simulation_config data/da_experiment_off.json --mechdir /home/hjorth/BasalGangliaData/data/neurons/mechanisms --disable_rxd_neuromodulation\n" + ] + } + ], "source": [ "run_str_off = f\"mpirun -n {n_workers} snudda simulate {network_path} --time {sim_time} --simulation_config {sim_config_off} --mechdir {mech_dir} --disable_rxd_neuromodulation\"\n", - "print(run_str_off)\n", + "print(run_str_off)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3cdbcb1-7520-4a7c-93d8-61071697b8ca", + "metadata": {}, + "outputs": [], + "source": [ "os.system(run_str_off)" ] },