ecmwf / magics-python

Python interface to Magics meteorological plotting package
Apache License 2.0
49 stars 12 forks source link

Can not input xarray data #14

Closed NMC-DAVE closed 4 years ago

NMC-DAVE commented 5 years ago

Hi, I try to input xarray to magics, like:

from Magics import macro as magics import xarray as xr

data = xr.open_mfdataset('2t.nc') data = magics.mxarray(data, 't2m')

but I get the following errors, so why? Much thanks!


NameError Traceback (most recent call last)

in 1 data = xr.open_mfdataset('2t.nc') ----> 2 data = magics.mxarray(data, 't2m') ~/anaconda3/lib/python3.7/site-packages/Magics/macro.py in mxarray(dataset, var) 423 424 --> 425 return data 426 427 NameError: name 'data' is not defined
dtip commented 5 years ago

The xarray interface is not implemented in the latest release of magics-python (v1.0.6). If you want to use it you'll need to use the master branch of this repo instead.

@sylvielamythepaut when is the next expected release date?

NMC-DAVE commented 5 years ago

Thanks, Daniel. Will the future magics-python release support xarray data? If so, that's will be great!

sylvielamythepaut commented 5 years ago

Hi, Yes the next vesrion of Magics amd magics-python will support xarray . We hope to get it cout by mid-july . We will welcome your feedback.

NMC-DAVE commented 5 years ago

Thanks very much.

sylvielamythepaut commented 5 years ago

Hi, We have updated magics-python, you should now be able to use the mxarray interface .

Thanks

NMC-DAVE commented 5 years ago

Thanks. Can you update the conda-forge channel? I want to install with "conda install -c conda-forge magics-python ".

sylvielamythepaut commented 5 years ago

Good Point, should be updated soon . Sylvie