Skip to content

Issue 2131 - added a predictor validation check in analysis for annual and monthly tables#2192

Merged
rmroot merged 1 commit intodevelopfrom
issue-2131
Jan 7, 2026
Merged

Issue 2131 - added a predictor validation check in analysis for annual and monthly tables#2192
rmroot merged 1 commit intodevelopfrom
issue-2131

Conversation

@jamlokim
Copy link
Copy Markdown
Contributor

@jamlokim jamlokim commented Jan 7, 2026

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) and missingPredictorValue (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:

  • Added missingValueWarning to MonthlyAnalysisSummaryDataClass, MonthlyFacilityAnalysisDataClass, and their summation/calculation classes, with new logic to determine if predictor or production data is missing for a given month.
  • Added missingPredictorValue to AnnualAnalysisSummaryDataClass and related calculation classes, with logic to aggregate monthly warnings into an annual flag.

Interface & Data Propagation:

  • Updated TypeScript interfaces (MonthlyAnalysisSummaryData, AnnualAnalysisSummary) to include the new warning fields.
  • Ensured all summary/aggregation classes (account, facility, group) propagate the missing predictor value to their respective summaries.

UI Enhancements:

  • Added a warning banner to the annual analysis summary table UI to alert users when predictor data is missing, and updated the component logic to check for and display this state.
  • Improved template bindings to handle optional chaining for group model properties in the summary table.

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.

@jamlokim jamlokim requested a review from rmroot January 7, 2026 18:03
@rmroot rmroot merged commit e352c2a into develop Jan 7, 2026
9 checks passed
@jamlokim jamlokim deleted the issue-2131 branch January 23, 2026 16:49
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.

3 participants