Skip to content

Commit

Permalink
Partially revert backport of PR #412 (some dev code slipped in)
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Apr 5, 2022
1 parent cefabed commit d5250c9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
14 changes: 0 additions & 14 deletions documentation/changelog.rst
Expand Up @@ -2,20 +2,6 @@
FlexMeasures Changelog
**********************

v0.10.0 | April XX, 2022
===========================


New features
-----------

Bugfixes
-----------

Infrastructure / Support
----------------------


v0.9.2 | April XX, 2022
===========================

Expand Down
5 changes: 0 additions & 5 deletions flexmeasures/data/models/charts/belief_charts.py
@@ -1,12 +1,9 @@
from __future__ import annotations

from flexmeasures.data.models.charts.defaults import FIELD_DEFINITIONS
from flexmeasures.utils.flexmeasures_inflection import capitalize


def bar_chart(
sensor: "Sensor", # noqa F821
unique_source_names: list[str] | None = None,
**override_chart_specs: dict,
):
unit = sensor.unit if sensor.unit else "a.u."
Expand All @@ -16,8 +13,6 @@ def bar_chart(
stack=None,
**FIELD_DEFINITIONS["event_value"],
)
color_definition = FIELD_DEFINITIONS["source"]
color_definition["scale"] = {"domain": unique_source_names}
chart_specs = {
"description": "A simple bar chart.",
"title": capitalize(sensor.name),
Expand Down
6 changes: 0 additions & 6 deletions flexmeasures/data/models/time_series.py
Expand Up @@ -141,11 +141,6 @@ def is_strictly_non_negative(self) -> bool:
"is_consumer", True
)

@property
def unique_sources(self) -> List[DataSource]:
"""List unique sources that have registered data for this sensor, ordered by id."""
return DataSource.query.join(TimedBelief).filter(TimedBelief.sensor_id == self.id).filter(TimedBelief.source_id == DataSource.id).order_by(DataSource.id).all()

def get_attribute(self, attribute: str, default: Any = None) -> Any:
"""Looks for the attribute on the Sensor.
If not found, looks for the attribute on the Sensor's GenericAsset.
Expand Down Expand Up @@ -339,7 +334,6 @@ def chart(
chart_specs = chart_type_to_chart_specs(
chart_type,
sensor=self,
unique_source_names=[source.name for source in self.unique_sources],
dataset_name=dataset_name,
**kwargs,
)
Expand Down

0 comments on commit d5250c9

Please sign in to comment.