-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
71 lines (54 loc) · 2.55 KB
/
makefile
File metadata and controls
71 lines (54 loc) · 2.55 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: help run spplist recent recent-species load-sqlite verify-sqlite clean-data coverage-report init-migration-db load-ebird run-api test-api test story5-models story5-models-climate
PY ?= python
SCRIPT := backend/services/ebird_api.py
REGION ?= GB-ENG-CON
SPECIES ?=
MAX_RESULTS ?= 50
TIMEOUT ?= 20
OUTPUT_DIR ?= backend/data/raw
help:
@echo "bird-bird Make targets"
@echo " make spplist REGION=GB-ENG-CON"
@echo " make recent REGION=GB-ENG-CON MAX_RESULTS=50"
@echo " make recent-species REGION=GB-ENG-CON SPECIES=barswa"
@echo " make run REGION=GB-ENG-CON"
@echo " make load-sqlite"
@echo " make verify-sqlite"
@echo " make clean-data"
@echo " make coverage-report"
@echo " make init-migration-db"
@echo " make load-ebird"
@echo " make run-api"
@echo " make test-api"
@echo ""
@echo "Variables: PY, REGION, SPECIES, MAX_RESULTS, TIMEOUT, OUTPUT_DIR"
# Alias for the most common new mode.
run: spplist
spplist:
$(PY) $(SCRIPT) --region-spplist $(REGION) --timeout $(TIMEOUT) --output-dir $(OUTPUT_DIR)
recent:
$(PY) $(SCRIPT) --region $(REGION) --max-results $(MAX_RESULTS) --timeout $(TIMEOUT) --output-dir $(OUTPUT_DIR)
recent-species:
$(PY) $(SCRIPT) --region $(REGION) --species $(SPECIES) --max-results $(MAX_RESULTS) --timeout $(TIMEOUT) --output-dir $(OUTPUT_DIR)
load-sqlite:
$(PY) scripts/load_movebank_sqlite.py
verify-sqlite:
$(PY) scripts/verify_movebank_sqlite.py
clean-data:
$(PY) scripts/data_cleaning.py --replace-table
coverage-report:
$(PY) scripts/data_coverage.py
init-migration-db:
$(PY) scripts/init_migration_db.py --replace --seed-from-cleaned
load-ebird:
$(PY) scripts/load_ebird_to_migration.py
run-api:
$(PY) backend/app.py
test-api:
$(PY) -c "from backend.app import app; c=app.test_client(); r1=c.get('/api/species'); r2=c.get('/api/migration/?limit=10'); print('species status:', r1.status_code, 'count:', r1.get_json().get('meta',{}).get('count')); print('migration status:', r2.status_code, 'count:', r2.get_json().get('meta',{}).get('count'))"
test:
$(PY) -m pytest
story5-models:
$(PY) backend/analysis/stats_models.py --db-path backend/database/migration.db --output-dir docs --plot-dir backend/data/plots --min-rows-per-species 50 --model both --alpha 0.05
story5-models-climate:
$(PY) backend/analysis/stats_models.py --db-path backend/database/migration.db --output-dir docs --plot-dir backend/data/plots --min-rows-per-species 50 --model both --alpha 0.05 --climate-csv backend/data/clean/climate_daily_story5_1_era5_land.csv --climate-vars "$(CLIMATE_VARS)" --min-climate-coverage $(MIN_CLIMATE_COVERAGE)