Icf off model references #87
Open
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
This PR refactors the off-model calculator system to eliminate external dependencies and modernize data handling. Two major improvements: (1) variable locations now read directly from Excel files instead of external CSV, and (2) output extraction supports new vertical data format with transformation layer for pipeline compatibility.
Changes Overview
1. Variable Location Refactoring (
helper/calcs.py)Eliminated external CSV dependency - Variable locations now read directly from each calculator's Excel file.
Changes to
get_variable_locations()method:Before:
After:
2. Output Format Migration (
extract_offmodel_results.py)Added support for vertical output format with transformation layer for pipeline compatibility.
New
read_output_data()function:Purpose: Read vertical format data from Excel and transform to horizontal format expected by downstream pipeline Data Format Transformation: Old horizontal format (in Output tab):
Horizon Run ID | Out_daily_GHG_reduced_2035 | Out_per_capita_GHG_reduced_20352035_TM160_... | 7.100242 | -0.000096New vertical format (in Output_test tab):
Sheet | Variable Name | ValueMain Sheet | Out_daily_GHG_reduced_2035 | 7.100242Main Sheet | Out_per_capita_GHG_reduced_2035| -0.000096Updated
extract_off_model_calculator_result():read_output_data()to handle vertical formatOutput_testtabMigration Notes
Pre-Deployment Requirements:
Before this PR can be merged:
Output_testtab addedOutput_testtab must follow vertical format structureCurrent State:
Output_testtab (new vertical format)Outputtab can coexist during transition'Output_test'(line 129)Post-Deployment Steps:
Output_test→Outputin all Excel calculatorsextract_offmodel_results.py: changeoutput_tab_name='Output_test'tooutput_tab_name='Output'Outputtabs from Excel filesVariable_locationsCSV file.