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

refactor: Constraint validation for cases A and B #702

Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented May 25, 2023

@victorgarcia98 If you feel this is a good direction to head in for refactoring, please take over the branch and keep the refactoring work in this separate PR.

Flix6x added 13 commits May 25, 2023 10:32
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Base automatically changed from review-fixes-max_min_soc_timeseries to max_min_soc_timeseries May 25, 2023 10:49
Flix6x and others added 8 commits May 25, 2023 12:50
…iew-refactoring-max_min_soc_timeseries

# Conflicts:
#	flexmeasures/data/models/planning/storage.py
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
…in}_extended` series

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
…straints

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
…ssions

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Copy link
Contributor

@victorgarcia98 victorgarcia98 left a comment

Choose a reason for hiding this comment

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

Updated the function validate_constraint to support arbitrary conditions with multiple elements.

Please, let me know any comment in the other PR 😄

@victorgarcia98 victorgarcia98 merged commit 9aed98f into max_min_soc_timeseries May 26, 2023
6 of 7 checks passed
@victorgarcia98 victorgarcia98 deleted the review-refactoring-max_min_soc_timeseries branch May 26, 2023 10:05
Copy link
Contributor Author

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

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

I already had some comments lined up in this PR, actually. So rather than moving them over, I'm posting them here.

FYI it's easier for me to review larger changes separately from the rest of PR #680, because I don't have to triage between code that is new and code that I've already reviewed.

victorgarcia98 added a commit that referenced this pull request May 29, 2023
…orageScheduler` (#680)

* fix: deprecated decorator wasn't returning the value of the moved callable.

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: update test to check that the decorator is returning

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* feat: add SOCValueSchema

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* feat: pass soc_maxima and soc_minima to device_scheduler
style: rename build_device_soc_targets to build_device_soc_values

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* feat: add test test_soc_bounds_timeseries

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* test: check for inequality rather than equality constraints

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: correcting sunset version

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* refactor: use new function

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* refactor: finishing refactor (I forgot two calls).

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* docs: update the endpoint trigger_schedule with an example on how to use soc_minima

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* feat: add constraint validation

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* docs: add chagelog entry

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* Review fixes max min soc timeseries (#700)

* style: sphinx docstrings

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: more detailed type annotation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: consistency

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: incomplete type annotation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: validation A.1)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation B.2)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.1)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.3)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.4)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* refactor: move statements to where they matter

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: consistency (also: https://books.google.com/ngrams/graph?content=infeasible%2Cunfeasible&year_start=1800&year_end=2019&corpus=en-2019&smoothing=0&case_insensitive=true )

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: Validation B.2)

Signed-off-by: F.N. Claessen <felix@seita.nl>

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>

* refactor: Constraint validation for cases A and B (#702)

* style: sphinx docstrings

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: more detailed type annotation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: consistency

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: incomplete type annotation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: validation A.1)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation B.2)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.1)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.3)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* fix: Validation C.4)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* refactor: move statements to where they matter

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: consistency (also: https://books.google.com/ngrams/graph?content=infeasible%2Cunfeasible&year_start=1800&year_end=2019&corpus=en-2019&smoothing=0&case_insensitive=true )

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: Validation B.2)

Signed-off-by: F.N. Claessen <felix@seita.nl>

* refactor: Constraint validation for cases A and B

Signed-off-by: F.N. Claessen <felix@seita.nl>

* style: fixing typos

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: add comments clarifying why we need to sort the `{equals, max, min}_extended` series

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* refactor:  create storage_device_constraints inside of add_storage_constraints

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* reactor: max_soc -> soc_max

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* reactor: min_soc -> soc_min

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* feat: update validate_constraint to accept arbitrary constraint expressions

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* style: fixing some refactor that affected the comments

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Co-authored-by: Victor Garcia Reolid <victor@seita.nl>

* style: remove left-over print

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: escape backslash in regex

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

---------

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Victor <victor@seita.nl>
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants