Skip to content
Snippets Groups Projects
Commit 8ea88529 authored by leufen1's avatar leufen1
Browse files

cleanup, remove outdated validate_station_old method

parent a2a6b331
Branches
Tags
5 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!317enabled window_lead_time=1,!295Resolve "data handler FIR filter",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #72448 passed
...@@ -285,38 +285,6 @@ class PreProcessing(RunEnvironment): ...@@ -285,38 +285,6 @@ class PreProcessing(RunEnvironment):
for k, v in attrs.items(): for k, v in attrs.items():
self.data_store.set(k, v) self.data_store.set(k, v)
def validate_station_old(self, data_handler: AbstractDataHandler, set_stations, set_name=None,
store_processed_data=True):
"""
Check if all given stations in `all_stations` are valid.
Valid means, that there is data available for the given time range (is included in `kwargs`). The shape and the
loading time are logged in debug mode.
:return: Corrected list containing only valid station IDs.
"""
t_outer = TimeTracking()
logging.info(f"check valid stations started{' (%s)' % (set_name if set_name is not None else 'all')}")
# calculate transformation using train data
if set_name == "train":
logging.info("setup transformation using train data exclusively")
self.transformation(data_handler, set_stations)
# start station check
collection = DataCollection()
valid_stations = []
kwargs = self.data_store.create_args_dict(data_handler.requirements(), scope=set_name)
for station in set_stations:
try:
dp = data_handler.build(station, name_affix=set_name, store_processed_data=store_processed_data,
**kwargs)
collection.add(dp)
valid_stations.append(station)
except (AttributeError, EmptyQueryResult):
continue
logging.info(f"run for {t_outer} to check {len(set_stations)} station(s). Found {len(collection)}/"
f"{len(set_stations)} valid stations.")
return collection, valid_stations
def transformation(self, data_handler: AbstractDataHandler, stations): def transformation(self, data_handler: AbstractDataHandler, stations):
if hasattr(data_handler, "transformation"): if hasattr(data_handler, "transformation"):
kwargs = self.data_store.create_args_dict(data_handler.requirements(), scope="train") kwargs = self.data_store.create_args_dict(data_handler.requirements(), scope="train")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment