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

Feature/planning/soft site power capacities #1118

Draft
wants to merge 95 commits into
base: feature/planning/relaxed-scheduler
Choose a base branch
from

Conversation

victorgarcia98
Copy link
Contributor

@victorgarcia98 victorgarcia98 commented Jul 4, 2024

Work in progress.

Distinguish interpretation of soc-max/min from soc-maxima/minima, and site-consumption/production-capacity from site-power-capacity, representing hard and soft constraints

Signed-off-by: Victor Garcia Reolid <[email protected]>
@victorgarcia98 victorgarcia98 requested a review from Flix6x July 4, 2024 11:46
@victorgarcia98 victorgarcia98 self-assigned this Jul 4, 2024
Copy link
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'll think about naming.

flexmeasures/data/models/planning/storage.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/storage.py Outdated Show resolved Hide resolved
@Flix6x Flix6x mentioned this pull request Jul 8, 2024
12 tasks
@Flix6x
Copy link
Contributor

Flix6x commented Jul 26, 2024

This PR only addresses site level power constraints at the moment and not any device level constraints. As it stands, I feel that soft constraints for site level power would be more cleanly modelled as site level commitments (to the DSO) based on the contracted capacities, with some (assumed, or even known) penalty. That should mostly happen outside of the device scheduler.

If we do address device-level soft constraints, we should think about them too in the context of introducing device-level commitments (two birds, one stone).

@victorgarcia98
Copy link
Contributor Author

I'm not sure we can model the mechanism that these PR introduces via commitments as they are defined at the moment.


Let's say we want to add two soft limits at 90 kW to a site of 100 kW.

We would add two commitments:

  • Commitment = 90 kW, $Price_{Up} = 100$, $Price_{Down} = 0$
  • Commitment = -90 kW, $Price_{Up} = 0$, $Price_{Down} = 100$

This would be equivalent to have a single commitment:

  • Commitment = 0 kW, $Price_{Up} = 100$, $Price_{Down} = 100$

This applies in general. For example, if we have two commitments, the EMS-commitment couples eq. is:

$$ \sum_{d\in Devices} Power(d, j) = Commitment(1) + Commitment(2) + Down(1, j) + Down(2, j) - Up(1, j) - Up(2, j) $$

which is, inf fact, equivalent of having an single equivalent commitment defined as:

$$ Commitment(3) = Commitment(1) + Commitment(2) $$

with the equivalent prices:

$$ Price_{Up}(3) = Price_{Up}(1) + Price_{Up}(2) $$

$$ Price_{Down}(3) = Price_{Down}(1) + Price_{Down}(2) $$


How is it modeled in this PR?

Parameters

  • ems_derivative_soft_{min,max}: upper/lower EMS soft limits
  • ems_flow_soft_relaxation_cost: cost of exceeding the soft limits.

Variables

  • ems_power_margin_{upper, lower}: how much the power is over/under the soft limit.

Constraints

  • ems_derivative_soft_margin_{upper, lower}: ensures that the variable ems_power_margin_{upper, lower} is not higher than the difference between the hard and soft limits.
  • ems_derivative_soft_lower_bound: makes the "margin" variables to track the difference between the soft limit and the EMS power.

Commitments model

The commitment appear in two equations:

    def ems_flow_commitment_equalities(m, j):
        """Couple EMS flows (sum over devices) to commitments."""
        return (
            0,
            sum(m.commitment_quantity[:, j])
            + sum(m.commitment_downwards_deviation[:, j])
            + sum(m.commitment_upwards_deviation[:, j])
            - sum(m.ems_power[:, j]),
            0,
        )

Which is equivalent to

$$ \sum_{d\in Devices} Power(d, j) = \sum_{c \in Commitments} [Commitment(c, j) + Down(c, j) - Up(c,j)] $$

and the objective functions:

        for j in m.j:
            for c in m.c:
                costs += m.commitment_downwards_deviation[c, j] * m.down_price[c, j]
                costs += m.commitment_upwards_deviation[c, j] * m.up_price[c, j]

@Flix6x
Copy link
Contributor

Flix6x commented Jul 27, 2024

We would add two commitments:

Commitment = 90 kW, $Price_{Up} = 100$, $Price_{Down} = 0$
Commitment = -90 kW, $Price_{Up} = 0$, $Price_{Down} = 100$

This would be equivalent to having a single commitment:

Commitment = 0 kW, $Price_{Up} = 100$, $Price_{Down} = 100$

This applies in general.

Counterexample: if the aggregate power flow is 50 kW, then in your first example the costs are 0, but in your second example the costs are 5$/h (assuming your prices are in $/MWh).

@victorgarcia98
Copy link
Contributor Author

We would add two commitments:
Commitment = 90 kW, PriceUp=100, PriceDown=0
Commitment = -90 kW, PriceUp=0, PriceDown=100
This would be equivalent to having a single commitment:
Commitment = 0 kW, PriceUp=100, PriceDown=100
This applies in general.

Counterexample: if the aggregate power flow is 50 kW, then in your first example the costs are 0, but in your second example the costs are 5$/h (assuming your prices are in $/MWh).

True, good point.

Case A)

  • Constraint: $50 = -90 + 90 + Down(1) + Down(2) + Up(1) + Up(2) = Down(1) + Down(2) + Up(1) + Up(2)$
  • Objective: $100 \cdot Up(1) + 0\cdot Up(2) + 0\cdot Down(1) + 100 \cdot Up(2) = 100 \cdot [Up(1) + Down(2)]$

Case B)

  • Constraint: $50 = 0 + Up(1) + Down(1) = Up(1) + Down(1) $
  • Objective: $100 \cdot [Up(1) + Down(1)]$

Wouldn't case A) be unbounded?

Let's assume $Down(2)$, which appears in the objective function, is any large value, e.g. 10 MW. This will make 100 EUR/MWh * 10 MW = 1000 EUR/h. We can compensate $Down(2)$ with $Up(2)$ which doesn't appear in the objective but appears on the constraint.

In general, we can set $Up(1)$ and $Down(2)$ to be any value which drive up/down the objective function and find values for $Up(2)$ and $Down(1)$ to fulfill the constraint.

victorgarcia98 and others added 18 commits July 29, 2024 14:17
* add types

* add changelog
* docs: add major caveat for ProcessScheduler

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

* fix: old class name

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

* style: linebreaks before headers

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

* docs: add cross reference

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

* fix: space

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

* docs: clarify BREAKABLE process type

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

* docs: introduce section on flex models

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

* docs: extend explanation of inflexible-device-sensors

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

* fix: changelog entry for #1131

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

* fix: missing space

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
…nima and soc-maxima (introduced in #680) (#1135)

Signed-off-by: F.N. Claessen <[email protected]>
* support most_recent_only, including new index. Also stopping a previous, very old, deprecation of the same name.

Signed-off-by: Nicolas Höning <[email protected]>

* chore: upgrade timely-beliefs dep

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

* clearer documentation of (new) search parameters

Signed-off-by: Nicolas Höning <[email protected]>

* add changelog entry

Signed-off-by: Nicolas Höning <[email protected]>

* move 0.23 PRs to the new 0.23 section (were erronously in 0.22)

Signed-off-by: Nicolas Höning <[email protected]>

---------

Signed-off-by: Nicolas Höning <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Co-authored-by: F.N. Claessen <[email protected]>
* Basic sensor info to sensor page

Signed-off-by: Nikolai <[email protected]>

* Move styles to .css + make table vertical

Signed-off-by: Nikolai <[email protected]>

* remove unwanted css

* update bootstrap layout

* remove info from header

* change title and capitalize the headers

* add table in a column div

* add sensor name

* pass only sensor instead of sensor_id to show sensor page

---------

Signed-off-by: Nikolai <[email protected]>
Signed-off-by: Nicolas Höning <[email protected]>
Co-authored-by: Nikolai <[email protected]>
Co-authored-by: Ahmad Wahid <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
* fix: use official OS name

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

* style: use line block to add space between table of contents and note

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

* docs: add port note for macOS users in another relevant place

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

* fix: link to URL

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

* docs: add comment in main body about where the FlexMeasures UI would normally be accessible

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

* docs: add port note for macOS users in the "On your PC" tab

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

* refactor: reuse note in two places

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

* docs: reference the same port note for docker+macOS users in the section about hosting with docker

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

* refactor: move tip to first occurrence of the `docker` command

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

* refactor: merge paragraphs

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
* style: remove non-breaking spaces from base template

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

* fix: update display property for Bootstrap >= 4

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

* docs: put back inline comment removed in #1058

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

* docs: expand on rationale in inline comment

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

* docs: changelog entry

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

* fix: breakpoint for collapsing menu and moving tooltip to caption should coincide also for intermediate screen sizes

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
* feat: zoom-in

Signed-off-by: Victor Garcia Reolid <[email protected]>

* docs: add changelog entry

Signed-off-by: Victor Garcia Reolid <[email protected]>

---------

Signed-off-by: Victor Garcia Reolid <[email protected]>
…1129)

