Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version for CDS-Beta doesn't accept "None" in the retrieval request options #114

Open
fragkoul opened this issue Aug 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fragkoul
Copy link

What happened?

With the previous version we could set options that are not always needed (like 'pressure_level' and 'leadtime_month') to "None". This was really helpful as it allowed us to build versatile functions. This no longer works for version 0.7.1.

As an example, this request works:

c = cdsapi.Client()
c.retrieve('seasonal-original-single-levels',{
'originating_centre':'ecmwf', 
'system':'51', 'variable':'2m_temperature', 
'year':'2024', 
'month':'07', 
'day':'01', 
'leadtime_hour':['12','24','36','48']
}, 'myfile.grib')

while if we add the 'pressure_level' option and set it None:

c = cdsapi.Client()
c.retrieve('seasonal-original-single-levels',{
'originating_centre':'ecmwf', 
'system':'51', 'variable':'2m_temperature', 
'pressure_level':None, 
'year':'2024', 
'month':'07', 
'day':'01', 
'leadtime_hour':['12','24','36','48']
}, 'myfile.grib')

we get the error (only in the new version):

cads_api_client.processing.ProcessingFailedError: The job has failed.
MARS has returned an error, please check your selection.
Request submitted to the MARS server:
[{'step': ['12', '24', '36', '48'], 'origin': 'ecmf', 'pressure_level': None, 'system': '51', 'param': '167', 'time': ['all'], 'type': ['fc'], 'class': ['c3'], 'expect': ['any'], 'expver': ['1'], 'method': ['1'], 'number': ['all'], 'stream': ['mmsf'], 'levtype': ['sfc'], 'database': 'ecmwf', 'date': ['2024-07-01']}]
Full error message:
mars - ERROR  - 20240824.144957 - Ambiguous parameter: pressure_level could be PRODUCT or PROCESS
The job failed with: MarsRuntimeError

In the previous version, if we wanted to retrieve seasonal forecasts on pressure levels ('seasonal-original-pressure-levels') or monthly fields ('seasonal-monthly-single-levels'), we could use the same code and just change the "unused" parameters from None to whatever value.

What are the steps to reproduce the bug?

See examples above

Version

0.7.1

Platform (OS and architecture)

macOS 14.5

Relevant log output

No response

Accompanying data

No response

Organisation

No response

@fragkoul fragkoul added the bug Something isn't working label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant