Skip to content

Commit

Permalink
CI: add script to download test data
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 5, 2024
1 parent 3d6ec80 commit 03479ac
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-tutorials.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tutorials
name: Test tutorials

on: [push]

Expand Down Expand Up @@ -31,6 +31,10 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pathos pygraphviz neuron cloud-volume k3d scikit-image open3d
python -m pip install -e .[test-notebook,all]
- name: Download test data
run: |
chmod +x download_test_data.sh
./download_test_data.sh
- name: Run tutorials
uses: coactions/setup-xvfb@v1
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@ ENV/
MANIFEST

tmp/

# Test data
mmc2
WannerAA*
18 changes: 9 additions & 9 deletions docs/examples/0_io/plot_00_io_skeletons.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# %%
import navis
skeletons = navis.read_swc(
'~/Downloads/mmc2/skeletons_swc.zip',
'./mmc2/skeletons_swc.zip',
include_subdirs=True
)
skeletons
Expand All @@ -47,7 +47,7 @@
# %%
# Load only the first 10 skeletons
sample = navis.read_swc(
'~/Downloads/mmc2/skeletons_swc.zip',
'./mmc2/skeletons_swc.zip',
include_subdirs=True,
limit=10
)
Expand All @@ -58,7 +58,7 @@

# %%
# For this I extraced the skeletons_swc.zip archive
s = navis.read_swc('~/Downloads/mmc2/swc/CENT/11519759.swc')
s = navis.read_swc('./mmc2/swc/CENT/11519759.swc')
s

# %%
Expand All @@ -75,22 +75,22 @@
# %%

# Write a single neuron:
navis.write_swc(s, '~/Downloads/mmc2/my_neuron.swc')
navis.write_swc(s, './mmc2/my_neuron.swc')

# %%

# Write a whole list of skeletons to a folder and use the neurons' `name` property as filename:
navis.write_swc(sample, '~/Downloads/mmc2/{neuron.name}.swc')
navis.write_swc(sample, './mmc2/{neuron.name}.swc')

# %%

# Write directly to a zip file:
navis.write_swc(sample, '~/Downloads/mmc2/skeletons.zip')
navis.write_swc(sample, './mmc2/skeletons.zip')

# %%

# Write directly to a zip file and use the neuron name as filename:
navis.write_swc(sample, '~/Downloads/mmc2/{neuron.name}[email protected]')
navis.write_swc(sample, './mmc2/{neuron.name}[email protected]')

# %%
# See [`navis.write_swc`][] for further details!
Expand All @@ -104,12 +104,12 @@

# %%
# Read a single file
s = navis.read_nmx('~/Downloads/WannerAA201605_SkeletonsGlomeruli/Neuron_id0001.nmx')
s = navis.read_nmx('./WannerAA201605_SkeletonsGlomeruli/Neuron_id0001.nmx')
s

# %%
# Read all files in folder
nl = navis.read_nmx('~/Downloads/WannerAA201605_SkeletonsGlomeruli/')
nl = navis.read_nmx('./WannerAA201605_SkeletonsGlomeruli/')
nl

# %%
Expand Down
11 changes: 11 additions & 0 deletions download_test_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# This script downloads the test data used in tutorials and examples
mkdir -p -- "docs/examples/0_io/mmc2"
curl -o docs/examples/0_io/mmc2/skeletons_swc.zip https://flyem.mrc-lmb.cam.ac.uk/flyconnectome/misc/skeletons_swc.zip

mkdir -p -- "docs/examples/0_io/mmc2/swc/CENT"
curl -o docs/examples/0_io/mmc2/swc/CENT/11519759.swc https://flyem.mrc-lmb.cam.ac.uk/flyconnectome/misc/11519759.swc

curl -o docs/examples/0_io/WannerAA201605_SkeletonsGlomeruli.zip https://flyem.mrc-lmb.cam.ac.uk/flyconnectome/misc/WannerAA201605_SkeletonsGlomeruli.zip
cd docs/examples/0_io
unzip WannerAA201605_SkeletonsGlomeruli.zip

0 comments on commit 03479ac

Please sign in to comment.