Skip to content

Commit 42be00c

Browse files
committed
Fix default Hugging Face dataset URL
1 parent 896b2be commit 42be00c

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

policyengine_uk/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init__(
144144
self.build_from_multi_year_dataset(dataset)
145145
elif dataset is None:
146146
self.build_from_url(
147-
"hf://policyengine/policyengine-uk-data/enhanced_frs_2023_24.h5"
147+
"hf://policyengine/policyengine-uk-data-private/enhanced_frs_2023_24.h5"
148148
)
149149
else:
150150
raise ValueError(f"Unsupported dataset type: {dataset.__class__}")

policyengine_uk/tax_benefit_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Module constants
3939
COUNTRY_DIR = Path(__file__).parent
40-
ENHANCED_FRS = "hf://policyengine/policyengine-uk-data/enhanced_frs_2023_24.h5"
40+
ENHANCED_FRS = "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2023_24.h5"
4141

4242
# Cache for fully-processed parameter tree, so convert_to_fiscal_year_parameters
4343
# (22,538 param.update() calls) only runs once per process.

policyengine_uk/tests/test_deterministic_variables.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,29 @@ def test_household_owns_tv_can_be_set_false(self):
154154
assert result[0] == False
155155

156156

157+
class TestDefaultDatasetUrl:
158+
"""Test that the default dataset URL points at the private HF repo."""
159+
160+
def test_simulation_defaults_to_private_hf_repo(self, monkeypatch):
161+
captured = {}
162+
163+
class _StopDefaultDatasetLoad(Exception):
164+
pass
165+
166+
def fake_build_from_url(self, url):
167+
captured["url"] = url
168+
raise _StopDefaultDatasetLoad
169+
170+
monkeypatch.setattr(Simulation, "build_from_url", fake_build_from_url)
171+
172+
with pytest.raises(_StopDefaultDatasetLoad):
173+
Simulation()
174+
175+
assert captured["url"] == (
176+
"hf://policyengine/policyengine-uk-data-private/enhanced_frs_2023_24.h5"
177+
)
178+
179+
157180
class TestIsHigherEarner:
158181
"""Test deterministic tie-breaking for is_higher_earner."""
159182

0 commit comments

Comments
 (0)