-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Urban-Analytics-Technology-Platform/53-paths
* Revise the filepath structure for pipeline outputs, include @Property methods within the config providing the paths and refactor scripts to use these * Add a `Population` class for reading pipeline outputs * Fallback download option when pyrosm fails (e.g. for West Yorkshire) * Configurable time tolerance * Rewrite of the run pipeline script with Python * Multiprocessing for script 3.3
- Loading branch information
Showing
36 changed files
with
5,523 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[parameters] | ||
seed = 0 | ||
region = "greater-london" | ||
zone_id = "MSOA21CD" | ||
travel_times = false | ||
boundary_geography = "MSOA" | ||
nts_years = [2019, 2021, 2022] | ||
nts_regions = ["London"] | ||
nts_day_of_week = 3 | ||
output_crs = 4326 | ||
|
||
[work_assignment] | ||
use_percentages = true | ||
weight_max_dev = 0.0 | ||
weight_total_dev = 1.0 | ||
max_zones = 4 | ||
commute_level = "MSOA" | ||
|
||
[matching] | ||
required_columns = ["number_adults", "number_children"] | ||
optional_columns = [ | ||
"number_cars", | ||
"num_pension_age", | ||
"rural_urban_2_categories", | ||
"employment_status", | ||
"tenure_status", | ||
] | ||
n_matches = 10 | ||
chunk_size = 50000 | ||
|
||
[postprocessing] | ||
pam_jitter = 30 | ||
pam_min_duration = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[parameters] | ||
seed = 0 | ||
region = "leeds" | ||
zone_id = "OA21CD" | ||
travel_times = false | ||
boundary_geography = "OA" | ||
nts_years = [2019, 2021, 2022] | ||
nts_regions = [ | ||
'Yorkshire and the Humber', | ||
'North West', | ||
'North East', | ||
'East Midlands', | ||
'West Midlands', | ||
'East of England', | ||
'South East', | ||
'South West', | ||
] | ||
nts_day_of_week = 3 | ||
output_crs = 4326 | ||
|
||
[work_assignment] | ||
use_percentages = false | ||
weight_max_dev = 0.0 | ||
weight_total_dev = 1.0 | ||
max_zones = 4 | ||
commute_level = "OA" | ||
|
||
[matching] | ||
required_columns = ["number_adults", "number_children"] | ||
optional_columns = [ | ||
"number_cars", | ||
"num_pension_age", | ||
"rural_urban_2_categories", | ||
"employment_status", | ||
"tenure_status", | ||
] | ||
n_matches = 10 | ||
chunk_size = 50000 | ||
|
||
[postprocessing] | ||
pam_jitter = 30 | ||
pam_min_duration = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[parameters] | ||
seed = 0 | ||
region = "leeds" | ||
zone_id = "OA21CD" | ||
travel_times = true | ||
boundary_geography = "OA" | ||
nts_years = [2019, 2021, 2022] | ||
nts_regions = [ | ||
'Yorkshire and the Humber', | ||
'North West', | ||
'North East', | ||
'East Midlands', | ||
'West Midlands', | ||
'East of England', | ||
'South East', | ||
'South West', | ||
] | ||
nts_day_of_week = 3 | ||
output_crs = 4326 | ||
|
||
[work_assignment] | ||
use_percentages = false | ||
weight_max_dev = 0.0 | ||
weight_total_dev = 1.0 | ||
max_zones = 4 | ||
commute_level = "OA" | ||
|
||
[matching] | ||
required_columns = ["number_adults", "number_children"] | ||
optional_columns = [ | ||
"number_cars", | ||
"num_pension_age", | ||
"rural_urban_2_categories", | ||
"employment_status", | ||
"tenure_status", | ||
] | ||
n_matches = 10 | ||
chunk_size = 50000 | ||
|
||
[postprocessing] | ||
pam_jitter = 30 | ||
pam_min_duration = 10 |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
[tool.poetry] | ||
name = "acbm" | ||
version = "0.1.0" | ||
authors = [ | ||
"Hussein Mahfouz <[email protected]>", | ||
] | ||
authors = ["Hussein Mahfouz <[email protected]>"] | ||
homepage = "https://github.com/alan-turing-institute/acbm" | ||
repository = "https://github.com/alan-turing-institute/acbm" | ||
license = "Apache-2.0" | ||
|
@@ -28,7 +26,7 @@ python = "^3.10" | |
pytest = { version = ">=6", optional = true } | ||
pytest-cov = { version = ">=3", optional = true } | ||
pandas = "^2.2.0" | ||
uatk-spc = {git = "https://github.com/alan-turing-institute/uatk-spc.git", subdirectory = "python"} | ||
uatk-spc = { git = "https://github.com/alan-turing-institute/uatk-spc.git", subdirectory = "python" } | ||
geopandas = "^0.14.3" | ||
matplotlib = "^3.8.3" | ||
scikit-learn = "^1.4.1.post1" | ||
|
@@ -43,9 +41,10 @@ tomlkit = "^0.13.0" | |
cml-pam = "0.3.2" | ||
gdal = "<=3.8.4" | ||
pandera = "^0.20.4" | ||
osmox = {git = "https://github.com/arup-group/osmox"} | ||
osmox = { git = "https://github.com/arup-group/osmox" } | ||
pyrosm = "^0.6.2" | ||
jsonschema = "^4.23.0" | ||
jcs = "^0.2.1" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = ">= 6" | ||
|
@@ -62,22 +61,13 @@ ipykernel = "^6.29.4" | |
minversion = "6.0" | ||
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] | ||
xfail_strict = true | ||
filterwarnings = [ | ||
"error", | ||
] | ||
filterwarnings = ["error"] | ||
log_cli_level = "INFO" | ||
testpaths = [ | ||
"tests", | ||
] | ||
testpaths = ["tests"] | ||
|
||
[tool.coverage] | ||
run.source = ["acbm"] | ||
port.exclude_lines = [ | ||
'pragma: no cover', | ||
'\.\.\.', | ||
'if typing.TYPE_CHECKING:', | ||
] | ||
|
||
port.exclude_lines = ['pragma: no cover', '\.\.\.', 'if typing.TYPE_CHECKING:'] | ||
|
||
|
||
[tool.ruff] | ||
|
@@ -86,29 +76,30 @@ exclude = [] | |
line-length = 88 # how long you want lines to be | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = true # code snippets in docstrings will be formatted | ||
docstring-code-format = true # code snippets in docstrings will be formatted | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"E", "F", "W", # flake8 | ||
"B", # flake8-bugbear | ||
"I", # isort | ||
"ARG", # flake8-unused-arguments | ||
"C4", # flake8-comprehensions | ||
"EM", # flake8-errmsg | ||
"ICN", # flake8-import-conventions | ||
"ISC", # flake8-implicit-str-concat | ||
"G", # flake8-logging-format | ||
"PGH", # pygrep-hooks | ||
"PIE", # flake8-pie | ||
"PL", # pylint | ||
"PT", # flake8-pytest-style | ||
"RET", # flake8-return | ||
"RUF", # Ruff-specific | ||
"SIM", # flake8-simplify | ||
"UP", # pyupgrade | ||
"YTT", # flake8-2020 | ||
"EXE", # flake8-executable | ||
"E", | ||
"F", | ||
"W", # flake8 | ||
"B", # flake8-bugbear | ||
"I", # isort | ||
"ARG", # flake8-unused-arguments | ||
"C4", # flake8-comprehensions | ||
"EM", # flake8-errmsg | ||
"ICN", # flake8-import-conventions | ||
"ISC", # flake8-implicit-str-concat | ||
"G", # flake8-logging-format | ||
"PGH", # pygrep-hooks | ||
"PIE", # flake8-pie | ||
"PL", # pylint | ||
"RET", # flake8-return | ||
"RUF", # Ruff-specific | ||
"SIM", # flake8-simplify | ||
"UP", # pyupgrade | ||
"YTT", # flake8-2020 | ||
"EXE", # flake8-executable | ||
] | ||
|
||
ignore = [ | ||
|
@@ -118,7 +109,7 @@ ignore = [ | |
"G004", # Logging statement uses f-string, not necessary here | ||
] | ||
unfixable = [ | ||
"F401", # Would remove unused imports | ||
"F841", # Would remove unused variables | ||
"F401", # Would remove unused imports | ||
"F841", # Would remove unused variables | ||
] | ||
flake8-unused-arguments.ignore-variadic-names = true # allow unused *args/**kwargs | ||
flake8-unused-arguments.ignore-variadic-names = true # allow unused *args/**kwargs |
Oops, something went wrong.