forked from sjsrey/pysal-spatialapi20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (30 loc) · 1.5 KB
/
Makefile
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
.ONESHELL:
SHELL=/bin/bash
#################################################################################
# GLOBALS #
#################################################################################
CONDA_BASE=$(shell conda info --base)
CONDA_ENVIRONMENT = pysal-spatialapi20
#################################################################################
# COMMANDS #
#################################################################################
## Set up python interpreter environment
environment:
conda env create -f environment.yml
## Update the environment in case of changes to dependencies
environment-update:
mamba env update --name $(CONDA_ENVIRONMENT) --file environment.yml
## Install notebook kernel manually
kernel:
@source "$(CONDA_BASE)/bin/activate" $(CONDA_ENVIRONMENT);\
python -m ipykernel install --name $(CONDA_ENVIRONMENT) --user
## Initialize a git repository
git:
git init
## Run notebooks
notebooks:
@source "$(CONDA_BASE)/bin/activate" $(CONDA_ENVIRONMENT);\
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=$(CONDA_ENVIRONMENT) content/*.ipynb;
clear-notebooks:
@source "$(CONDA_BASE)/bin/activate" $(CONDA_ENVIRONMENT);\
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --clear-output --ExecutePreprocessor.kernel_name=$(CONDA_ENVIRONMENT) content/*.ipynb