diff --git a/tests/get_sample_data.ipynb b/tests/get_sample_data.ipynb index 1d244c9ffd4504dd241c4db26ef09ce87fac34e6..32962c24dd1f938cd8e86b7e5b030278dcca3fa2 100644 --- a/tests/get_sample_data.ipynb +++ b/tests/get_sample_data.ipynb @@ -20,7 +20,7 @@ "time = TimeSample(start, end, sampling=sampling)\n", "# { \"station_type_of_area\" : \"urban\" } category is not known\n", "#metadata = Metadata.construct(\"mole_fraction_of_ozone_in_air\", time, statistic, { \"toar1_category\" : \"RuralLowElevation\"})#\n", - "metadata = Metadata.construct(\"mole_fraction_of_ozone_in_air\", time, statistic, { \"type_of_area\" : \"Urban\" })\n", + "metadata = Metadata.construct(\"mole_fraction_of_ozone_in_air\", time, statistic, { \"type_of_area\" : \"Urban\" })#also test Rural, Suburban,\n", "\n", "start_time = datetime.now()\n", "print(start_time)" diff --git a/tests/produce_data_withOptional.ipynb b/tests/produce_data_withOptional.ipynb index 5450e57540f8b82c5505afa2ac507cd5d5207773..5dd1600b88449d8bb563dce832d138caa2740439 100644 --- a/tests/produce_data_withOptional.ipynb +++ b/tests/produce_data_withOptional.ipynb @@ -31,16 +31,20 @@ "#see page 18 in https://toar-data.fz-juelich.de/sphinx/TOAR_UG_Vol03_Database/build/latex/toardatabase--userguide.pdf\n", "\n", "details4Query ={\n", - " \"toar1_category\" : \"Urban\" #uncomment if wished:-)\n", + " #\"toar1_category\" : \"Urban\" #uncomment if wished:-)\n", " #\"toar1_category\" : \"RuralLowElevation\" #uncomment if wished:-)\n", " #\"toar1_category\" : \"RuralHighElevation\" #uncomment if wished:-)\n", + " #\"type_of_area\" : \"Urban\" #also test Rural, Suburban,\n", + " \"type_of_area\" : \"Rural\" #also test Rural, Suburban,\n", + " #\"type_of_area\" : \"Suburban\" #also test Rural, Suburban,\n", "}\n", "\n", "valid_data = Config(\n", " RegularGrid( lat_resolution=1.9, lon_resolution=2.5, ),\n", " TimeSample( start=dt(2000,1,1), end=dt(2019,12,31), sampling=\"daily\"),#possibly adopt range:-)\n", " [\"mole_fraction_of_ozone_in_air\"],#variable name\n", - " [ \"mean\", \"dma8epax\"],# will start one request after another other...\n", + " #[ \"mean\", \"dma8epax\"],# will start one request after another other...\n", + " [ \"dma8epa_strict\" ],\n", " details4Query\n", ")\n", "\n", diff --git a/toargridding/toar_rest_client.py b/toargridding/toar_rest_client.py index 9c7ff534cd136344aef64dd9c319e6e7b3484e68..c1faa1589541b967b26244220870aa2639b90c8f 100644 --- a/toargridding/toar_rest_client.py +++ b/toargridding/toar_rest_client.py @@ -74,7 +74,7 @@ class QueryOptions: def cache_key(self): """creation to identify the request in the cache of known request. """ - return "".join(asdict(self, dict_factory=quarryToDict).values()) + return "".join(f"{key}{val}" for key, val in asdict(self, dict_factory=quarryToDict).items()) def quarryToDict(data : QueryOptions): @@ -494,5 +494,5 @@ class AnalysisServiceDownload(AnalysisService): metadata: metadata for the request. """ - addition = "_".join(str(i) for i in sorted(metadata.moreOptions.values())) + addition = "_".join(f"{key}{val}" for key,val in sorted(metadata.moreOptions).items()) return "_".join(str(i) for i in [metadata.statistic, metadata.time.sampling, metadata.variable.cf_standardname, metadata.time.start.date(), metadata.time.end.date(), addition]) + ".zip"