* fix: support saving instantaneous beliefs as a list of one element

Signed-off-by: Victor Garcia Reolid <[email protected]>

* assert -> NotImplementedError

Signed-off-by: Victor Garcia Reolid <[email protected]>

* fix typo

Signed-off-by: Victor Garcia Reolid <[email protected]>

* improve message and fix test

Signed-off-by: Victor Garcia Reolid <[email protected]>

* fix: typo

Signed-off-by: Victor Garcia Reolid <[email protected]>

* move check to a schema validator

Signed-off-by: Victor Garcia Reolid <[email protected]>

* docs: changelog entry

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

* docs: API changelog entry

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

* style: consistent spacing

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

---------

Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Co-authored-by: F.N. Claessen <[email protected]>
* feat: dynamic account colors

Added options to add a priamary and secondary color when creating an account

Also fixed typo comment

A line in the css wasnt commented properly

* chore: removed experimental code

* refactor: edgecase handling and more

- Handled edge case for fetching color setting when accoutn has no consultant
- wrote test for color computation utils
- type hints additons
- ignored some docker volume folders

* chore: clearing unwanted DB changes

* refactor: code improvements

- type hinting
- segregattion of fucntionalities

The color hex validation is now in a seperate fuciton in the coding_utils file

* chore: removed Alembic comments

* chore: linting code

* fix: removed unwanted classes

* fix: removed unwanted css clases

* chore: cleared duplicate default definations

* chore: relocate hex color validation fucntion

* chore: clean up

* fix: resolving migration issues

- issue is being caused because of the existence of TWO HEADS

Foxed by manually editing the down_revisions of the new migration file

* chore: linting

* chore: more linting :)

* chore: more linting :)

* chore: more linting :)

* chore: resolving test issues

* chore: few changes

- type hint resolution
- typo fixing
- misc

* docs: added changelog for new feature(dynamic colors)

* docs: just a missing space

Signed-off-by: Felix Claessen <[email protected]>

* docs: mention white-labeling in changelog entry

Signed-off-by: Nicolas Höning <[email protected]>

---------

Signed-off-by: Felix Claessen <[email protected]>
Signed-off-by: Nicolas Höning <[email protected]>
Co-authored-by: Felix Claessen <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
* refactor: sync arg name

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

* refactor: sync internal property name

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

* refactor: flatten elif block

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

* refactor: allow string deserialization and allow setting a default source unit for interpreting values without a unit

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

* refactor: copy convert method

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

* fix: type annotation

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

* refactor: copy _serialize method

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

* refactor: adapt _serialize method

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

* refactor: adapt docstring

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

* refactor: update error message

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

* refactor: update type annotation

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

* refactor: merge schemas

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

* refactor: reduce number of blank lines

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

* fix: deprecate old classes

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

* fix: duplicate import

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

* docs: document status quo

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

* style: black

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

* style: flake8

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

* feature: allow interpreting float values as quantities based on a unit defined elsewhere, and specifically, let the StorageScheduler get its default SoC unit from the soc-unit field, which lets us allow time series values to be specified as string quantities while preserving backwards compatibility

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

