-
Couldn't load subscription status.
- Fork 2
Add a new Interval class based on the SDK Bounds
#19
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
Merged
Conversation
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
The code was pulled from: * https://github.com/frequenz-floss/frequenz-sdk-python/blob/9e34c9d5f66ea1febfc7b5c10aeac6cfbddea537/src/frequenz/sdk/timeseries/_base_types.py#L137-L182 * https://github.com/frequenz-floss/frequenz-sdk-python/blob/9e34c9d5f66ea1febfc7b5c10aeac6cfbddea537/tests/timeseries/test_base_types.py#L7-L42 Signed-off-by: Leandro Lucarella <[email protected]>
This fixes the tests by removing the dependency on the SDK. Signed-off-by: Leandro Lucarella <[email protected]>
This is part of the public API so it should have a public name and documentation. Signed-off-by: Leandro Lucarella <[email protected]>
To check if a value is within the bounds of a `Bounds` instance, we only need to be able to compare with less-than (`__lt__`). This impose less restrictions on the inner type of `Bounds`, and matches what other built-in functions work in Python (like `sorted`). Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
`Bounds` will be used to represent a set of `Interval`s in the future. Signed-off-by: Leandro Lucarella <[email protected]>
The start can't be bigger than the end and we raise a `ValueError` in that case. Signed-off-by: Leandro Lucarella <[email protected]>
|
Skipping release notes because I will write a summary for the release, as it will be the first release. |
This was
linked to
issues
Jun 27, 2024
Closed
2 tasks
Marenz
approved these changes
Jun 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cmd:skip-release-notes
It is not necessary to update release notes for this PR
part:collections
Affects the collections module
part:tests
Affects the unit, integration and performance (benchmarks) tests
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.
This new class is based on the SDK
Boundsclass. It is renamed toIntervalpartly because this is a more generic repo and this is a more generic name, but also because we will addBoundsclass in the future to represent multiple (inclusion) intervals, which is how the new microgrid API handle bounds.Fixes #11, #12, #13, #15.