-
Notifications
You must be signed in to change notification settings - Fork 64
ElectricTariff Outputs, Peak Load Scaling, Endpoint Updates #681
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
Conversation
Deleted the migration file 0093_electricloadoutputs_annual_peak_kw_and_more.py and added the year_one_billed_energy_rate_series ArrayField to the ElectricTariffOutputs model. This change likely reflects a schema update and migration reset to accommodate the new field.
Introduces multiple new fields to ElectricLoadOutputs and ElectricTariffOutputs models for tracking annual peak kW, monthly energy and peak demand, export series, and various billed rate series. Updates Julia HTTP handler to log processing steps and ensures certain result matrices are converted to vectors before response.
Added multiple new fields to the ElectricTariffOutputs model and migration to store URDB-related metadata, including label, rate name, utility, effective date, voltage level, rate description, peak kW capacity min/max, additional info, energy and demand comments, and URL link. These changes support enhanced storage and retrieval of utility rate information.
Adds custom_table_anccr with a comprehensive configuration including general info, rate analysis, annual and monthly costs, load metrics, URDB rate info, and detailed monthly breakdowns.
…on field instead of separate
…fix check for urdb_metadata
… input monthly_peaks_kw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces comprehensive support for electric load scaling and tariff analysis, including new monthly peak load handling, expanded tariff outputs with detailed cost breakdowns, and a new endpoint for load metrics calculation. The changes enable more granular analysis of electric loads and utility rates, particularly supporting rate comparison workflows.
Key Changes
- Added
monthly_peaks_kwinput toElectricLoadInputsfor scaling load profiles to monthly peaks while preserving monthly energy - Expanded
ElectricTariffOutputswith ~20 new fields for detailed monthly/TOU cost and rate breakdowns - Introduced
/get_load_metricsendpoint to calculate monthly/annual energy and peak loads from timeseries data
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| reoptjl/views.py | Added get_load_metrics endpoint; updated simulated_load to handle monthly_peaks_kw and support either normalize_and_scale or doe_reference_name; added rounding utility and updated data processing functions |
| reoptjl/urls.py | Registered new /get_load_metrics endpoint |
| reoptjl/models.py | Added monthly_peaks_kw to ElectricLoadInputs; added monthly/peak outputs to ElectricLoadOutputs; added urdb_metadata to ElectricTariffInputs; added 14 new fields to ElectricTariffOutputs for detailed cost/rate data |
| reoptjl/migrations/0110_electricloadinputs_monthly_peaks_kw_and_more.py | Database migration for all new model fields |
| reoptjl/src/process_results.py | Added ElectricTariff to inputs update logic |
| reoptjl/custom_table_helpers.py | Enhanced flatten_dict to handle arrays with indexed keys; updated sum_vectors to preserve monthly arrays |
| reoptjl/custom_table_config.py | Added new custom_table_rates configuration with ~700 lines of tariff comparison metrics |
| reoptjl/test/test_job_endpoint.py | Removed obsolete test exception for SteamTurbine |
| reoptjl/test/posts/*.json | Updated test fixtures with monthly_peaks_kw and simplified sector_defaults test |
| julia_src/http.jl | Added get_load_metrics function; updated simulated_load to handle monthly_peaks_kw; added logging; updated input conversion to Float64; added ElectricTariff to returned inputs |
| julia_src/Manifest.toml | Updated REopt.jl dependency to v0.56.0 |
| CHANGELOG.md | Documented all new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@rathod-b @gellwood this PR has all the new ElectricTariff outputs stuff, the new custom_table_rates (was _anccr), and the peak load scaling features we've developed for the ANCCR project. The peak load scaling stuff was separately reviewed in #680, so this is mainly to look over things that you two have developed with some updates from me. |
Clarifies comments and logic for hiding BAU columns in non-rates tables within the Excel workbook generation. No functional changes, only improved code readability.
|
@rathod-b @gellwood These updates are for the API only, not the web tool, but I tested the web tool on this API branch to make sure it didn't break anything, and it did not. The results and spreadsheet download in the webtool all behave the same. So that should give us confidence to deploy this publicly, which I'm hoping to do today or Monday at the latest. |
gellwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and nothing jumped out as being wrong. When reviewing I updated a couple comments but didn't notice anything else.
Combines, updates, and adds to these two PRs:
The addition is mainly this:
custom_table_ratestailored for a rate comparison, in the/generate_results_tableendpointAnd the database migrations were squashed into 1-2.
This pull request introduces new capabilities for handling electric load and tariff data, including support for monthly peak loads, expanded tariff outputs, and a new endpoint for load metrics. It also improves data processing and conversion logic, and updates the REopt.jl dependency to a new branch. The most important changes are grouped below:
Electric Load and Tariff Model Enhancements:
monthly_peaks_kwinput toElectricLoadInputsand corresponding outputs toElectricLoadOutputs, enabling scaling of load profiles to monthly peaks while preserving monthly energy. [1] [2]ElectricTariffOutputswith new fields for detailed cost, rate, and demand metrics, including monthly and time-of-use (TOU) breakdowns.urdb_metadatafield toElectricTariffInputsto store utility rate metadata from the Utility Rate Database API.API and Endpoint Improvements:
/get_load_metricsendpoint to process a timeseriesload_profileand return monthly/annual energy and peak loads. [1] [2]custom_table_ratestailored for a rate comparison, in the/generate_results_tableendpointmonthly_peaks_kwand ensure vectors are consistently converted toFloat64for accurate processing.Data Processing and Helper Functions:
flatten_dictincustom_table_helpers.pyto handle arrays by creating indexed keys, improving downstream data handling.sum_vectorsto preserve monthly arrays (e.g., those withmonthly_in the key) rather than summing them, supporting more granular reporting.Dependency Update:
Manifest.tomlto use theanccrbranch, ensuring access to the latest features and fixes.Logging and Error Handling:
Let me know if you want to dive deeper into any specific change or see how to use the new endpoint and model fields!