Skip to content

Commit 4aa967d

Browse files
committed
Add cybershuttle magics to notebooks
1 parent b02c4cf commit 4aa967d

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

tutorial_part1.ipynb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%pip install -q --force-reinstall airavata-python-sdk[notebook]\n",
10+
"import airavata_jupyter_magic\n",
11+
"\n",
12+
"%authenticate\n",
13+
"%request_runtime hpc_cpu --file=cybershuttle.yml --walltime=60 --use=NeuroData25VC1:cloud,expanse:shared,anvil:shared\n",
14+
"%switch_runtime hpc_cpu"
15+
]
16+
},
317
{
418
"cell_type": "markdown",
519
"metadata": {},
@@ -831,6 +845,36 @@
831845
"<img src=\"https://ik.imagekit.io/7tkfmw7hc/tbrain_notebooks/full_data_obj.png?updatedAt=1744132750893\" width=\"1000\">"
832846
]
833847
},
848+
{
849+
"cell_type": "markdown",
850+
"metadata": {},
851+
"source": [
852+
"from pynwb import NWBHDF5IO\n",
853+
"\n",
854+
"input_file = \"sub-T_ses-CO-20130819_behavior+ecephys.nwb\"\n",
855+
"io = NWBHDF5IO(input_file, \"r\")\n",
856+
"nwbfile = io.read()\n",
857+
"\n",
858+
"# we can access the spike times and unit indices directly from the NWB file\n",
859+
"spike_train_list = nwbfile.units.spike_times_index[:]\n",
860+
"print(f\"Number of units found: {len(spike_train_list)}\")"
861+
]
862+
},
863+
{
864+
"cell_type": "markdown",
865+
"metadata": {},
866+
"source": [
867+
"from pynwb import NWBHDF5IO\n",
868+
"\n",
869+
"input_file = \"sub-T_ses-CO-20130819_behavior+ecephys.nwb\"\n",
870+
"io = NWBHDF5IO(input_file, \"r\")\n",
871+
"nwbfile = io.read()\n",
872+
"\n",
873+
"# we can access the spike times and unit indices directly from the NWB file\n",
874+
"spike_train_list = nwbfile.units.spike_times_index[:]\n",
875+
"print(f\"Number of units found: {len(spike_train_list)}\")"
876+
]
877+
},
834878
{
835879
"cell_type": "code",
836880
"execution_count": null,

tutorial_part2.ipynb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%pip install -q --force-reinstall airavata-python-sdk[notebook]\n",
10+
"import airavata_jupyter_magic\n",
11+
"\n",
12+
"%authenticate\n",
13+
"%request_runtime hpc_cpu --file=cybershuttle.yml --walltime=60 --use=NeuroData25VC1:cloud,expanse:shared,anvil:shared\n",
14+
"%switch_runtime hpc_cpu"
15+
]
16+
},
317
{
418
"cell_type": "markdown",
519
"metadata": {},

0 commit comments

Comments
 (0)