Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ indicatif = "0.17"
comfy-table = "7"
colored = "2"
anyhow = "1"
smartcore = "0.4"
rand = "0.8"

[profile.release]
opt-level = 3
Expand Down
12 changes: 10 additions & 2 deletions interfaces/python/policyengine_uk_compiled/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,21 @@ def _download_object(key: str, dest: Path, access_key: str, secret_key: str):
url = f"https://{GCS_HOST}/{GCS_BUCKET}{path}"
req = urllib.request.Request(url, headers=headers)
dest.parent.mkdir(parents=True, exist_ok=True)
with urllib.request.urlopen(req) as resp:
with urllib.request.urlopen(req, timeout=300) as resp:
expected = int(resp.headers.get("Content-Length", 0))
written = 0
with open(dest, "wb") as f:
while True:
chunk = resp.read(1 << 20)
if not chunk:
break
f.write(chunk)
written += len(chunk)
if expected and written != expected:
dest.unlink(missing_ok=True)
raise IOError(
f"Incomplete download for {key}: got {written} of {expected} bytes"
)


def _get_credentials() -> tuple[str, str]:
Expand All @@ -60,7 +68,7 @@ def _get_credentials() -> tuple[str, str]:
return token.split(":", 1)


DATASETS = ("frs", "lcfs", "spi", "was")
DATASETS = ("frs", "efrs", "lcfs", "spi", "was")


def ensure_dataset_year(dataset: str, year: int) -> Path:
Expand Down
6 changes: 6 additions & 0 deletions parameters/1994_95.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/1995_96.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/1996_97.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/1997_98.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/1998_99.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/1999_00.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
6 changes: 6 additions & 0 deletions parameters/2000_01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ uc_migration:
tax_credits: 0.0
income_support: 0.0


vat:
standard_rate: 0.175
reduced_rate: 0.05
zero_rate: 0.0

growth_factors:
cpi_rate: 0.0
gdp_deflator: 0.0
Expand Down
Loading
Loading