@@ -116,9 +116,10 @@ def __init__(
116116 land = False ,
117117 overwrite = False ,
118118 dashed_vars = False ,
119+ dryrun = False ,
119120 ):
120121 """Initialization of Fetch class."""
121- self ._get_login () # Get login info from config file.
122+ self ._get_login (dryrun = dryrun ) # Get login info from config file.
122123
123124 self .months = era5cli .utils ._zpad_months (months )
124125 """list(str): List of zero-padded strings of months
@@ -194,7 +195,10 @@ def __init__(
194195 "\n For more info see 'era5cli hourly --help'."
195196 )
196197
197- def _get_login (self ):
198+ def _get_login (self , dryrun = False ):
199+ if dryrun : # Don't check keys on dry run
200+ return None
201+
198202 # First check if the config exists, and guide the user if it does not.
199203 key_management .check_era5cli_config ()
200204 # Only then load the keys (as they should be there now).
@@ -463,7 +467,10 @@ def _build_request(self, variable, years, months=None):
463467 "year" : years ,
464468 "month" : self .months if months is None else months ,
465469 "time" : self .hours ,
466- "format" : self .outputformat ,
470+ "data_format" : self .outputformat ,
471+ "download_format" : (
472+ "unarchived" if self .outputformat .lower () == "netcdf" else "zip"
473+ ),
467474 }
468475
469476 if "pressure-levels" in name :
@@ -487,7 +494,6 @@ def _exit(self):
487494 def _getdata (self , variables : list , years : list , outputfile : str , months = None ):
488495 """Fetch variables using cds api call."""
489496 name , request = self ._build_request (variables , years , months )
490-
491497 if self .dryrun :
492498 print (name , request , outputfile )
493499 else :
0 commit comments