from eofs.xarray import Eof
solver = Eof(data) # flux is the above DataArray
reconstr = solver.reconstructedField(solver.neofs)
The reconstructedField method call raises an AttributeError, pointing to the following section of the code in /lib/python3.10/site-packages/eofs/standard.py within reconstructedField:
# Determine how the PCs and EOFs will be selected.
if isinstance(neofs, collections.Iterable):
modes = [m - 1 for m in neofs]
else:
modes = slice(0, neofs)
Error raised: AttributeError: module 'collections' has no attribute 'Iterable'
It looks like usage of collections.Iterable has been deprecated, being refactored into a second-level module for "abstract base classes" (a similar issue raised here).
Changing the above to
# Determine how the PCs and EOFs will be selected.
if isinstance(neofs, collections.abc.Iterable):
modes = [m - 1 for m in neofs]
else:
modes = slice(0, neofs)
When I run the following example use case
The reconstructedField method call raises an AttributeError, pointing to the following section of the code in
/lib/python3.10/site-packages/eofs/standard.py
withinreconstructedField
:Error raised:
AttributeError: module 'collections' has no attribute 'Iterable'
It looks like usage of
collections.Iterable
has been deprecated, being refactored into a second-level module for "abstract base classes" (a similar issue raised here).Changing the above to
solved the issue for now.