Skip to content
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

fix lags_past_covariates dict type breaks lags_future_covariates when output_chunk_shift>0 #2655

Conversation

authierj
Copy link
Contributor

@authierj authierj commented Jan 27, 2025

Checklist before merging this PR:

  • Mentioned all issues that this PR fixes or addresses.
  • Summarized the updates of this PR under Summary.
  • Added an entry under Unreleased in the Changelog.

Fixes #2652

Summary

  • When initiating a RegressionModel with lags_past_covariates as dict and lags_future_covariates as some other type (not dict) and output_chunk_shift>0, an error occurred.
  • This was because lags_future_covariate is not a component lag and should therefore not be handled at any point by processed_component_lags.
  • Adjusting the if statement in line 396 of regression_model.py fixes the bug.

Other Information

None

@authierj authierj marked this pull request as ready for review January 27, 2025 17:02
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.18%. Comparing base (c48521c) to head (83d1d59).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2655      +/-   ##
==========================================
- Coverage   94.23%   94.18%   -0.06%     
==========================================
  Files         141      141              
  Lines       15509    15510       +1     
==========================================
- Hits        14615    14608       -7     
- Misses        894      902       +8     

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

…lags_future_covariates_when_output_chunk_shift
Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @authierj.

Would be good to add a unit test to cover this in the future :)

@authierj authierj requested a review from dennisbader January 31, 2025 11:56
Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

Great job, thanks a lot @authierj. Also, congrats to your first contribution 🚀

@dennisbader dennisbader merged commit 1ca1e11 into unit8co:master Jan 31, 2025
9 checks passed
@authierj authierj deleted the fix/lags_past_covariates_dict_type_breaks_lags_future_covariates_when_output_chunk_shift branch January 31, 2025 13:13
ymatzkevich pushed a commit to ymatzkevich/darts that referenced this pull request Feb 6, 2025
… output_chunk_shift>0 (unit8co#2655)

* if clause modified to correct bug

* contribution added to changelog

* implemented modifications from reviewer

* unit tests added

---------

Co-authored-by: “authierj” <“[email protected]”>
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.

[BUG] lags_past_covariates dict type breaks lags_future_covariates when output_chunk_shift>0
2 participants