Skip to content

[BUG] Corrected typo in AggregationMetric.reset() from metrics to metric#2252

Merged
phoeenniixx merged 2 commits intosktime:mainfrom
Muhammad-Rebaal:aggregation-metric-reset-typo
Apr 12, 2026
Merged

[BUG] Corrected typo in AggregationMetric.reset() from metrics to metric#2252
phoeenniixx merged 2 commits intosktime:mainfrom
Muhammad-Rebaal:aggregation-metric-reset-typo

Conversation

@Muhammad-Rebaal
Copy link
Copy Markdown
Contributor

@Muhammad-Rebaal Muhammad-Rebaal commented Apr 7, 2026

closes #2251

Description

When calling .reset() on AggregationMetric, the code originally referenced self.metrics.reset(). However, the assigned attribute in __init__ is singular (self.metric). This caused an AttributeError crashing any multi-epoch training validation loops using this metric.

Changes Made

  • Updated self.metrics.reset() to self.metric.reset() in pytorch_forecasting/metrics/base_metrics/_base_metrics.py.

CC : @phoeenniixx , @PranavBhatP

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@d389044). Learn more about missing BASE report.

Files with missing lines Patch % Lines
..._forecasting/metrics/base_metrics/_base_metrics.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2252   +/-   ##
=======================================
  Coverage        ?   86.92%           
=======================================
  Files           ?      166           
  Lines           ?     9767           
  Branches        ?        0           
=======================================
  Hits            ?     8490           
  Misses          ?     1277           
  Partials        ?        0           
Flag Coverage Δ
cpu 86.92% <0.00%> (?)
pytest 86.92% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@phoeenniixx phoeenniixx left a comment

Choose a reason for hiding this comment

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

Thanks!

@phoeenniixx phoeenniixx changed the title fix: Corrected typo in AggregationMetric.reset() from metrics to metric [BUG] Corrected typo in AggregationMetric.reset() from metrics to metric Apr 11, 2026
@phoeenniixx phoeenniixx added the bug Something isn't working label Apr 11, 2026
@phoeenniixx phoeenniixx merged commit 272ceff into sktime:main Apr 12, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Fixed/resolved

Development

Successfully merging this pull request may close these issues.

[BUG] AggregationMetric.reset() references non-existent self.metrics should be self.metric

2 participants