This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
68 lines (56 loc) · 1.97 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## Development utilities for pv_evaluation
##
## Usage:
## make <target> [<arg>=<value> ...]
##
## Targets:
## help: Show this help message.
## env: Create or update conda environment "pv-evaluation"
## docs: Make Sphinx documentation.
## black: Format Python files.
## data: Make processed data folder.
ENV?=pv-evaluation
DATA_RAW_S3_URL=https://s3.amazonaws.com/data.patentsview.org/PatentsView-Evaluation/data-raw.zip
.PHONY: help env black data docs build clean
help: makefile
@sed -n "s/^##//p" $<
env: environment.yml
@(echo "Creating pv-evaluation environment..."; conda env create -f $<) \
|| (echo "Updating pv-evaluation environment...\n"; conda env update -f $<)
black:
black . --line-length=127
data: env\
pv_evaluation/data/inventor/israeli-inventors-benchmark.csv\
pv_evaluation/data/inventor/patentsview-inventors-benchmark.csv\
pv_evaluation/data/inventor/lai-2011-benchmark.csv\
pv_evaluation/data/inventor/ens-inventors.csv\
pv_evaluation/data/inventor/als-inventors.csv\
pv_evaluation/data/assignee/air-umass-assignees-benchmark.csv\
pv_evaluation/data/assignee/nber-subset-assignees-benchmark.csv\
pv_evaluation/data/inventor/binette-2022-inventors-benchmark.csv\
data-raw.zip:
wget $(DATA_RAW_S3_URL)
data-raw/.tag: data-raw.zip
unzip data-raw.zip
touch data-raw/.tag
pv_evaluation/data/inventor/%.csv: scripts/inventor/%.py data-raw/.tag
conda run -n $(ENV) python3 $<
pv_evaluation/data/assignee/%.csv: scripts/assignee/%.py data-raw/.tag
conda run -n $(ENV) python3 $<
docs:
rm -rf docs/source/examples
find examples -name *.ipynb -not -path "**/.jupyter_cache/**" -exec cp --parents {} docs/source \;
find examples -name *.html -exec cp --parents {} docs/source \;
$(MAKE) html -C docs
git add docs/build/*.html -f
git add docs/build/*.js -f
git add docs/build/*.css -f
git add docs/build/*.svg -f
git add docs/build/*.doctree -f
git add docs/build/*.txt -f
build:
python3 -m build .
clean:
rm -r data-raw
rm data-raw.zip
rm *.egg-info