UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
59 stars 15 forks source link

Meteo loader won’t load data #402

Closed PetitMote closed 2 years ago

PetitMote commented 2 years ago

Describe the bug Hi guys, I’m trying to fetch data with the automatic loader. At first, it went great, but I stoped the launcher because I misunderstood somethin. It had succesfully downloaded 2 months of data, but now it won’t fetch anything. I’ve tried updating (no update), re-launching qgis, and rebooting, but nothing new. There isn’t any request in copernicus, and the loader just keep running without any information.

I get this Python error:

NameError: name 'linecache' is not defined

             Traceback (most recent call last):
              File "C:\Users/obarral/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\copernicus_data\WorkerDownload.py", line 42, in run
              sp.util.gen_forcing_era5(self.lat, self.lon, self.start_date, self.end_date, dir_save=Path(self.folderPath))
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\supy\util\_era5.py", line 709, in gen_forcing_era5
              list_fn_sfc, list_fn_ml = load_filelist_era5(
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\supy\util\_era5.py", line 611, in load_filelist_era5
              download_era5(
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\supy\util\_era5.py", line 511, in download_era5
              download_cds(path_dir_save / fn_sfc, dict_req)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\supy\util\_era5.py", line 444, in download_cds
              c.retrieve(**dict_req)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 350, in retrieve
              result.download(target)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 173, in download
              return self._download(self.location, self.content_length, target)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 123, in _download
              with tqdm(
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1109, in __init__
              self.refresh(lock_args=self.lock_args)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1361, in refresh
              self.display()
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1509, in display
              self.sp(self.__str__() if msg is None else msg)
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 350, in print_status
              fp_write('\r' + s + (' ' * max(last_len[0] - len_s, 0)))
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 343, in fp_write
              fp.write(_unicode(s))
              File "C:\Users\obarral\AppData\Roaming\Python\Python39\site-packages\tqdm\utils.py", line 89, in __getattr__
              return getattr(self._wrapped, name)
             AttributeError: 'NoneType' object has no attribute 'write'

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\Users/obarral/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\copernicus_data\WorkerDownload.py", line 46, in run
              errorstring = self.print_exception()
              File "C:\Users/obarral/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\copernicus_data\WorkerDownload.py", line 59, in print_exception
              linecache.checkcache(filename)
             NameError: name 'linecache' is not defined

             Version de Python : 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]

             Version de QGIS : 3.24.1-Tisler Tisler, 5709b824

To Reproduce Steps to reproduce the behavior:

  1. Go to download data (ERAS)
  2. Set the location to 47.25 and -1.5 (city of Nantes)
  3. Dates from 2018-01-01 to 2018-12-31
  4. See error

Desktop (please complete the following information):

PetitMote commented 2 years ago

Hello,

I tried today with the year 2017. It seems to work, and I don’t get the python error. I guess it’s a problem due to cache.

biglimp commented 2 years ago

Ok great to see it working. Depending on where you are in the world and can also try to download via shinyweather.com. Here they have pre-processed the ERA5 data which makes it much faster. I will close this issue here.

PetitMote commented 2 years ago

Sorry, it was unclear, but it’s working only if I change the dates 😅 I tried 2018 (and so tried loading the cache), and got the same error.

Thank you for the link, I’ll have a look