Skip to content

Commit 37965c0

Browse files
authored
Merge pull request #2808 from PolicyEngine/patch
Remove all HF API calls
2 parents 1e6b40c + 04834cb commit 37965c0

File tree

4 files changed

+662
-33
lines changed

4 files changed

+662
-33
lines changed

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
fixed:
4+
- Removed HF API calls.

policyengine_api/country.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from policyengine_core.periods import instant
1717
import dpath
1818
import math
19-
from policyengine_core.tools.hugging_face import download_huggingface_dataset
2019
import pandas as pd
20+
from pathlib import Path
2121

2222
# Note: The following policyengine_[xx] imports are probably redundant.
2323
# These modules are imported dynamically in the __init__ function below.
@@ -66,9 +66,8 @@ def build_microsimulation_options(self) -> dict:
6666
# { region: [{ name: "uk", label: "the UK" }], time_period: [{ name: 2022, label: "2022", ... }] }
6767
options = dict()
6868
if self.country_id == "uk":
69-
constituency_names_path = download_huggingface_dataset(
70-
repo="policyengine/policyengine-uk-data-public",
71-
repo_filename="constituencies_2024.csv",
69+
constituency_names_path = (
70+
Path(__file__).parent / "data" / "constituencies_2024.csv"
7271
)
7372
constituency_names = pd.read_csv(constituency_names_path)
7473
region = [

0 commit comments

Comments
 (0)