Issue 2131 - added a predictor validation check in analysis for annual and monthly tables#2192
Merged
Issue 2131 - added a predictor validation check in analysis for annual and monthly tables#2192
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive validation mechanism for detecting and surfacing missing predictor data in monthly and annual analysis summaries. The implementation adds warning flags (missingValueWarning for monthly, missingPredictorValue for annual) that propagate through the data pipeline from calculation classes to UI components, ultimately displaying warning banners to users when predictor data is incomplete.
- Enhanced data models and calculation classes to track missing predictor/production data across analysis types
- Added UI warning banners to monthly and annual analysis summary tables to alert users of incomplete data
- Improved validation service data retrieval to be more explicit about facility-specific data
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/app/models/analysis.ts |
Added missingValueWarning field to MonthlyAnalysisSummaryData interface and missingPredictorValue field to AnnualAnalysisSummary interface |
src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts |
Implemented predictor/production data validation logic with isPredictorDataMissing and isProductionDataMissing methods for regression and energyIntensity analysis types |
src/app/calculations/analysis-calculations/monthlyFacilityAnalysisDataClass.ts |
Added setMissingPredictorWarning method to check for missing predictor data at facility level |
src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts |
Propagates missing value warnings by aggregating from monthly data classes |
src/app/calculations/analysis-calculations/monthlyAnalysisSummaryClass.ts |
Passes through missingValueWarning flag when creating monthly analysis summary data |
src/app/calculations/analysis-calculations/monthlyFacilityAnalysisClass.ts |
Passes through missingValueWarning flag when creating facility-level monthly analysis data |
src/app/calculations/analysis-calculations/monthlyAccountAnalysisClass.ts |
Passes through missingValueWarning flag when creating account-level monthly analysis data |
src/app/calculations/analysis-calculations/annualAnalysisSummaryDataClass.ts |
Implements setMissingPredictorValue to aggregate monthly warnings into annual flag |
src/app/calculations/analysis-calculations/annualGroupAnalysisSummaryClass.ts |
Passes through missingPredictorValue flag to group-level annual summaries |
src/app/calculations/analysis-calculations/annualFacilityAnalysisSummaryClass.ts |
Passes through missingPredictorValue flag to facility-level annual summaries |
src/app/calculations/analysis-calculations/annualAccountAnalysisSummaryClass.ts |
Passes through missingPredictorValue flag to account-level annual summaries |
src/app/shared/shared-analysis/monthly-analysis-summary-table/monthly-analysis-summary-table.component.ts |
Added checkPredictorData method and state variables to track and display missing predictor warnings; added optional chaining for group properties |
src/app/shared/shared-analysis/monthly-analysis-summary-table/monthly-analysis-summary-table.component.html |
Added warning alert banner displaying count of months with missing predictor data; added optional chaining for group property access |
src/app/shared/shared-analysis/annual-analysis-summary-table/annual-analysis-summary-table.component.ts |
Added checkPredictorData method to detect missing predictors in annual summaries; added optional chaining for group properties |
src/app/shared/shared-analysis/annual-analysis-summary-table/annual-analysis-summary-table.component.html |
Added warning alert banner for missing predictor data; added optional chaining for group property access |
src/app/shared/helper-services/analysis-validation.service.ts |
Updated data retrieval to use explicit facility-specific methods instead of relying on observable values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...red/shared-analysis/annual-analysis-summary-table/annual-analysis-summary-table.component.ts
Show resolved
Hide resolved
src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts
Show resolved
Hide resolved
src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts
Show resolved
Hide resolved
...d/shared-analysis/monthly-analysis-summary-table/monthly-analysis-summary-table.component.ts
Show resolved
Hide resolved
rmroot
approved these changes
Jan 7, 2026
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.
connects #2131
This pull request introduces a new mechanism for detecting and surfacing missing predictor data across monthly and annual analysis summaries. The changes propagate a
missingValueWarning(monthly) andmissingPredictorValue(annual) throughout the data models, calculation classes, and UI, culminating in a warning message for users when predictor data is incomplete.The most important changes are:
Data Model & Calculation Enhancements:
missingValueWarningtoMonthlyAnalysisSummaryDataClass,MonthlyFacilityAnalysisDataClass, and their summation/calculation classes, with new logic to determine if predictor or production data is missing for a given month.missingPredictorValuetoAnnualAnalysisSummaryDataClassand related calculation classes, with logic to aggregate monthly warnings into an annual flag.Interface & Data Propagation:
MonthlyAnalysisSummaryData,AnnualAnalysisSummary) to include the new warning fields.UI Enhancements: