Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Enforce forecast and history duration divisibility by time resolution #356

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

AUdaltsova
Copy link
Contributor

@AUdaltsova AUdaltsova commented Aug 9, 2024

Pull Request

Description

  • Added validation of config parameters in Wind, PV, NWP to check that forecast_minutes % time_resolution_minutes == 0 and history_minutes % time_resolution_minutes == 0 (if this doesn't hold it can cause inconsistent shape in samples). Might be useful to add for other data sources as well, but I wasn't sure if there's caveats I wouldn't be aware of
  • Added tests to check validation behaves as expected
  • Fixed validator -> field_validator version issue along the way. Might be pushing the scope a bit, but felt weird to leave as was using new syntax anyway (see pydantic: Upgrade validator to field_validator #318 )

Fixes #318 and 234 in PVNet

How Has This Been Tested?

Added tests in test_config

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@AUdaltsova AUdaltsova marked this pull request as ready for review August 12, 2024 09:27
Copy link
Contributor

@peterdudfield peterdudfield 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 doing this and the tests too

@AUdaltsova AUdaltsova merged commit 9ff98d2 into main Aug 12, 2024
3 checks passed
@AUdaltsova AUdaltsova deleted the time-divisibility branch August 12, 2024 10:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pydantic: Upgrade validator to field_validator
2 participants