Skip to content

add charge and discharge efficiencies as sensors#933

Merged
Flix6x merged 26 commits intomainfrom
feature/planning/use-efficiency-from-sensor
Dec 21, 2023
Merged

add charge and discharge efficiencies as sensors#933
Flix6x merged 26 commits intomainfrom
feature/planning/use-efficiency-from-sensor

Conversation

@victorgarcia98
Copy link
Copy Markdown
Contributor

@victorgarcia98 victorgarcia98 commented Dec 18, 2023

Description

This PR introduces two new fields to the flex-model:

  • charge-efficiency
  • discharge-efficiency

These fields allow to define changing down/up efficiencies using a Sensor.


  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

Victor Garcia Reolid and others added 19 commits November 10, 2023 09:50
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
* refactor: fix spelling

Signed-off-by: F.N. Claessen <[email protected]>

* style: missing type annotation

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: method and variable renaming

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: add test case explanations

Signed-off-by: F.N. Claessen <[email protected]>

---------

Signed-off-by: F.N. Claessen <[email protected]>
* refactor: fix spelling

Signed-off-by: F.N. Claessen <[email protected]>

* style: missing type annotation

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: method and variable renaming

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: add test case explanations

Signed-off-by: F.N. Claessen <[email protected]>

* fix: separate logic for falling back on a default attribute and applying a maximum capacity limit

Signed-off-by: F.N. Claessen <[email protected]>

* fix: fill gaps in capacity sensor data using the max_value rather than with the fallback

Signed-off-by: F.N. Claessen <[email protected]>

* fix: type annotation (see https://docs.python.org/3/library/typing.html#typing.Optional)

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: clearly separate steps of falling back and performing a nanmin

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: simplify and have get_quantity_from_attribute return a Quantity, as its name already suggested

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: switch argument order

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: update docstring

Signed-off-by: F.N. Claessen <[email protected]>

* style: flake8

Signed-off-by: F.N. Claessen <[email protected]>

---------

Signed-off-by: F.N. Claessen <[email protected]>
…ery-power-capacity-as-sensor

Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Base automatically changed from feature/planning/battery-power-capacity-as-sensor to main December 19, 2023 08:55
@Flix6x
Copy link
Copy Markdown
Contributor

Flix6x commented Dec 19, 2023

@victorgarcia98 this PR became too hard to review (due to mixed contents) after the base automatically changed from feature/planning/battery-power-capacity-as-sensor to main. Can you clean it up?

Copy link
Copy Markdown
Contributor

@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 managed to review a few lines of code that probably actually belong in this PR. :)

This was linked to issues Dec 19, 2023
Victor Garcia Reolid added 2 commits December 19, 2023 20:32
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Copy link
Copy Markdown
Contributor

@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.

Looks good. Let's add the changelog entry and the minimum required documentation (I believe in api/notation.rst and the trigger endpoint), and ship it.

Copy link
Copy Markdown
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.

Found two smaller errors.

Victor Garcia Reolid added 2 commits December 20, 2023 22:28
Copy link
Copy Markdown
Contributor

@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.

Thanks for making the effort to get this in!

@Flix6x Flix6x added this to the 0.18.0 milestone Dec 21, 2023
@Flix6x Flix6x merged commit f5a14c8 into main Dec 21, 2023
@Flix6x Flix6x deleted the feature/planning/use-efficiency-from-sensor branch December 21, 2023 10:56
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.

use roundtrip-efficiency from Sensor Support for buffer assets

3 participants