* fix: maintain backwards compatibility for transforming Float fields into Quantity fields, by returning the magnitude upon deserialization

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

* docs: grammar

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

* docs: add todo

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

* fix: tests

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

* style: black

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

* docs: update V2G flex-model

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

* docs: update trigger endpoint examples

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

* docs: update other tutorials

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

* docs: update scheduling feature section

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

* feat: convert schedule results ffrom MW to sensor unit

Signed-off-by: Victor Garcia Reolid <[email protected]>

* feat: minimum list length for soc-gain and soc-usage

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

* refactor: apply default SoC unit to all fields starting with "soc_"

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

* refactor: move warning

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

* Revert "refactor: move warning"

This reverts commit 8cfe9fd.

* fix: update test

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

* refactor: move deserialization logic to dedicated class methods

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

* docs: fix comment about converting time series using to_unit

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

* refactor: rename new schema

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

* refactor: sync code order: 1) Sensor, 2) time series, 3) Quantity

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

* fix: add test and add missing logic for handling a list of dictionaries representing a time series

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

* fix: check for real numeric values

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

* docs: changelog entries

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

* docs: fix typo

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

* style: be more explicit about requiring the soc-unit field to be set

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

* docs: mention the new Marshmallow field

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

* docs: advise setting a unit per field explicitly

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

* refactor: simplify if statement

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

* refactor: move soc-unit guesswork into schema

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Felix Claessen <[email protected]>
Co-authored-by: Victor Garcia Reolid <[email protected]>
* refactor: sync arg name

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

* refactor: sync internal property name

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

* refactor: flatten elif block

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

* refactor: allow string deserialization and allow setting a default source unit for interpreting values without a unit

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

* refactor: copy convert method

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

* fix: type annotation

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

* refactor: copy _serialize method

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

* refactor: adapt _serialize method

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

* refactor: adapt docstring

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

* refactor: update error message

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

* refactor: update type annotation

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

* refactor: merge schemas

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

* refactor: reduce number of blank lines

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

* fix: deprecate old classes

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

* fix: duplicate import

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

* docs: document status quo

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

* style: black

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

* style: flake8

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

* feature: allow interpreting float values as quantities based on a unit defined elsewhere, and specifically, let the StorageScheduler get its default SoC unit from the soc-unit field, which lets us allow time series values to be specified as string quantities while preserving backwards compatibility

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

* fix: maintain backwards compatibility for transforming Float fields into Quantity fields, by returning the magnitude upon deserialization

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

* docs: grammar

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

* docs: add todo

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

* fix: tests

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

* style: black

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

* docs: update V2G flex-model

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

* docs: update trigger endpoint examples

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

* docs: update other tutorials

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

* docs: update scheduling feature section

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

* feat: convert schedule results ffrom MW to sensor unit

Signed-off-by: Victor Garcia Reolid <[email protected]>

* feat: minimum list length for soc-gain and soc-usage

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

* refactor: apply default SoC unit to all fields starting with "soc_"

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

* refactor: move warning

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

* Revert "refactor: move warning"

This reverts commit 8cfe9fd.

* fix: update test

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

* refactor: move deserialization logic to dedicated class methods

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

* docs: fix comment about converting time series using to_unit

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

* refactor: rename new schema

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

* refactor: sync code order: 1) Sensor, 2) time series, 3) Quantity

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

* fix: add test and add missing logic for handling a list of dictionaries representing a time series

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

* fix: check for real numeric values

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

* fix: remove section on singular vs plural keys, which is no longer valid for crucial endpoints

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

* feature: add section on variable quantities

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

* fix: update section on scheduling; specifically, most flex-context and flex-model fields are now variable quantity fields, so I've updated the footnote to explain the few fields that aren't (yet) a variable quantity field.

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

* fix: footnote order

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

* fix: lolcats grammar

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

* feature: explain the possibilities of the `TimedEventSchema`

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

* style: string asset types

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

* docs: changelog entries

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

* docs: fix typo

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

* style: be more explicit about requiring the soc-unit field to be set

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

* docs: add note about units living on the sensor

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

* docs: add cross-reference

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

