ecmwf / notebook-examples

Example notebooks showing how to work with ECMWF services and data
Apache License 2.0
198 stars 71 forks source link

Issue in medium-mslp-rain notebook #10

Closed clausmichele closed 4 months ago

clausmichele commented 4 months ago

What happened?

I tried the medium-mslp-rain.ipynb notebook with Binder, and when computing the total precipitation between steps 12 24 UTC it returns a TypeError:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[22], line 3
      1 tp = (tp_24 - tp_12)
----> 3 tp.ls()

File /srv/conda/envs/notebook/lib/python3.10/site-packages/metview/metviewpy/fieldset.py:774, in Fieldset.ls(self, **kwargs)
    773 def ls(self, **kwargs):
--> 774     return self._get_db().ls(**kwargs)

File /srv/conda/envs/notebook/lib/python3.10/site-packages/metview/metviewpy/indexdb.py:465, in FieldsetDb.ls(self, extra_keys, filter, no_print)
    463 keys = list(ls_keys)
    464 keys.append("_msgIndex1")
--> 465 df = df[keys]
    466 df = df.sort_values("_msgIndex1")
    467 df = df.rename(columns={"_msgIndex1": "Message"})

TypeError: 'NoneType' object is not subscriptable

What are the steps to reproduce the bug?

Run the notebook with Binder as is.

Version

Latest

Platform (OS and architecture)

Binder

Relevant log output

No response

Accompanying data

No response

Organisation

Eurac Research

milanavuckovic commented 4 months ago

Hi Michele, Unfortunately libraries used in these notebooks (ecmwf.data and magpy) are now becoming old and are not maintained. Internally we are replacing them with new libraries that rely on xarray, numpy, cartopy and matplotlib. However those are not ready yet. I am planning to update the notebooks in August, to use Metview which is used operationally to produce the charts until the new libraries are ready. Sorry for the inconvenience.