Skip to content

Issue 2118 - add additional fields and validation to user defined models#2181

Merged
rmroot merged 3 commits intodevelopfrom
issue-2118
Dec 18, 2025
Merged

Issue 2118 - add additional fields and validation to user defined models#2181
rmroot merged 3 commits intodevelopfrom
issue-2118

Conversation

@jamlokim
Copy link
Copy Markdown
Contributor

connects #2118

This pull request introduces significant enhancements to the regression model selection workflow, focusing on improved date range handling, validation, and error messaging for user-defined models. The changes add new properties to track both start and end dates for regression models, implement comprehensive validation to ensure data completeness and correct date ranges, and update the UI to provide clear feedback to users.

Key changes include:

Regression Model Date Range Enhancements

  • Added new properties to AnalysisGroup and related interfaces to support both start and end months and years for regression models, enabling more flexible and accurate date range selection. (src/app/models/analysis.ts, src/app/models/idbModels/analysisItem.ts)
  • Updated initialization and default value logic to ensure new and existing analysis groups have these date fields populated appropriately.

Validation and Error Handling

  • Implemented comprehensive validation in RegressionModelMenuComponent to check for:
    • Valid date ranges (end date after start date)
    • Minimum of 12 months selected
    • Presence of all required meter and predictor data within the selected range
    • Updated error tracking in GroupErrors and validation service to support new date fields.

User Interface Improvements

  • Enhanced the regression model selection UI to:
    • Display new input fields for selecting model start/end months and years
    • Show specific error messages when validation fails (e.g., invalid date range, insufficient data, missing readings)
    • Disable model evaluation when validation errors are present

Data Filtering and Model Inspection

  • Updated logic in the user-defined model inspection component to filter and display analysis data based on the full selected date range, rather than just a single year/month.

Error State Propagation

  • Ensured new error states for missing start/end months and years are correctly propagated and checked throughout the application, improving robustness and user feedback.

These changes collectively improve the accuracy, reliability, and user experience of the regression model selection and validation process.

@jamlokim jamlokim requested a review from rmroot December 10, 2025 17:23
Copy link
Copy Markdown
Member

@rmroot rmroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple things:

  1. We need to check on how this effects calculations. There is a model year baseline adjustment that happens based on the model year. I will talk to Kristina and Chris.
  2. I'm not sure it's working properly, I went to West energy analysis and switched the ProductionElectricity to User Defined Model and set Model Start Year to 2020 and didn't get an error of it being after Model End Year
  3. The tables for monthly and annual analysis that show a icon for the model year. Those need to be updated with the changes. Right now it's just a IF statement on the year, I'd recommend using a pipe.

@jamlokim jamlokim requested a review from rmroot December 17, 2025 21:36
@rmroot rmroot merged commit f330fb7 into develop Dec 18, 2025
3 checks passed
@jamlokim jamlokim deleted the issue-2118 branch January 12, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants