Skip to content

Commit

Permalink
implement scripts for tutorial_i (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfl-urbaniak authored Apr 12, 2024
1 parent 9ea3f16 commit af79c20
Show file tree
Hide file tree
Showing 5 changed files with 464 additions and 282 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
lint: FORCE
./scripts/lint.sh

lint-notebooks:
./scripts/lint_notebooks.sh

format:
./scripts/clean.sh

format-notebooks:
./scripts/clean_notebooks.sh

tests: lint FORCE
pytest -v tests

Expand Down
720 changes: 438 additions & 282 deletions docs/source/tutorial_i.ipynb

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions scripts/clean_notebooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

INCLUDED_NOTEBOOKS="docs/source/tutorial_i.ipynb" # docs/source/backdoor.ipynb docs/source/dr_learner.ipynb docs/source/mediation.ipynb docs/source/sdid.ipynb docs/source/slc.ipynb docs/source/dynamical_intro.ipynb docs/source/actual_causality.ipynb"

export ISORT_PROFILE=black

nbqa isort $INCLUDED_NOTEBOOKS
nbqa black $INCLUDED_NOTEBOOKS

10 changes: 10 additions & 0 deletions scripts/lint_notebooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

INCLUDED_NOTEBOOKS="docs/source/tutorial_i.ipynb" # docs/source/backdoor.ipynb docs/source/dr_learner.ipynb docs/source/mediation.ipynb docs/source/sdid.ipynb docs/source/slc.ipynb docs/source/dynamical_intro.ipynb docs/source/actual_causality.ipynb"

export ISORT_PROFILE=black

nbqa mypy --ignore-missing-imports $INCLUDED_NOTEBOOKS
nbqa isort --check --diff $INCLUDED_NOTEBOOKS
nbqa black --check $INCLUDED_NOTEBOOKS
nbqa flake8 $INCLUDED_NOTEBOOKS
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"myst_parser",
"nbsphinx",
"nbval",
"nbqa",
],
},
python_requires=">=3.8",
Expand Down

0 comments on commit af79c20

Please sign in to comment.