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

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

Merged
merged 10 commits into from Aug 1, 2023

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jun 21, 2023

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.

Follow-up:

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.15.0 milestone Jun 21, 2023
@Flix6x Flix6x requested a review from nhoening June 21, 2023 09:57
@Flix6x Flix6x self-assigned this Jun 21, 2023
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.

Looks good overall.

I suggest:

  • mentioning in line 437 that now this exception exists.
  • renaming sensor_map to allowed_sensor_map
  • what if an ID is in sensor_to_show, but not in allowed_sensor_map? I believe lines 482 and 484 would raise an error. Maybe catching that and logging a warning is better.

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>
…m as well

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

@Flix6x I did a couple changes here (as I needed this PR for a demo) and now I want you to review this PR, basically. (can happen next week)

@Flix6x
Copy link
Contributor Author

Flix6x commented Aug 1, 2023

I approve. Thanks for the fixes.

@Flix6x Flix6x requested a review from nhoening August 1, 2023 12:32
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 Aug 1, 2023

@nhoening Please check my changelog entry + warning.

@Flix6x Flix6x merged commit 700b935 into main Aug 1, 2023
4 checks passed
@Flix6x Flix6x deleted the feature/support-showing-sensors-from-any-account branch August 1, 2023 15:44
victorgarcia98 pushed a commit that referenced this pull request Aug 1, 2023
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>
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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants