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

Issue 482 add scheduling test for maximizing self consumption #532

Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Nov 11, 2022

Closes #482.

This PR also adds a workaround for a still open flexmeasures issue that is waiting on a not yet merged timely-beliefs PR. This was needed to support looking up sensor data for a tariff sensor with the at_date knowledge horizon function. That test sensor now contains a single data point that defines the price for the entire year, and a search for data for any subperiod within that year should return the price valid during that period.

nhoening and others added 30 commits October 29, 2022 20:36
…factor its parameters and handling within the code for readability

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…rging_sooner part of storage specs & an optional parameter in API v3

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…we use name, but also in the new setting, unless we always include the user_id)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…al data source ID for this lookup if possible

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Add a pandas version check in initialize_index.


* Use initialize_series util function

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

* Update initialize_index for pandas>=1.4

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

* flake8

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

* Use initialize_index or initialize_series in all places where the closed keyword argument was used

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

* flake8

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

* mypy: PEP 484 prohibits implicit Optional

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

* black after mypy

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

Signed-off-by: F.N. Claessen <felix@seita.nl>
- Default min = 0
- Default max = the highest target value, or np.nan if there are no targets, which subsequently maps to infinity in our solver

Signed-off-by: F.N. Claessen <felix@seita.nl>
…eduler, too

Signed-off-by: F.N. Claessen <felix@seita.nl>
…ge Point scheduler)

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

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>
…torage-specs

# Conflicts:
#	documentation/changelog.rst
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>
…ero power values for missing values

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>
…f duplicate code

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x self-assigned this Nov 11, 2022
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@coveralls
Copy link
Collaborator

coveralls commented Nov 11, 2022

Pull Request Test Coverage Report for Build 3518285555

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 65.002%

Totals Coverage Status
Change from base Build 3495120819: 0.03%
Covered Lines: 6586
Relevant Lines: 9513

💛 - Coveralls

@Flix6x Flix6x marked this pull request as ready for review November 11, 2022 15:05
@Flix6x Flix6x requested a review from nhoening November 11, 2022 15:05
@Flix6x Flix6x added this to the 0.12.0 milestone Nov 11, 2022
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

Great, some comments for clarification of intentions.

flexmeasures/data/models/planning/tests/test_solver.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/tests/test_solver.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/tests/test_solver.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/tests/test_solver.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/tests/test_solver.py Outdated Show resolved Hide resolved
@nhoening
Copy link
Contributor

Also, no changelog entry?

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>
@Flix6x
Copy link
Contributor Author

Flix6x commented Nov 17, 2022

By now, that timely-beliefs PR has been merged. So I would remove the workaround and update timely-beliefs instead.

Also, no changelog entry?

What's your stance on changelog entries for adding tests that did not result in any changed logic? It's not a bug fix. So, under the infrastructure category?

@nhoening
Copy link
Contributor

Yes. Let's not do this with all tests, but this one seems cool.

Base automatically changed from refactor-scheduling-storage-specs to main November 18, 2022 07:50
…ing_test_for_maximizing_self-consumption

# Conflicts:
#	documentation/changelog.rst
#	flexmeasures/data/models/planning/tests/test_solver.py
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x requested a review from nhoening November 21, 2022 21:32
@Flix6x Flix6x merged commit 3c95759 into main Nov 21, 2022
@Flix6x Flix6x deleted the issue-482_Add_scheduling_test_for_maximizing_self-consumption branch November 21, 2022 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scheduling test for maximizing self-consumption
3 participants