-
Notifications
You must be signed in to change notification settings - Fork 64
Minor Fixes December 2025 #691
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
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 PR includes validation improvements for energy load inputs, pandas compatibility updates, and API enhancements. The changes allow zero values for annual energy fields in heating and cooling models, update pandas date range calls to use current syntax, and enable blended building type support in the POST endpoint for simulated loads.
Key changes:
- Updated minimum validators from 1 to 0.0 for annual energy fields across cooling, space heating, domestic hot water, and process heat load models
- Increased
annual_tonhourmaximum limit from 1.0e8 to 1.0e9 for better flexibility - Added
percent_sharesupport to the POST handler in/simulated_loadendpoint to enable campus/blended building types - Updated pandas
date_rangecalls from deprecatedfreq="1H",closed="left"tofreq="1h",inclusive="left"
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| reoptjl/models.py | Changed minimum validators from 1 to 0.0 for annual_tonhour and annual_mmbtu fields; increased annual_tonhour max to 1.0e9 |
| reoptjl/views.py | Added percent_share as an optional parameter in POST request handler for simulated_load endpoint |
| reoptjl/migrations/0105_alter_coolingloadinputs_annual_tonhour_and_more.py | Migration file reflecting model validation changes for annual energy fields |
| reoptjl/migrations/0113_merge_20251209_2338.py | Merge migration to resolve dependency conflicts between migration branches |
| reo/utilities.py | Updated pandas date_range syntax from deprecated parameters to current ones (freq="1h", inclusive="left") |
| CHANGELOG.md | Documented all changes including pandas syntax fix, percent_share addition, and validation updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,34 @@ | |||
| # Generated by Django 4.0.7 on 2025-09-26 14:42 | |||
Copilot
AI
Dec 10, 2025
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.
This migration was generated with Django 4.0.7, while the merge migration (0113) was generated with Django 4.2.26. This version inconsistency suggests the migration might have been generated some time ago. Consider regenerating this migration with the current Django version being used in the project to ensure consistency across migrations.
| # Generated by Django 4.0.7 on 2025-09-26 14:42 | |
| # Generated by Django 4.2.26 on 2025-09-26 14:42 |
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.
I don't think we want to do this, as it might make the production database think these migrations did not happen yet and then try to re-apply them.
adfarth
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.
Looks good!
This pull request focuses on improving input validation and updating migration files for the Django models related to load inputs. The main changes are lowering the minimum allowed values for several annual energy fields from 1 to 0, updating their maximum limits, and ensuring consistency between models and migrations. Additionally, there are minor updates to the way pandas date ranges are created in utility functions.
Model and Validation Updates:
annual_tonhourinCoolingLoadInputsfrom 1 to 0.0, and set the maximum to 1e9 for improved flexibility and error handling. (reoptjl/models.py)annual_mmbtuinSpaceHeatingLoadInputs,DomesticHotWaterLoadInputs, andProcessHeatLoadInputsfrom 1 to 0.0 for better input validation. (reoptjl/models.py) [1] [2] [3]Migration Updates:
0105_alter_coolingloadinputs_annual_tonhour_and_more.pyto reflect the new validation rules and help text for the affected fields. (reoptjl/migrations/0105_alter_coolingloadinputs_annual_tonhour_and_more.py)0113_merge_20251209_2338.pyto resolve migration dependencies. (reoptjl/migrations/0113_merge_20251209_2338.py)Utility Function Updates:
date_rangecalls to usefreq="1h"andinclusive="left"instead of deprecated arguments for better compatibility. (reo/utilities.py) [1] [2]