Skip to content
Snippets Groups Projects
Commit 37a30a9f authored by leufen1's avatar leufen1
Browse files

test will now pass

parent 607fc803
Branches
Tags
6 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!317enabled window_lead_time=1,!297Resolve "BUG: data handler fails if no chem variable is used",!295Resolve "data handler FIR filter",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #66464 passed
...@@ -39,8 +39,7 @@ str_or_list = Union[str, List[str]] ...@@ -39,8 +39,7 @@ str_or_list = Union[str, List[str]]
class DataHandlerFilterSingleStation(DataHandlerSingleStation): class DataHandlerFilterSingleStation(DataHandlerSingleStation):
"""General data handler for a single station to be used by a superior data handler.""" """General data handler for a single station to be used by a superior data handler."""
# _requirements = remove_items(inspect.getfullargspec(DataHandlerSingleStation).args, ["self", "station"]) _requirements = remove_items(DataHandlerSingleStation.requirements(), "station")
_requirements = DataHandlerSingleStation.requirements()
_hash = DataHandlerSingleStation._hash + ["filter_dim"] _hash = DataHandlerSingleStation._hash + ["filter_dim"]
DEFAULT_FILTER_DIM = "filter" DEFAULT_FILTER_DIM = "filter"
...@@ -107,8 +106,7 @@ class DataHandlerFilterSingleStation(DataHandlerSingleStation): ...@@ -107,8 +106,7 @@ class DataHandlerFilterSingleStation(DataHandlerSingleStation):
class DataHandlerFirFilterSingleStation(DataHandlerFilterSingleStation): class DataHandlerFirFilterSingleStation(DataHandlerFilterSingleStation):
"""Data handler for a single station to be used by a superior data handler. Inputs are FIR filtered.""" """Data handler for a single station to be used by a superior data handler. Inputs are FIR filtered."""
# _requirements = remove_items(inspect.getfullargspec(DataHandlerFilterSingleStation).args, ["self", "station"]) _requirements = remove_items(DataHandlerFilterSingleStation.requirements(), "station")
_requirements = DataHandlerFilterSingleStation.requirements()
_hash = DataHandlerFilterSingleStation._hash + ["filter_cutoff_period", "filter_order", "filter_window_type", _hash = DataHandlerFilterSingleStation._hash + ["filter_cutoff_period", "filter_order", "filter_window_type",
"filter_add_unfiltered"] "filter_add_unfiltered"]
......
...@@ -4,7 +4,7 @@ __date__ = '2020-12-10' ...@@ -4,7 +4,7 @@ __date__ = '2020-12-10'
from mlair.data_handler.data_handler_mixed_sampling import DataHandlerMixedSampling, \ from mlair.data_handler.data_handler_mixed_sampling import DataHandlerMixedSampling, \
DataHandlerMixedSamplingSingleStation, DataHandlerMixedSamplingWithKzFilter, \ DataHandlerMixedSamplingSingleStation, DataHandlerMixedSamplingWithKzFilter, \
DataHandlerMixedSamplingWithKzFilterSingleStation, DataHandlerSeparationOfScales, \ DataHandlerMixedSamplingWithKzFilterSingleStation, DataHandlerSeparationOfScales, \
DataHandlerSeparationOfScalesSingleStation DataHandlerSeparationOfScalesSingleStation, DataHandlerMixedSamplingWithFilterSingleStation
from mlair.data_handler.data_handler_with_filter import DataHandlerKzFilterSingleStation from mlair.data_handler.data_handler_with_filter import DataHandlerKzFilterSingleStation
from mlair.data_handler.data_handler_single_station import DataHandlerSingleStation from mlair.data_handler.data_handler_single_station import DataHandlerSingleStation
from mlair.helpers import remove_items from mlair.helpers import remove_items
...@@ -86,7 +86,7 @@ class TestDataHandlerMixedSamplingSingleStation: ...@@ -86,7 +86,7 @@ class TestDataHandlerMixedSamplingSingleStation:
pass pass
class TestDataHandlerMixedSamplingWithFilter: class TestDataHandlerMixedSamplingWithKzFilter:
def test_data_handler(self): def test_data_handler(self):
obj = object.__new__(DataHandlerMixedSamplingWithKzFilter) obj = object.__new__(DataHandlerMixedSamplingWithKzFilter)
...@@ -98,7 +98,7 @@ class TestDataHandlerMixedSamplingWithFilter: ...@@ -98,7 +98,7 @@ class TestDataHandlerMixedSamplingWithFilter:
def test_requirements(self): def test_requirements(self):
obj = object.__new__(DataHandlerMixedSamplingWithKzFilter) obj = object.__new__(DataHandlerMixedSamplingWithKzFilter)
req1 = object.__new__(DataHandlerMixedSamplingSingleStation) req1 = object.__new__(DataHandlerMixedSamplingWithFilterSingleStation)
req2 = object.__new__(DataHandlerKzFilterSingleStation) req2 = object.__new__(DataHandlerKzFilterSingleStation)
req = list(set(req1.requirements() + req2.requirements())) req = list(set(req1.requirements() + req2.requirements()))
assert sorted(obj._requirements) == sorted(remove_items(req, "station")) assert sorted(obj._requirements) == sorted(remove_items(req, "station"))
...@@ -120,7 +120,7 @@ class TestDataHandlerSeparationOfScales: ...@@ -120,7 +120,7 @@ class TestDataHandlerSeparationOfScales:
def test_requirements(self): def test_requirements(self):
obj = object.__new__(DataHandlerMixedSamplingWithKzFilter) obj = object.__new__(DataHandlerMixedSamplingWithKzFilter)
req1 = object.__new__(DataHandlerMixedSamplingSingleStation) req1 = object.__new__(DataHandlerMixedSamplingWithFilterSingleStation)
req2 = object.__new__(DataHandlerKzFilterSingleStation) req2 = object.__new__(DataHandlerKzFilterSingleStation)
req = list(set(req1.requirements() + req2.requirements())) req = list(set(req1.requirements() + req2.requirements()))
assert sorted(obj._requirements) == sorted(remove_items(req, "station")) assert sorted(obj._requirements) == sorted(remove_items(req, "station"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment