From 06ea92a7a0ead3518146bb4dda14a2e9ddc00578 Mon Sep 17 00:00:00 2001 From: santiagoC Date: Tue, 8 Oct 2024 15:00:11 -0500 Subject: [PATCH] string error --- src/aclimate_resampling/complete_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aclimate_resampling/complete_data.py b/src/aclimate_resampling/complete_data.py index 9d22552..46a42a6 100644 --- a/src/aclimate_resampling/complete_data.py +++ b/src/aclimate_resampling/complete_data.py @@ -202,6 +202,7 @@ def download_era5_data(self,variables=["t_max","t_min","sol_rad"], test = False) self.manager.mkdir(save_path_era5_data_tmp) if self.force or os.path.exists(save_path_era5) == False: + formatted_month = [f"{int(month):02d}" if isinstance(month, str) else f"{month:02d}"] c = cdsapi.Client(timeout=600) c.retrieve('sis-agrometeorological-indicators', { @@ -209,7 +210,7 @@ def download_era5_data(self,variables=["t_max","t_min","sol_rad"], test = False) 'variable': enum_variables[v]["name"], 'statistic': enum_variables[v]["statistics"], 'year': year, - 'month': [f"{month:02d}"], + 'month': formatted_month, 'day': days, 'version': self.cdsapi_version, },