remove decorator that is not compatible with all CDS datasets#605
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #605 +/- ##
========================================
Coverage 90.15% 90.15%
========================================
Files 159 159
Lines 12181 12181
Branches 595 595
========================================
Hits 10982 10982
Misses 1017 1017
Partials 182 182 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This will break existing code. E.g. would break the test If it is acceptable please give a clear description on how to migrate existing code (like the one in the test above). |
|
Hi Sandor, It returns only the first day instead of the whole month, if you put some debug output in EK-data you see it's because ["2020-12-01/2020-12-31"] gets turned into ["2020-12-01"] A problem with the test you mentioned is that it's using date formats which are not using the suggested CDS/ADS syntax. Also, I think it's implementing functionality which only works for grib and not really guaranteed to produce something sensible for our other datasets. https://ads.atmosphere.copernicus.eu/datasets/cams-global-ghg-reanalysis-egg4?tab=download |
|
@EddyCMWF, is there a document explaining the cdsapi syntax for "date"? |
|
Hi Sandor, The suggested syntax is the code you get when you click on the "Show API request" in the cownload form. I've asked the contractors to add the type of value produced by the widgets to the widget documentation pages. However, the problem is more general than that. earthkit is assuming that the behaviour of a a widget is something, when the reality is that the CDS datasets are very broad in scope, therefore assuming that modifying a request in a certain way for all datasets is not a good idea. This code was written for requests to MARS datasets in the old system, and is not general enough for all the types of data available in the CDS in my opinion. Eddy |
|
Hi @EddyCMWF, I agree with you. Please update the PR with the latests develop branch and then it can be merged. |
|
Hi Sandor, I've merged develop into my branch, however I am now a little confused... I was expecting the unit tests to fail, but they are not |
|
I added some more date-formats using the suggested syntax from the CDS, I expect them to pass without the decorator. I expect the existing |
In the CI the CDS tests are disabled. |
|
@EddyCMWF, the problem with disabling the normaliser is that now the e.g. a |
This decorator breaks requests for some datasets where the daterange is required as a daterange in the cds/ads request (I'm just finding a nice example).
Eitherway, this modifying of requests has the potential to lead to misunderstandings/incompatibilities in the future. We can have the exception of the the area as here it is a case of mapping the earhtkit style dictionary to the CDS style list for an area definition.