Add support for multiple CHP inputs and outputs in REopt API - #727
Merged
Conversation
Align julia_src/Manifest.toml with the uncommitted chp-expand update for REopt.jl PR #608. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…updates - validators.py: Check for duplicate names within CHP list inputs and raise validation error if found. Prevents silent data loss from name collisions. - process_results.py: Remove unsafe fallback to bulk-update all CHP rows when name is missing. Require explicit name for each CHP in list updates to ensure we target the correct database row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e PVs http.jl: Include ':name' in inputs_with_defaults_from_julia_chp and inputs_with_defaults_from_julia_pv arrays. This allows the API to identify which CHP/PV each set of defaults belongs to. - For PV: Handle both single PV (dict) and multiple PV (list) cases when extracting defaults from Julia. Previously only pvs[1] was used, causing other PVs to never receive defaults. process_results.py: Update PV handling to match CHP pattern - support both dict and list formats for PV updates. Each list item must have a 'name' field to identify the target PV row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 implements updates to the REopt API to support new inputs and outputs for Combined Heat and Power (CHP) systems, aligning with recent changes in the REopt.jl package.
Changes made:
Models Update (
models.py):CHPInputsandCHPOutputsrelationships fromOneToOneFieldtoForeignKeyto allow multiple CHP instances.Validation Logic (
validators.py):Results Processing (
process_results.py):API Response Assembly (
views.py):Database Migration:
These updates ensure that the API can now handle multiple CHP configurations in a manner consistent with existing PV handling, improving the flexibility and functionality of the REopt API.