-
Notifications
You must be signed in to change notification settings - Fork 0
Configure first RI run with default configs #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sherryzuo
wants to merge
46
commits into
main
Choose a base branch
from
143-make-run_scenariopy-for-run-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
…m/switchbox-data/rate-design-platform into 143-make-run_scenariopy-for-run-1
…m/switchbox-data/rate-design-platform into 143-make-run_scenariopy-for-run-1
CAIRO expects tariff_params keys to match tariff_map tariff_key strings (e.g. "rie_a16"), but our get_default_tariff_structures was keying by file Paths. Changed tariff_paths from list[Path] to dict[str, Path] so param_grid keys align with what CAIRO uses internally.
…m/switchbox-data/rate-design-platform into 143-make-run_scenariopy-for-run-1
…CSV engine - Use script dir (__file__.parent) for path_project so paths work from any CWD - Add _load_cambium_marginal_costs in utils/cairo with engine='c' to avoid Arrow-backed in-place division failure when loading Cambium marginal costs - Import and call from run_scenario.py; remove local duplicate Co-authored-by: Cursor <[email protected]>
Drop _load_cambium_marginal_costs, return_buildingstock, _return_load, _initialize_tariffs, get_default_tariff_structures, _load_tariff_json, patch_postprocessor_weight_handling, DEFAULT_BUILDINGSTOCK_COLUMNS, and _LOAD_COL_RENAMES. These were temporary wrappers/patches superseded by recent CAIRO merges: sz/combined-bill-weight-merge, sz/tariff-paths-explicit, sz/return-buildingstock-columns-weight, and sz/bldg-id-index-handling. Retain patch_postprocessor_peak_allocation (pending CAIRO branch merge) and build_bldg_id_to_load_filepath (no core equivalent).
Switch _return_load, return_buildingstock, _load_cambium_marginal_costs, and _initialize_tariffs to their core CAIRO equivalents. Pass customer_count directly to return_buildingstock instead of calling reweight_customer_counts separately. Remove weight patch call (fixed upstream in CAIRO).
Injects a default weight=1.0 column into metadata parquets that lack one, writing a patched copy alongside the original. Fixes ValueError from CAIRO's __load_buildingstock__ requiring weight in schema. Also restores tariff_paths kwarg (available in latest CAIRO main).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Configures the first RI rate design scenario run (
run_scenario.py) with default configs against CAIRO, including all necessary data files, utility overrides, and supporting tooling. closes #142 #143CAIRO Overrides (
utils/cairo.py)return_buildingstock(): Custom metadata loader with configurable columns (DEFAULT_BUILDINGSTOCK_COLUMNS) and default weight whenweightcolumn is missing from parquet_return_load(): Custom load reader for per-building parquet files wherebldg_idis not the parquet index (ResStock format → CAIRO format)_initialize_tariffs(): Accepts explicittariff_paths: dict[str, Path]so tariff JSONs are loaded from project directories instead of CAIRO's internalconfig.TARIFFSDIRget_default_tariff_structures(): Takesdict[str, Path](tariff key → JSON path) instead of CAIRO's customer class iterationbuild_bldg_id_to_load_filepath(): Scans load directory with optionalbuilding_idsfilter to avoid loading all buildingspatch_postprocessor_weight_handling(): Fixes CAIRO bug where combined elec+gas bill merge losesweightcolumn due tosuffixes=("_elec", "_gas"), breakingpostprocess_group.*segmented bill statsRI Scenario (
rate_design/ri/hp_rates/)run_scenario.py: Full precalc run for RIE A-16 tariff with 5 prototype buildings, gas bill calculation, distribution cost params, and customer reweightingtariff_structure_rie_a16.json,tariff_structure_rie_a60.json,tariff_structure_dummy_gas.jsonprecalculation_testing.csv(elec),gas_tariff_map.csv(gas)distribution_cost_params.json: AESC 2024 + RI Energy Rate Case RY1 NCP paramsUtilities
utils/generate_precalc_mapping.py: Generate precalc period/tier mappings from tariff JSON (1-based indexing for PySAM)utils/create_flat_tariff.py: Create flat-rate URDB v7 tariff JSONstests/test_generate_precalc_mapping.py: Unit tests for precalc mapping generationNY Updates
rate_design/ny/hp_rates/run_scenario.py: Minor import updates to usebuild_bldg_id_to_load_filepathfromutils.cairoKey Fixes
tariff_pathsfromlist[Path]todict[str, Path]so keys matchtariff_map["tariff_key"]string valuesgenerate_default_precalc_mappingusesenumerate(start=1)to match PySAM/CAIRO period/tier convention_return_loadhandles files where bldg_id is not the index (ResStock per-building format)calculate_bill_stats_by_groupto restoreweightfrom metadata when missing in combined billsRemaining TODOs
year_dollar_conversion)Test plan
run_scenario.pyon EC2 end-to-end with 5 prototype buildings and verify outputs