-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 1.02 KB
/
Makefile
File metadata and controls
44 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PYTHON ?= python
PIP_INSTALL_CMD ?= $(PYTHON) -m pip install
BUILD_DIR=_build/html
JL_DIR=_build/jl
html:
# Check for ipynb files in source (should all be text - .md or .Rmd).
if compgen -G "*.ipynb" 2> /dev/null; then (echo "ipynb files" && exit 1); fi
jupyter-book build -W .
jl:
# Jupyter-lite files for book build.
$(PIP_INSTALL_CMD) -r jl-build-requirements.txt
rm -rf $(JL_DIR)
mkdir $(JL_DIR)
cp -r data images $(JL_DIR)
$(PYTHON) _scripts/process_notebooks.py $(JL_DIR)
$(PYTHON) -m jupyter lite build \
--contents $(JL_DIR) \
--output-dir $(BUILD_DIR)/interact \
--lite-dir $(JL_DIR)
lint:
pre-commit run --all-files --show-diff-on-failure --color always
web: html jl
github: web
ghp-import -n _build/html -p -f
clean: rm-ipynb
rm -rf _build
-find . -name ".ipynb_checkpoints" -exec rm -rf {} \;
-find . -name "joblib" -exec rm -rf {} \;
rm-ipynb:
find . -name "*.ipynb" -exec rm {} \;
test:
pytest .
compare-optimizers:
( cd advanced/mathematical_optimization/helper && \
python compare_optimizers.py )