-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi everyone @peanutfun , I'm trying to replicate the tutorial https://climada-petals.readthedocs.io/en/v6.1.0/glofas_rf.html# and the setup_all section, let's say, works. I had to manually add the 100 MB gumbell_fit file but I dont' get errors.
I installed both climada and climada-petals via mamba version 6.1.
The problem arises when I launch the second block:
from climada_petals.hazard.rf_glofas import (
RiverFloodInundation,
hazard_series_from_dataset,
)
forecast_date = "2023-08-01"
rf = RiverFloodInundation()
rf.download_forecast(
countries="Switzerland",
forecast_date=forecast_date,
lead_time_days=5,
preprocess=lambda x: x.max(dim="step"),
)
ds_flood = rf.compute()
hazard = hazard_series_from_dataset(ds_flood, "flood_depth", "number")`.
It returns an HTTP error saying that the dataset does not exist. I correctly placed the .cdsapirc in $HOME. Has anything changed in the api structure?
I quote the error here:
/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/river_flood_computation.py:182: UserWarning: The specified chunks separate the stored chunks along dimension "latitude" starting at index 1377. This could degrade performance. Instead, consider rechunking after loading.
self.flood_maps = xr.open_dataarray(
/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/river_flood_computation.py:182: UserWarning: The specified chunks separate the stored chunks along dimension "longitude" starting at index 3480. This could degrade performance. Instead, consider rechunking after loading.
self.flood_maps = xr.open_dataarray(
/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/river_flood_computation.py:186: FutureWarning: In a future version, xarray will not decode timedelta values based on the presence of a timedelta-like units attribute by default. Instead it will rely on the presence of a timedelta64 dtype attribute, which is now xarray's default way of encoding timedelta64 values. To continue decoding timedeltas based on the presence of a timedelta-like units attribute, users will need to explicitly opt-in by passing True or CFTimedeltaCoder(decode_via_units=True) to decode_timedelta. To silence this warning, set decode_timedelta to True, False, or a 'CFTimedeltaCoder' instance.
self.gumbel_fits = xr.open_dataset(data_dir / "gumbel-fit.nc", chunks="auto")
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/cds_glofas_downloader.py", line 154, in glofas_request_single
client.retrieve(product, request, outfile)
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/legacy_client.py", line 167, in retrieve
submitted = self.client.submit_and_wait_on_results(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/client.py", line 414, in submit_and_wait_on_results
return self._retrieve_api.submit(collection_id, request).get_results()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 735, in submit
return self.get_process(collection_id).submit(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 724, in get_process
return Process.from_request("get", url, **self._request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 176, in from_request
cads_raise_for_status(response)
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 99, in cads_raise_for_status
raise requests.HTTPError(message, response=response)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/api/retrieve/v1/processes/cems-glofas-forecast
process not found
dataset cems-glofas-forecast not found
"""The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/francesco/Repositories/project_crat/preprocessing_pipeline/glofas_wsl.py", line 6, in
rf.download_forecast(
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/river_flood_computation.py", line 354, in download_forecast
forecast = download_glofas_discharge(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/transform_ops.py", line 318, in download_glofas_discharge
files = glofas_request(
^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/cds_glofas_downloader.py", line 289, in glofas_request
return glofas_request_multiple(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/cds_glofas_downloader.py", line 174, in glofas_request_multiple
return pool.starmap(
^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 375, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 774, in get
raise self._value
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/climada_petals/hazard/rf_glofas/cds_glofas_downloader.py", line 154, in glofas_request_single
client.retrieve(product, request, outfile)
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/legacy_client.py", line 167, in retrieve
submitted = self.client.submit_and_wait_on_results(
^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/client.py", line 414, in submit_and_wait_on_results
return self._retrieve_api.submit(collection_id, request).get_results()
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 735, in submit
return self.get_process(collection_id).submit(request)
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 724, in get_process
return Process.from_request("get", url, **self._request_kwargs)
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 176, in from_request
cads_raise_for_status(response)
^^^^^^^^^^^^^^^^^
File "/home/francesco/micromamba/envs/climada_wsl/lib/python3.11/site-packages/ecmwf/datastores/processing.py", line 99, in cads_raise_for_status
raise requests.HTTPError(message, response=response)
^^^^^^^^^^^^^^^
requests.exceptions.HTTPError: [Errno None] None