Format python
This commit is contained in:
parent
85f5770e09
commit
4c258018c3
17 changed files with 348 additions and 248 deletions
54
Taskfile.yml
54
Taskfile.yml
|
|
@ -21,47 +21,43 @@ tasks:
|
|||
- cd frontend && npm install
|
||||
|
||||
download:arcgis:
|
||||
internal: true
|
||||
desc: Download and convert ArcGIS postcode data
|
||||
sources:
|
||||
- pipeline/download/arcgis.py
|
||||
generates:
|
||||
- "{{.ARCGIS_OUTPUT}}"
|
||||
cmds:
|
||||
- uv run python -m pipeline.download.arcgis --output {{.ARCGIS_OUTPUT}}
|
||||
|
||||
download:price-paid:
|
||||
internal: true
|
||||
desc: Download and convert Land Registry price-paid data
|
||||
sources:
|
||||
- pipeline/download/price_paid.py
|
||||
generates:
|
||||
- "{{.PRICE_PAID_OUTPUT}}"
|
||||
cmds:
|
||||
- uv run python -m pipeline.download.price_paid --output {{.PRICE_PAID_OUTPUT}}
|
||||
|
||||
download:deprivation:
|
||||
internal: true
|
||||
desc: Download and convert Index of Deprivation data
|
||||
sources:
|
||||
- pipeline/download/deprivation_data.py
|
||||
generates:
|
||||
- "{{.IOD_OUTPUT}}"
|
||||
cmds:
|
||||
- uv run python -m pipeline.download.deprivation_data --output {{.IOD_OUTPUT}}
|
||||
|
||||
download:pois:
|
||||
internal: true
|
||||
desc: Download and extract POIs from OpenStreetMap
|
||||
sources:
|
||||
- pipeline/download/pois.py
|
||||
generates:
|
||||
- "{{.POIS_RAW_OUTPUT}}"
|
||||
cmds:
|
||||
- uv run python -m pipeline.download.pois --output {{.POIS_RAW_OUTPUT}}
|
||||
|
||||
transform:pois:
|
||||
internal: true
|
||||
desc: Transform raw POIs to filtered version with friendly names
|
||||
deps:
|
||||
- download:pois
|
||||
sources:
|
||||
- pipeline/transform/transform_poi.py
|
||||
- "{{.POIS_RAW_OUTPUT}}"
|
||||
generates:
|
||||
- "{{.POIS_FILTERED_OUTPUT}}"
|
||||
|
|
@ -69,12 +65,11 @@ tasks:
|
|||
- uv run python -m pipeline.transform.transform_poi --input {{.POIS_RAW_OUTPUT}} --output {{.POIS_FILTERED_OUTPUT}}
|
||||
|
||||
transform:epc-pp:
|
||||
internal: true
|
||||
desc: Fuzzy join EPC and Price Paid data
|
||||
deps:
|
||||
- download:price-paid
|
||||
sources:
|
||||
- pipeline/transform/join_epc_pp.py
|
||||
- pipeline/utils/fuzzy_join.py
|
||||
- "{{.PRICE_PAID_OUTPUT}}"
|
||||
- "{{.EPC_CSV}}"
|
||||
generates:
|
||||
|
|
@ -83,13 +78,12 @@ tasks:
|
|||
- uv run python -m pipeline.transform.join_epc_pp --epc {{.EPC_CSV}} --price-paid {{.PRICE_PAID_OUTPUT}} --output {{.EPC_PP_OUTPUT}}
|
||||
|
||||
transform:poi-proximity:
|
||||
internal: true
|
||||
desc: Compute POI proximity counts per postcode
|
||||
deps:
|
||||
- download:arcgis
|
||||
- transform:pois
|
||||
sources:
|
||||
- pipeline/transform/poi_proximity.py
|
||||
- pipeline/utils/poi_counts.py
|
||||
- "{{.ARCGIS_OUTPUT}}"
|
||||
- "{{.POIS_FILTERED_OUTPUT}}"
|
||||
generates:
|
||||
|
|
@ -97,7 +91,7 @@ tasks:
|
|||
cmds:
|
||||
- uv run python -m pipeline.transform.poi_proximity --arcgis {{.ARCGIS_OUTPUT}} --pois {{.POIS_FILTERED_OUTPUT}} --output {{.POI_PROXIMITY_OUTPUT}}
|
||||
|
||||
transform:wide:
|
||||
prepare:
|
||||
desc: Build wide property dataframe with all joins
|
||||
deps:
|
||||
- join:epc-pp
|
||||
|
|
@ -105,7 +99,6 @@ tasks:
|
|||
- download:deprivation
|
||||
- transform:poi-proximity
|
||||
sources:
|
||||
- pipeline/transform/merge.py
|
||||
- "{{.EPC_PP_OUTPUT}}"
|
||||
- "{{.ARCGIS_OUTPUT}}"
|
||||
- "{{.IOD_OUTPUT}}"
|
||||
|
|
@ -115,36 +108,37 @@ tasks:
|
|||
cmds:
|
||||
- uv run python -m pipeline.transform.merge --epc-pp {{.EPC_PP_OUTPUT}} --arcgis {{.ARCGIS_OUTPUT}} --iod {{.IOD_OUTPUT}} --poi-proximity {{.POI_PROXIMITY_OUTPUT}} --journey-times {{.JOURNEY_TIMES}} --output {{.WIDE_OUTPUT}}
|
||||
|
||||
prepare:
|
||||
desc: Prepare the application (install, download data, run pipeline)
|
||||
deps:
|
||||
- transform:wide
|
||||
|
||||
test:
|
||||
cmds:
|
||||
- uv run -m pipeline.utils.test_fuzzy_join
|
||||
- uv run pytest pipeline/utils/test_haversine.py
|
||||
- uv run pytest pipeline/utils/test_poi_counts.py
|
||||
|
||||
server:
|
||||
dev:server:
|
||||
desc: Run Rust backend on port 8001
|
||||
dir: server-rs
|
||||
cmds:
|
||||
- cargo run --release -- {{.WIDE_OUTPUT}}
|
||||
|
||||
frontend:
|
||||
dev:frontend:
|
||||
desc: Run frontend dev server on port 3030 (proxies /api to :8001)
|
||||
dir: frontend
|
||||
cmds:
|
||||
- npm run dev
|
||||
|
||||
build:
|
||||
build:server:
|
||||
desc: Build server for production
|
||||
dir: frontend
|
||||
cmds:
|
||||
- cargo build --release
|
||||
|
||||
build:frontend:
|
||||
desc: Build frontend for production
|
||||
dir: frontend
|
||||
cmds:
|
||||
- npm run typecheck
|
||||
- npm run build
|
||||
|
||||
|
||||
lint:
|
||||
desc: Lint all code (Python, TypeScript, and Rust)
|
||||
cmds:
|
||||
|
|
@ -195,17 +189,13 @@ tasks:
|
|||
desc: Format Rust code with cargo fmt
|
||||
dir: server-rs
|
||||
cmds:
|
||||
- cargo fmt
|
||||
- cargo fmt --all
|
||||
|
||||
check:
|
||||
desc: Run all checks (lint, typecheck, build)
|
||||
cmds:
|
||||
- task: lint
|
||||
- task: typecheck
|
||||
- task: build
|
||||
- task: build:server
|
||||
- task: build:frontend
|
||||
- task: test
|
||||
|
||||
typecheck:
|
||||
desc: Type check frontend TypeScript code
|
||||
dir: frontend
|
||||
cmds:
|
||||
- npm run typecheck
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue