Skip to content

Commit

Permalink
delete: remove obsolete WeatherSensorType class and weather module
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 Jul 13, 2023
1 parent ae84eeb commit 63d4cb7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion flexmeasures/data/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def configure_db_for(app: Flask):
from flexmeasures.data.models import ( # noqa: F401
time_series,
assets,
weather,
data_sources,
user,
task_runs,
Expand Down
30 changes: 0 additions & 30 deletions flexmeasures/data/models/weather.py
Original file line number Diff line number Diff line change
@@ -1,30 +0,0 @@
from flexmeasures.data import db
from flexmeasures.data.models.generic_assets import (
GenericAssetType,
)
from flexmeasures.utils.flexmeasures_inflection import humanize


class WeatherSensorType(db.Model):
"""
This model is now considered legacy. See GenericAssetType.
"""

name = db.Column(db.String(80), primary_key=True)
display_name = db.Column(db.String(80), default="", unique=True)

daily_seasonality = True
weekly_seasonality = False
yearly_seasonality = True

def __init__(self, **kwargs):
generic_asset_type = GenericAssetType(
name=kwargs["name"], description=kwargs.get("hover_label", None)
)
db.session.add(generic_asset_type)
super(WeatherSensorType, self).__init__(**kwargs)
if "display_name" not in kwargs:
self.display_name = humanize(self.name)

def __repr__(self):
return "<WeatherSensorType %r>" % self.name

0 comments on commit 63d4cb7

Please sign in to comment.