* docs: API changelog entry

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

* docs: main changelog entry

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

* docs: mention the new Marshmallow field

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

* docs: advise setting a unit per field explicitly

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

* refactor: simplify if statement

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

* refactor: move soc-unit guesswork into schema

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

* refactor: set reference caption explicitly

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

* chore: resolve hidden merge conflict in API documentation versioning

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

* fix: revision file comment

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Felix Claessen <[email protected]>
Co-authored-by: Victor Garcia Reolid <[email protected]>
* feature: flex context prices as quantities

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

* style: black

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

* fix: get continuous time series of prices from quantity

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

* fix: another merge conflict and an outdated comment

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

* fix: catch programming error

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

* fix: self.to_unit is already a Quantity

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

* fix: add test case for converting sensor units to some denominator

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

* fix: add test cases for invalid input quantities

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

* fix: add test case for converting from %, and use to_preferred, which imo still shows better results than pint's .to_preferred (for our use cases), and is faster, because of not requiring a MILP to be solved

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

* fix: fix test for Python 3.8 with pint throwing a different exception at us

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

* docs: main changelog entry

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

* docs: API changelog entry

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

* refactor: simplify test parameterization

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

* feature: support variable price quantity as time series specification, incl. test

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

* fix: update argument defaults for backwards compatibility of old fields

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

* refactor: one less import statement

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

* refactor: move conversion to util

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

* refactor: get rid of self.any_unit

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

* docs: document new fields replacing the old fields

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

* fix: update argument name

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

* fix: get rid of deprecated argument warning

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

* fix: test

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
* add annotation types on upgrade

* update changelog

Signed-off-by: Ahmad Wahid <[email protected]>

* remove new types from model and add a check in upgrade command

Signed-off-by: Ahmad Wahid <[email protected]>

* add removed types

Signed-off-by: Ahmad Wahid <[email protected]>

---------

Signed-off-by: Ahmad Wahid <[email protected]>
Co-authored-by: Felix Claessen <[email protected]>
Flix6x and others added 18 commits October 23, 2024 23:20
* fix: footer stays at the bottom (not sticky!)

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

* docs: changelog entry

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
(cherry picked from commit 321ba71)
* Update account auditlog event_message

Signed-off-by: Mohamed Belhsan Hmida <[email protected]>

* Update asset auditlog event message

Signed-off-by: Mohamed Belhsan Hmida <[email protected]>

* Update test cases to account for asset aduit log message update

Signed-off-by: Mohamed Belhsan Hmida <[email protected]>

---------

Signed-off-by: Mohamed Belhsan Hmida <[email protected]>
(cherry picked from commit 62f6644)
* feat: globalize and simplify toasts

Signed-off-by: joshuaunity <[email protected]>

* chore: add to changelog

Signed-off-by: joshuaunity <[email protected]>

* fix: added missing bracket

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
(cherry picked from commit ac56313)
* chore: ongoing progress

Signed-off-by: joshuaunity <[email protected]>

* feat: paginate assets table in account detail page

Signed-off-by: joshuaunity <[email protected]>

* chore: retrying failed GH tests

Signed-off-by: joshuaunity <[email protected]>

* chore: added ot changelog

Signed-off-by: joshuaunity <[email protected]>

* core: little changes on API and views - still work in progress

Signed-off-by: joshuaunity <[email protected]>

* chore: work in progress

Signed-off-by: joshuaunity <[email protected]>

* refactor: update AssetAPI index to use None as page default for backward compatibiity

Signed-off-by: joshuaunity <[email protected]>

