-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: extend DBFlexContextSchema validation to only allow valid units #1364
Conversation
Signed-off-by: Joshua Edward <[email protected]>
DBFlexContextSchema |
…rom FlexContextSchema Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this works well, I have a comment on making the code more explicit.
Signed-off-by: Joshua Edward <[email protected]>
…nto feat/flexcontext-extended-validation
Signed-off-by: Joshua Edward <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm happy!
(aside from one small docstring clarification about future work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding a lot of test cases! This made it easier to spot that we are not yet distinguishing correctly between energy prices and capacity prices.
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
…funciton Signed-off-by: Joshua Edward <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the new function works well. Thanks for adding the doctests, too. I only have a few more requests mostly regarding serializing the field names in error messages of the price fields.
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: Joshua Edward <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…schema, and have the message refer to the user-facing field name rather than the internal variable name Signed-off-by: F.N. Claessen <[email protected]>
…lex-context Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…than capacity prices Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job well done! Again, the addition of the various test cases really helped us to prevent introducing bugs, thank you for adding those. Units are tricky, but really well suited for unit tests (what's in a name).
Please note that I removed a validator that I suspected to be redundant. Specifically, passing a time series specification (as a list of dicts) to the DBFlexContextSchema
already lead to a ValidationError
, as you can see here, where the same test case (also) triggered an alternative message. I actually touched up that alternative message in e48a763 and 6065a5a.
I also made several corrections to distinguish energy prices from capacity prices.
Description
This PR extends the FlexContextSchema validation to also cover for field value unit validations
Look & Feel
No visual description as it's a backend
How to test
Further Improvements
In this PR I noticed a rarely occurring bug with the modal UI, a follow up PR will be made to fix this bug and another one reported by @nhoening
Related Items
This PR closes #1353