Skip to content

Commit

Permalink
Notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Aug 21, 2024
1 parent 2346bc8 commit 95a6391
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 34 deletions.
34 changes: 12 additions & 22 deletions examples/notebooks/neuromodulation/neuromodulation_bath.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
]
}
],
Expand Down Expand Up @@ -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": [
"<snudda.input.input.SnuddaInput at 0xffff0a7fa460>"
"<snudda.input.input.SnuddaInput at 0xffff209fbac0>"
]
},
"execution_count": 2,
Expand All @@ -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",
Expand Down Expand Up @@ -212,7 +202,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"id": "d84ee6f3-4193-4509-ad4a-0d93dff5e3d9",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -240,7 +230,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"id": "bd0f4edf-a622-490b-b39f-18f516975737",
"metadata": {},
"outputs": [],
Expand All @@ -252,7 +242,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"id": "a63a7152-730e-4868-a81a-cc87fccaf9f4",
"metadata": {},
"outputs": [
Expand All @@ -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",
"></iframe>\n"
Expand Down
40 changes: 28 additions & 12 deletions examples/notebooks/neuromodulation/neuromodulation_on_off.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
]
}
],
Expand Down Expand Up @@ -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": [
"<snudda.input.input.SnuddaInput at 0x7f8cfc0df910>"
"<snudda.input.input.SnuddaInput at 0xffff86dfb9d0>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
]
},
Expand Down

0 comments on commit 95a6391

Please sign in to comment.