* refactor: swicth to using load_deault for our APIs (#1205)

Signed-off-by: joshuaunity <[email protected]>

* chore: little change

Signed-off-by: joshuaunity <[email protected]>

* chore: added to docstring

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Signed-off-by: JDev <[email protected]>
(cherry picked from commit 335495c)
* feat: search filter on sensor API

Signed-off-by: joshuaunity <[email protected]>

* feat: sensor API pagintion and search

Signed-off-by: joshuaunity <[email protected]>

* refactor: reduce code repitition and code size

Signed-off-by: joshuaunity <[email protected]>

* refactor: request changes

- relocated SearchField to dedicated file
- worked on event resolution formating

Signed-off-by: joshuaunity <[email protected]>

* feat: api to fetch all sensors under an asset

Signed-off-by: joshuaunity <[email protected]>

* feat: added filter feature for sensor table, both name and unit filtering

Signed-off-by: joshuaunity <[email protected]>

* feat: unit filter features on get sensors API

Signed-off-by: joshuaunity <[email protected]>

* refactor: asset sensor and sensors API changes

Signed-off-by: joshuaunity <[email protected]>

* feat: test case for asset_sensors API

Signed-off-by: joshuaunity <[email protected]>

* chore: few changes variable namings and import arrangement

Signed-off-by: joshuaunity <[email protected]>

* refactor: updated testcase with more checks and removed redundant code

Signed-off-by: joshuaunity <[email protected]>

* chore: little changes on test(waiting for comment resolution)

Signed-off-by: joshuaunity <[email protected]>

* chore: moved formatResolution func to base.html

Signed-off-by: joshuaunity <[email protected]>

* refactor: changes to asset sensors API and ISO formatter logic on forntend

Signed-off-by: joshuaunity <[email protected]>

* chore: removed hard coded asset ID in asset sensors test case

Signed-off-by: joshuaunity <[email protected]>

* feat: test to get all sensors

Signed-off-by: joshuaunity <[email protected]>

* fix: fix wrong imports

Signed-off-by: joshuaunity <[email protected]>

* refactor: expandd test cases for get sensors

Signed-off-by: joshuaunity <[email protected]>

* refactor: expanded test case

Signed-off-by: joshuaunity <[email protected]>

* chore: added to changelog

Signed-off-by: joshuaunity <[email protected]>

* chore: updated change log

Signed-off-by: joshuaunity <[email protected]>

* refactor: dynamic expected results for test case

Signed-off-by: joshuaunity <[email protected]>

* refactor: dynamic sensor name for test case

Signed-off-by: joshuaunity <[email protected]>

* chore: simplified testcase

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
(cherry picked from commit e8444d0)
#1211)

* fix: visualize 'forecasting script' data source as just a 'forecaster'

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

* docs: changelog entry

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

* style(docs): line breaks

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

---------

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

(cherry picked from commit 8427259)
Signed-off-by: F.N. Claessen <[email protected]>
* refactor: simple sorting *is* possible

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

* feat: improve names of stats (no over-capitalization)

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

* feat: report last event end rather than last event start

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

* feat: report event timing stats with UTC offset and conforming to ISO8601 rather than with a timezone that isn't that of the sensor

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

* fix: update test

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

* fix: 'status' not part of response anymore (this came from flask_json's `as_json`)

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

* Revert "fix: 'status' not part of response anymore (this came from flask_json's `as_json`)"

This reverts commit 71673ea.

* Revert "refactor: simple sorting *is* possible"

This reverts commit 08fa56f

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

* fix: no offset shorthand in test

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

* refactor: simple sorting **is** still possible (I hope)

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

* fix: end is sensor resolution of 10 minutes later

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

* style: black

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

* refactor: move config setting to Config class

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

* remove: redundant setting (the Config superclass has the same default)

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

* docs: changelog entry

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Felix Claessen <[email protected]>
(cherry picked from commit 008801b)
… button divs, but we still want much of the same styling (e.g. in plugins) (#1203)

Signed-off-by: F.N. Claessen <[email protected]>
(cherry picked from commit de652a7)
Signed-off-by: F.N. Claessen <[email protected]>
(cherry picked from commit e4077a9)
* dev: test sphinx 7.3.7

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

* fix: exclude sphinx 7.4.*

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

---------

Signed-off-by: F.N. Claessen <[email protected]>
(cherry picked from commit 8914e47)
* fix: only display deactivate btn if user is admin

Signed-off-by: joshuaunity <[email protected]>

* chore: expanded conditional coverage and added to changelog

Signed-off-by: joshuaunity <[email protected]>

* chore: modified changelog

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
(cherry picked from commit 1119bad)
Signed-off-by: F.N. Claessen <[email protected]>
(cherry picked from commit c7b3736)
* core: initilize repo

Signed-off-by: joshuaunity <[email protected]>

* refactor: access check logic tweak

Signed-off-by: joshuaunity <[email protected]>

* refactor: made logic more concise and added to chaneglog

Signed-off-by: joshuaunity <[email protected]>

* chore: extend use permssion checks for auditlog buttons

Signed-off-by: joshuaunity <[email protected]>

* chore: variable name change

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Signed-off-by: JDev <[email protected]>
(cherry picked from commit a0c0555)
* feat: limit sensor api search to asset

Signed-off-by: joshuaunity <[email protected]>

* chore: added to changelog

Signed-off-by: joshuaunity <[email protected]>

* chore: modify changelog

Signed-off-by: joshuaunity <[email protected]>

* refactor: removed extra permission checks and added extra filter layer

Signed-off-by: joshuaunity <[email protected]>

* chore: added test for filtering by asset id

Signed-off-by: joshuaunity <[email protected]>

* refactor: all_accessible sesnor logic revamp

Signed-off-by: joshuaunity <[email protected]>

* refactor: updated query param name, logic and docstring

Signed-off-by: joshuaunity <[email protected]>

* refactor: modified child asset query to be recursive

Signed-off-by: joshuaunity <[email protected]>

* refactor: more concise query

Signed-off-by: joshuaunity <[email protected]>

* refactor: extend test case

Signed-off-by: joshuaunity <[email protected]>

* chore: recommiting

Signed-off-by: joshuaunity <[email protected]>

* chore: update doc string

Signed-off-by: joshuaunity <[email protected]>

* refactor: update test case for post sensor

Signed-off-by: joshuaunity <[email protected]>

* refactor: update test case for post sensor v2

Signed-off-by: joshuaunity <[email protected]>

* chore: pushing a suggestion

Signed-off-by: joshuaunity <[email protected]>

* refactor: updated access logic for sensor index API

Signed-off-by: joshuaunity <[email protected]>

* chore: updated test case due to change in sensor index API

Signed-off-by: joshuaunity <[email protected]>

* chore: update doc string and logic hierachy

Signed-off-by: joshuaunity <[email protected]>

* refactor: updated logic and test case extentsion

Signed-off-by: joshuaunity <[email protected]>

* chore: update docstring and added extra testcase

Signed-off-by: joshuaunity <[email protected]>

* chore: added else statement

Signed-off-by: joshuaunity <[email protected]>

* chore: update testcase

Signed-off-by: joshuaunity <[email protected]>

* chore: test logic update

Signed-off-by: joshuaunity <[email protected]>

---------

Signed-off-by: joshuaunity <[email protected]>
Co-authored-by: Nicolas Höning <[email protected]>
(cherry picked from commit 3da3560)
* feat: test for Python 3.12

* feat: packages for Python 3.12

* fix: called_once_with should be assert_called_once_with

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

* fix: don't assert assert_method

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

* docs: changelog entry

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

* docs: add Python 3.12 classifier in setup.py

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

* fix: getting the status of a not yet queued job now results in an InvalidJobOperation; see rq/rq#2039

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

---------

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

(cherry picked from commit faf7f55)
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
@Ahmad-Wahid Ahmad-Wahid requested a review from Flix6x November 26, 2024 11:26
@Ahmad-Wahid
Copy link
Contributor

@Flix6x please look into the last two commits, that corrects the fallback attributes (production and consumption capacities).

Flix6x and others added 4 commits January 4, 2025 12:16
…tor (#1284)

* pop source_types and exclude_source_types

Signed-off-by: Victor Garcia Reolid <[email protected]>

* improve validation of methods. Now resample and groupby methods are valid

Signed-off-by: Victor Garcia Reolid <[email protected]>

* docs: changelog entry

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

* fix: capitalization

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

* docs: add docstring

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

* docs: add inline comments

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

---------

Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Co-authored-by: F.N. Claessen <[email protected]>

(cherry picked from commit 23bfefa)
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
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.

7 participants