Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/examples/tutorial_HD_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ Downloading the data
It's a small NWB file.

```{code-cell} ipython3
path = "Mouse32-140822.nwb"
if path not in os.listdir("."):
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
path = os.path.join(data_dir, "Mouse32-140822.nwb")
if not os.path.exists(path):
r = requests.get(f"https://osf.io/jb2gd/download", stream=True)
block_size = 1024*1024
with open(path, 'wb') as f:
Expand Down
5 changes: 3 additions & 2 deletions doc/examples/tutorial_calcium_imaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Downloading the data
First things first: let's find our file.

```{code-cell} ipython3
path = "A0670-221213.nwb"
if path not in os.listdir("."):
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
path = os.path.join(data_dir, "A0670-221213.nwb")
if not os.path.exists(path):
r = requests.get(f"https://osf.io/sbnaw/download", stream=True)
block_size = 1024*1024
with open(path, 'wb') as f:
Expand Down
5 changes: 3 additions & 2 deletions doc/examples/tutorial_phase_preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Downloading the data
Let's download the data and save it locally.

```{code-cell} ipython3
path = "Achilles_10252013_EEG.nwb"
if path not in os.listdir("."):
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
path = os.path.join(data_dir, "Achilles_10252013_EEG.nwb")
if not os.path.exists(path):
r = requests.get(f"https://osf.io/2dfvp/download", stream=True)
block_size = 1024 * 1024
with open(path, "wb") as f:
Expand Down
5 changes: 3 additions & 2 deletions doc/examples/tutorial_wavelet_decomposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ Let's download the data and save it locally
jupyter:
outputs_hidden: false
---
path = "Achilles_10252013_EEG.nwb"
if path not in os.listdir("."):
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
path = os.path.join(data_dir, "Achilles_10252013_EEG.nwb")
if not os.path.exists(path):
r = requests.get(f"https://osf.io/2dfvp/download", stream=True)
block_size = 1024 * 1024
with open(path, "wb") as f:
Expand Down
12 changes: 7 additions & 5 deletions doc/user_guide/02_input_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ import os
import requests, math
import tqdm

nwb_path = 'A2929-200711.nwb'
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
nwb_path = os.path.join(data_dir, "A2929-200711.nwb")

if nwb_path not in os.listdir("."):
if not os.path.exists(nwb_path):
r = requests.get(f"https://osf.io/fqht6/download", stream=True)
block_size = 1024*1024
with open(nwb_path, 'wb') as f:
Expand Down Expand Up @@ -266,10 +267,11 @@ print(sta)

import zipfile

project_path = "MyProject"
data_dir = os.environ.get("PYNAPPLE_DATA_DIR", ".")
project_path = os.path.join(data_dir, "MyProject")


if project_path not in os.listdir("."):
if not os.path.exists(project_path):
r = requests.get(f"https://osf.io/a9n6r/download", stream=True)
block_size = 1024*1024
with open(project_path+".zip", 'wb') as f:
Expand All @@ -278,7 +280,7 @@ if project_path not in os.listdir("."):
f.write(data)

with zipfile.ZipFile(project_path+".zip", 'r') as zip_ref:
zip_ref.extractall(".")
zip_ref.extractall(data_dir)

```

Expand Down
Loading