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

revert (refactoring): avoid duplicating large docstring #781

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Aug 1, 2023

This PR is my suggestion to revert the refactoring part of aa32839.

It prepends the pyomo model to the return tuple of the device_scheduler, which prevents duplicating a large docstring at the cost of introducing a breaking change in the function signature of the device_scheduler (but no external code uses that function to the best of my knowledge).

… tuple of the device_scheduler; this prevents duplicating a large docstring at the cost of introducing a breaking change in the function signature of the device_scheduler (but no external code uses that function to the best of my knowledge)

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.15.0 milestone Aug 1, 2023
@Flix6x Flix6x self-assigned this Aug 1, 2023
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.

Thanks! Much better like this 😄

@victorgarcia98 victorgarcia98 merged commit 7a0f929 into feature/no-energy-leakage Aug 2, 2023
5 of 7 checks passed
@victorgarcia98 victorgarcia98 deleted the feature/no-energy-leakage-avoid-duplicate-docstrings-in-device_scheduler branch August 2, 2023 07:47
Flix6x added a commit that referenced this pull request Aug 3, 2023
…ces) (#770)

Add binary constraint to avoid energy leakages during periods with negative prices.


* add highs to requirements

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

* docs: add changelog entry

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

* fix: get results with infeasible termination status instead of RuntimeError

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

* feat: add Binary constraint to prevent energy losses, and start new test against negative prices

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

* fx: avoid double solving

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

* style: fix HiGHS capitalization

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

* remove HiGHS from requirements

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

* remove dependency

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

* add dependency back

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

* docs: document how to install HiGHS

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

* add HIghs to Dockerfile

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

* remove extra lines

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

* fix typos

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

* load solution when termination_condition!=infeasible

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

* refactor: run data preparation step in a different method

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

* refactor: create run_device_scheduler function to return model and results objects and using it in the device_scheduler function

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

* add asserts and docstring in test_battery_solver_day_3

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

* add documentation for the constraints device_up_derivative_sign and device_down_derivative_sign

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

* install HiGHS in the CI testing env

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

* address some textual changes

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

* fx CBC capitalization

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

* fix grammar

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

* check if there are results in a more robustly

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

* little fixes

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

* improve docstring of _prepare

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

* fix definition of M

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

* improve test

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

* reorder installation instructions for CBC and HiGHS

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

* add production price fixture

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

* fix loading results twice

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

* remove TODO

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

* increment StorageScheduler version

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

* add changelog entry

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

* fix conftest

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

* update test_hashing with a new hash due to the change in the version of the StorageScheduler

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

* feat: in play mode, allow showing any sensor on the asset page (#740)

This PR uses the FlexMeasures play mode to allow showing sensors across organisations. When showing simulation results, we want to be able to show results from different scenarios (stored under different accounts) on the same asset page. For example, when comparing a scenario against some other benchmark scenario.


* feat: in play mode, allow showing any sensor on the asset page

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

* fix checking for config value

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* more consistent naming of account variable

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* chore: rename variable of accessible sensors for readability

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* docs: mention this new possibility in function docstring

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* fix: do not fail if sensors are not accessible, log a warning for them as well

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* docs: changelog entry

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

* docs: changelog warning

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

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>

* fix fixture

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

* fix: changelog

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

* revert (the refactoring part of aa32839): prepend model to the return tuple of the device_scheduler; this prevents duplicating a large docstring at the cost of introducing a breaking change in the function signature of the device_scheduler (but no external code uses that function to the best of my knowledge) (#781)

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

* clean code and latitude, longitude and  account_id to get_or_create_generic_asset

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

* add highspy to test.txt and test.in

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

* fix: typos

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

* fix: test that needs to get the battery object

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

* fix: typo

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

* docs: clarify choice of SoC values in test

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

* fix: test case 2 says it tests for no oscillation, which is only guaranteed when prefer-charging-sooner is true; otherwise, the solver will be completely indifferent to oscilations during the period with negative prices

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

* style: streamline variable names in test

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

* revert 48fd692: unnecessary after #695

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

* style: black

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

* remove installation of highspy as it's already being installed through the test requirements.

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

* fix (docs): comment out cross reference to masked documentation page

Signed-off-by: F.N. Claessen <felix@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>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Co-authored-by: Victor Garcia Reolid <victor@seita.nl>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>
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