Skip to content

Commit

Permalink
Fix how we structure the run notebook rules.
Browse files Browse the repository at this point in the history
With this change, one can just run `make notebooks/py/smFISH.py` or `make smFISH.py`.

For the examples in `docs/source/_static/data_processing_examples/`, we can also directly invoke them, i.e., `make 3d_smFISH.py`.

Also, we run all notebooks with ipython instead of python now.
  • Loading branch information
Tony Tung committed May 31, 2019
1 parent 2ec85ce commit 8e5a64d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,40 @@ jobs:
script: make docker
- name: smFISH Notebook
if: type = push and branch =~ /^(master|merge)/
script: travis_wait make install-dev run__notebooks/py/smFISH.py
script: travis_wait make install-dev notebooks/py/smFISH.py
- name: MERFISH Notebook
if: type = push and branch =~ /^(master|merge)/
script: travis_wait make install-dev run__notebooks/py/MERFISH.py
script: travis_wait make install-dev notebooks/py/MERFISH.py
- name: osmFISH Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/osmFISH.py
script: make install-dev notebooks/py/osmFISH.py
- name: DARTFISH Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/DARTFISH.py
script: make install-dev notebooks/py/DARTFISH.py
- name: Simulation Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/Starfish_simulation.py
script: make install-dev notebooks/py/Starfish_simulation.py
- name: ISS Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/ISS.py
script: make install-dev notebooks/py/ISS.py
- name: BaristaSeq Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/BaristaSeq.py
script: make install-dev notebooks/py/BaristaSeq.py
- name: SeqFISH Notebook
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__notebooks/py/SeqFISH.py
script: make install-dev notebooks/py/SeqFISH.py
# - name: STARmap Notebook
# if: type = push and branch =~ /^(master|merge)/
# script: make install-dev run__notebooks/py/STARmap.py
# script: make install-dev notebooks/py/STARmap.py
- name: 3D smFISH data processing example
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__3d_smFISH.py
script: make install-dev 3d_smFISH.py
- name: iss_cli.sh data processing example
if: type = push and branch =~ /^(master|merge)/
script: make install-dev run__iss_cli.sh
script: make install-dev iss_cli.sh
- name: iss_pipeline.py data processing example
if: type = push and branch =~ /^(master|merge)/
script: make TESTING=1 install-dev run__iss_pipeline.py
script: make TESTING=1 install-dev iss_pipeline.py
- name: Released Notebooks
if: type = cron and branch =~ /^(master|merge)/
script: make check-notebooks install-released-notebooks-support run-notebooks
Expand Down
8 changes: 4 additions & 4 deletions docs/source/_static/data_processing_examples/subdir.mk
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
path := docs/source/_static/data_processing_examples
py_files := $(wildcard $(path)/*.py)
sh_files := $(wildcard $(path)/*.sh)
py_run_targets := $(patsubst $(path)/%,run__%,$(py_files))
sh_run_targets := $(patsubst $(path)/%,run__%,$(sh_files))
py_run_targets := $(patsubst $(path)/%,%,$(py_files))
sh_run_targets := $(patsubst $(path)/%,%,$(sh_files))

PYTHON := ipython

run-examples: $(py_run_targets) $(sh_run_targets)

$(py_run_targets): run__% :
$(py_run_targets): % :
[ -e $(path)/$*.skip ] || $(PYTHON) $(path)/$*

$(sh_run_targets): run__% :
$(sh_run_targets): % :
[ -e $(path)/$*.skip ] || $(SHELL) $(path)/$*
14 changes: 10 additions & 4 deletions notebooks/subdir.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
py_files := $(wildcard notebooks/py/*.py)
pypath := notebooks/py
py_files := $(wildcard $(pypath)/*.py)
ipynb_files := $(wildcard notebooks/*.ipynb)
py_run_targets := $(addprefix run__, $(py_files))
py_run_targets := $(patsubst $(pypath)/%,%,$(py_files))
py_check_targets := $(addprefix check__, $(py_files))
ipynb_validate_targets := $(addprefix validate__, $(ipynb_files))
ipynb_regenerate_targets := $(addprefix regenerate__notebooks/, $(addsuffix .ipynb, $(notdir $(basename $(py_files)))))
py_regenerate_targets := $(addprefix regenerate__notebooks/py/, $(addsuffix .py, $(notdir $(basename $(ipynb_files)))))
PYTHON := python
PYTHON := ipython

fast: $(ipynb_validate_targets)
run-notebooks: $(py_run_targets)
Expand All @@ -14,7 +15,10 @@ validate-notebooks: $(ipynb_validate_targets)
regenerate-ipynb: $(ipynb_regenerate_targets)
regenerate-py: $(py_regenerate_targets)

$(py_run_targets): run__%.py :
$(py_run_targets): %.py :
[ -e $*.py.skip ] || $(PYTHON) $(pypath)/$*.py

$(py_files): %.py :
[ -e $*.py.skip ] || $(PYTHON) $*.py

$(py_check_targets): check__%.py :
Expand All @@ -30,3 +34,5 @@ $(ipynb_regenerate_targets): regenerate__notebooks/%.ipynb : notebooks/py/%.py

$(py_regenerate_targets): regenerate__notebooks/py/%.py : notebooks/%.ipynb
nbencdec encode notebooks/$*.ipynb notebooks/py/$*.py

.PHONY : $(py_files)

0 comments on commit 8e5a64d

Please sign in to comment.