Merged
Conversation
New global parameters for NREL REC URL, GREEN energy and OVERFLOW energy fuel categories.\nNew utility functions to find the header row based on keyword search in an Excel workbook, get Balancing authority map (dict version of read ba codes), map a data frame BA names to codes, and to download NREL REC voluntary renewable sales workbook. Updated writing to CSV in outputs directory with new option to compress to zip.\nNew module for residual grid mix calculation (dataframe creation only).
New global parameters for tracking REM configuration settings; only updated YAML files for 2022-2024; should also update 2016 through 2021
The main effort here is the helper, _make_rem_mix_process, which is based on residual_grid_mix module in olca-tools repo. Notable updates to _process helper and its dependencies to make this work with pre-formatted dictionaries and ISO time stamps.
new subroutine for making residual consumption mix processes. The logic is to create all consumption mix processes, mapping the original process UUIDs to new residual UUIDs, then loop over exchanges to update default providers of all residual consumption processes. Development testing ran successfully; need to test new standalone methods. Consider putting default provider updating into its own helper function.
see SANDBOX for example test, which uses a previously run ELCI_2023 JSON-LD to test.
output residual mix parameter handles the CSV creation of BA-level residual mixes and saves to outputs folder. add_rem_product_systems parameter triggers the creation of Electricity; at user; residual consumption mix processes to become product systems (in addition to the non-residual mix processes).
Add validation for output_residual_mix and add_residual_mix settings.
frankhanna94
approved these changes
Dec 29, 2025
frankhanna94
left a comment
There was a problem hiding this comment.
I made a minor change in model_config.py for error handling if 'output_residual_mix' = True but 'add_residual_mix' = False
31 tasks
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
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.
This pull request is to incorporate residual mix processes and product systems into the ElectricityLCI (NETL-RIC#276) using methods described in Davis et al. (2025).1 The proposed change adds five new configurable parameters:
and six new global parameters introduced to globals.py:
See
__doc__string in new residual_grid_mix.py module for explanation of the residual grid mix method. Only one weighting method is employed (i.e., the facility 'county' method). Theadd_residual_mixesmethod is added to therun_post_processesmethod in __init__.py, which only triggers new residual process creation if configured within the YAML. Residual processes take advantage of the existing_processmethod in olca_jsonld_write.py and are assigned UUIDs based on the new process name (see_make_residual_process_name). Two additional helper functions (i.e.,_make_rem_gen_processand_make_rem_con_process) support the creation of "Electricity; at grid; residual generation mix", "Electricity; at grid; residual consumption mix", and "Electricity; at user; consumption mix" processes for each region.If the user selects "add_rem_product_system" in the YAML, the "at user; residual consumption mix" processes are converted to product systems using the default providers.
If the user selects, "output_residual_mix", a CSV file is located in the electricitylci/output data store to show the original fuel-based generation (in MWh) and ratio along with the new non-REC generation and ratio.
This method was successfully tested on "ELCI_2023" configuration, producing residual processes and product systems on macOS 14 using Python 3.12 and developer version of fedelemflowlist (from KeyLogicLCA's forked repository), esupy (0.4.2), and StEWI (1.2.0).
Footnotes
Tyler W. Davis, Matthew Jamieson, Becca Rosen, Joseph Chou, elci_to_rem, 1/21/2025, https://edx.netl.doe.gov/dataset/elci_to_rem, DOI: 10.18141/2503966. ↩