ecmwf / climetlab

Python package for easy access to weather and climate data
Apache License 2.0
374 stars 57 forks source link

cml.plot_map doesn't show map #53

Closed salmiah-ls closed 1 year ago

salmiah-ls commented 1 year ago

Hello,

In ECMWF e-learning Tier 2, these code doesn't show any map, only xarray dataset

ds = cml.load_source('file', 'test.grib')
for field in ds:
    cml.plot_map(field)
ds.to_xarray()

I run the code in my PC with this configuration,

python_version() 3.8.8

!climetlab versions
IPython            7.22.0
IPython            7.22.0
Magics             1.5.8
abc                c:\users\salmiah\anaconda3\lib\abc.py
argparse           1.1
asyncssh           missing
atexit             builtin
branca             0.5.0
bz2                c:\users\salmiah\anaconda3\lib\bz2.py
calendar           c:\users\salmiah\anaconda3\lib\calendar.py
cdsapi             0.6.1
climetlab          0.13.15
cmd                c:\users\salmiah\anaconda3\lib\cmd.py
codc               missing
code               c:\users\salmiah\anaconda3\lib\code.py
collections        c:\users\salmiah\anaconda3\lib\collections\__init__.py
contextlib         c:\users\salmiah\anaconda3\lib\contextlib.py
copy               c:\users\salmiah\anaconda3\lib\copy.py
csv                1.0
ctypes             1.1.0
dask               2021.4.0
dask_jobqueue      missing
datetime           c:\users\salmiah\anaconda3\lib\datetime.py
dateutil           2.8.2
distributed        2021.4.0
docutils           0.17
eccodes            1.5.2
ecmwf              namespace
ecmwfapi           1.6.3
ecmwflibs          0.5.1
entrypoints        0.3
filelock           3.0.12
findlibs           0.0.2
fnmatch            c:\users\salmiah\anaconda3\lib\fnmatch.py
folium             0.12.1.post1
functools          c:\users\salmiah\anaconda3\lib\functools.py
getpass            c:\users\salmiah\anaconda3\lib\getpass.py
glob               c:\users\salmiah\anaconda3\lib\glob.py
gribapi            2.27.0
gzip               c:\users\salmiah\anaconda3\lib\gzip.py
h5py               2.10.0
hashlib            c:\users\salmiah\anaconda3\lib\hashlib.py
imageio            2.9.0
importlib          c:\users\salmiah\anaconda3\lib\importlib\__init__.py
importlib_metadata 6.1.0
inspect            c:\users\salmiah\anaconda3\lib\inspect.py
io                 c:\users\salmiah\anaconda3\lib\io.py
ipywidgets         7.6.3
itertools          builtin
jinja2             2.11.3
json               2.0.9
logging            0.5.1.2
lzma               c:\users\salmiah\anaconda3\lib\lzma.py
markdown           3.4.3
math               builtin
metview            missing
mimetypes          c:\users\salmiah\anaconda3\lib\mimetypes.py
multiprocessing    c:\users\salmiah\anaconda3\lib\multiprocessing\__init__.py
multiurl           0.2.1
numbers            c:\users\salmiah\anaconda3\lib\numbers.py
numpngw            0.1.2
numpy              1.24.2
oauthlib           3.2.2
os                 c:\users\salmiah\anaconda3\lib\os.py
pandas             2.0.0
pathlib            c:\users\salmiah\anaconda3\lib\pathlib.py
pdbufr             0.10.1
pickle             c:\users\salmiah\anaconda3\lib\pickle.py
pkgutil            c:\users\salmiah\anaconda3\lib\pkgutil.py
platform           1.0.8
pyfdb              missing
pyodc              1.1.4
pytest             6.2.3
random             c:\users\salmiah\anaconda3\lib\random.py
re                 2.2.1
readline           c:\users\salmiah\anaconda3\lib\site-packages\readline.py
requests           2.25.1
requests_oauthlib  1.3.1
s3fs               missing
scipy              1.8.1
shlex              c:\users\salmiah\anaconda3\lib\shlex.py
shutil             c:\users\salmiah\anaconda3\lib\shutil.py
socket             c:\users\salmiah\anaconda3\lib\socket.py
sqlite3            2.6.0
stat               c:\users\salmiah\anaconda3\lib\stat.py
subprocess         c:\users\salmiah\anaconda3\lib\subprocess.py
sys                builtin
tarfile            0.9.0
tempfile           c:\users\salmiah\anaconda3\lib\tempfile.py
tensorflow         2.10.0
termcolor          2.2.0
textwrap           c:\users\salmiah\anaconda3\lib\textwrap.py
threading          c:\users\salmiah\anaconda3\lib\threading.py
time               builtin
torch              missing
tqdm               4.59.0
traceback          c:\users\salmiah\anaconda3\lib\traceback.py
typing             c:\users\salmiah\anaconda3\lib\typing.py
unittest           c:\users\salmiah\anaconda3\lib\unittest\__init__.py
urllib             c:\users\salmiah\anaconda3\lib\urllib\__init__.py
warnings           c:\users\salmiah\anaconda3\lib\warnings.py
weakref            c:\users\salmiah\anaconda3\lib\weakref.py
xarray             2023.1.0
xml                c:\users\salmiah\anaconda3\lib\xml\__init__.py
yaml               5.4.1
zarr               missing
zipfile            c:\users\salmiah\anaconda3\lib\zipfile.py

is there something wrong? Thanks

longtsing commented 1 year ago

I met the same error, I guest that the Climetlab default settings is seted to save figure ,not to show. I still try to fix this .

longtsing commented 1 year ago

I find the bugs in 'climetlab.core.ipython.py' and I have fix it . I pull a 'Pull request'. Maybe the fix code should be merge in sometime future.

longtsing commented 1 year ago

see https://github.com/ecmwf/climetlab/pull/54

longtsing commented 1 year ago

The issues should be resolved in next version.

salmiah-ls commented 1 year ago

thank you. I will wait for the next version then.