Fix model_dir NameError, optimize sunrise/sunset caching, replace assert with ValueError#3
Merged
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
…ty improvements Co-authored-by: bartzbeielstein <32470350+bartzbeielstein@users.noreply.github.com>
Co-authored-by: bartzbeielstein <32470350+bartzbeielstein@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix NameError in model_dir assignment scope
Fix model_dir NameError, optimize sunrise/sunset caching, replace assert with ValueError
Feb 11, 2026
Collaborator
|
copilot ai |
bartzbeielstein
added a commit
that referenced
this pull request
Jun 8, 2026
…robabilistic-head feat(forecaster): quantile-LightGBM probabilistic head factory (#3)
bartzbeielstein
pushed a commit
that referenced
this pull request
Jun 8, 2026
## [19.3.0-rc.2](v19.3.0-rc.1...v19.3.0-rc.2) (2026-06-08) ### Features * **forecaster:** quantile-LightGBM probabilistic head factory ([d44093f](d44093f)), closes [#3](#3)
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.
Addresses four code quality and correctness issues in
n2n_predict_with_covariates.py.Changes
Fix NameError when model_dir is None: Move
model_dir = get_cache_home() / "forecasters"inside the if block whereget_cache_home()is imported. Previously caused NameError due to scope issue.Cache sunrise/sunset per unique date: Normalize extended_index to unique calendar dates and compute
sun()once per date instead of per timestamp. Reduces redundant calculations by ~16-24x for hourly data.Replace assert with explicit ValueError: Change runtime validation from
assert sum(...) == 0toif missing_count != 0: raise ValueError(...). Assertions can be disabled with-Oflag.Split chained PolynomialFeatures call: Separate constructor and
set_output()into two lines for readability.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.