xarray-contrib / xeofs

Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis
https://xeofs.readthedocs.io/
MIT License
105 stars 20 forks source link

TypeError: __init__() missing 1 required positional argument: 'X' #166

Closed nicolasfauchereau closed 5 months ago

nicolasfauchereau commented 5 months ago

When trying to run the example given in the README, I encounter the error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[15], line 1
----> 1 eof = xe.models.EOF(n_modes=10)

TypeError: __init__() missing 1 required positional argument: 'X'

The full code is below Provide a concise Python code snippet that demonstrates the issue. To display the code clearly, use GitHub Flavored Markdown for formatting:


import xarray as xr  # for example data only
import xeofs as xe
xe.__version__
'0.7.2'
t2m = xr.tutorial.open_dataset("air_temperature")
t2m_west = t2m.isel(lon=slice(None, 20))
t2m_east = t2m.isel(lon=slice(21, None))
eof = xe.models.EOF(n_modes=10)

returns:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[15], line 1
----> 1 eof = xe.models.EOF(n_modes=10)

TypeError: __init__() missing 1 required positional argument: 'X'

For info, I am on Ubuntu 20.04:

nicolasfauchereau commented 5 months ago

apologies for the noise! just realised I am using a rather old version of xeof ...