diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..b9e99260bf856bfa7a2bbce27355e2b5bd586ea3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "timeseries" + ] +} \ No newline at end of file diff --git a/tests/benchmark.py b/tests/benchmark.py index bbeca43b2e201864d41eee960a555166f3c7a392..7390b1751e9dbddc39eaf658d303798cef4aa598 100644 --- a/tests/benchmark.py +++ b/tests/benchmark.py @@ -81,7 +81,7 @@ def time_rest_client_response(start, end): use_downloaded=False, ) time_window = TimeSample(start, end, SAMPLING) - sample = Metadata.construct("mole_fraction_of_ozone_in_air", STATISTIC, time_window) + sample = Metadata.construct("mole_fraction_of_ozone_in_air", time_window, STATISTIC) timer_start = datetime.now() wait_for_client_response(rest_client, sample) diff --git a/tests/conftest.py b/tests/conftest.py index 5e9ca92a7828fc68f806564572fd775bed95bfab..4b58914d79be5d71b86d178e98ac46017cca26cb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -44,7 +44,7 @@ def toar_variable_ozon(): @pytest.fixture def metadata_ozone_mean(toar_variable_ozon, time): - return Metadata(toar_variable_ozon, "mean", time) + return Metadata(toar_variable_ozon, time, "mean") def load_local_data(*args, **kwargs): diff --git a/toargridding/gridding.py b/toargridding/gridding.py index 3b6ab3677e86bfe069884076d30a82aef8044c08..be6b552a30a3719e94eb5f107dc8dedff00f0986 100644 --- a/toargridding/gridding.py +++ b/toargridding/gridding.py @@ -40,7 +40,7 @@ def get_gridded_toar_data( """ metadatas = [ - Metadata.construct(var, stat, time) for var, stat in product(variables, stats) + Metadata.construct(var, time, stat) for var, stat in product(variables, stats) ] datasets = [] diff --git a/toargridding/metadata.py b/toargridding/metadata.py index d1d83d214aec1fc97cf029bb8c20fba0794c2107..ac2bae50b1895a02c7ab398d391be81f739131e6 100644 --- a/toargridding/metadata.py +++ b/toargridding/metadata.py @@ -88,18 +88,17 @@ class Metadata: ---------- variable: support variable of the TOAR data base - statistics: - statistical processing applied by the TOAR database for this request time: requested time points + statistics: + statistical processing applied by the TOAR database for this request """ - variable: TOARVariable - statistic: str time: TimeSample + statistic: str @staticmethod - def construct(standart_name: str, stat: str, time: TimeSample): + def construct(standart_name: str, time: TimeSample, stat: str): """constructor Parameters: @@ -115,7 +114,7 @@ class Metadata: variable = TOARVariable.get(standart_name) - return Metadata(variable, stat, time) + return Metadata(variable, time, stat) @property def statistic(self) -> str: # TODO make better @@ -127,7 +126,7 @@ class Metadata: return self._statistic @statistic.setter - def statistics(self, stat : str): + def statistic(self, stat : str): if stat not in STATISTICS_LIST: raise ValueError(f"invalid statistic: {stat}") self._statistic = stat