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
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ def render_report(baseline: dict[str, Any], y2017: dict[str, Any]) -> str:
"",
"1. `usa_ghg_data_year` Literal excludes 2017 (breaks "
"`reconciling_data_years/model1.yaml`)",
"2. Electricity-disagg eGRID FBS is only defined for 2023/2024 "
"(`egrid_fbs_method_for_year`); 2017 has no eGRID-backed FBS",
"2. Electricity disaggregation only allows "
"(bea_published, 2023|2024) and (nowcast, 2024) on USAConfig; "
"2017 is outside that allow-list",
"3. USEEIO A-scale (`scale_a_matrix_with_useeio_method=True`) returns 2017 "
"base A and never calls `reanchor_electricity_aq_after_year_scaling`",
"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,24 @@ def _download(name: str, _sub: str, pth: str) -> None:
assert loaded['marker'].tolist() == [newer]


def test_pin_for_a_different_stem_raises(monkeypatch: pytest.MonkeyPatch) -> None:
def test_pin_wins_when_stem_differs_from_selected_base_name(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
"""Historical pins may use a retired stem while selection is year-only."""
name = 'GHG_national_Cornerstone_nowcast_facilities_2024_v0.3.0_3a1dddc.parquet'
_frame('pinned').to_parquet(tmp_path / name)
monkeypatch.setattr(derived, 'get_usa_config', lambda: _config(name))
with pytest.raises(ValueError, match='does not match'):
derived._load_cornerstone_ghg_fbs_from_gcs(
base_name='GHG_national_Cornerstone_nowcast_facilities_2023'
)
monkeypatch.setattr('bedrock.utils.config.settings.FBS_DIR', tmp_path)

def _no_download(*_a: object, **_k: object) -> None:
raise AssertionError('pinned file is already local')

monkeypatch.setattr('bedrock.utils.io.gcp.download_gcs_file', _no_download)

loaded = derived._load_cornerstone_ghg_fbs_from_gcs(
base_name='GHG_national_Cornerstone_2024'
)
assert loaded['marker'].tolist() == ['pinned']


def test_pin_without_a_git_hash_raises(monkeypatch: pytest.MonkeyPatch) -> None:
Expand Down
209 changes: 0 additions & 209 deletions bedrock/transform/allocation/__tests__/test_egrid_fbs_method.py

This file was deleted.

Loading
Loading