You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/merge.py in _extract_indexes_from_coords(coords)
490 """Yields the name & index of valid indexes from a mapping of coords"""
491 for name, variable in coords.items():
--> 492 variable = as_variable(variable, name=name)
493 if variable.dims == (name,):
494 yield name, variable._to_xindex()
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
Tested with version 0.14 of xarray and the process worked. Error was caused by API change. To use newer verisons of xarray update the API and set a minimum version.
TypeError Traceback (most recent call last)
/var/folders/z4/1gpfvpc91k58ljkw_dt89vgr0000gr/T/ipykernel_2342/4137204616.py in
1 # apply rotated eof process
----> 2 reof_ds = fierpy.reof(ds.VV,n_modes=4)
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/fierpy/fier.py in reof(stack, variance_threshold, n_modes)
82
83 # structure the spatial and temporal reof components in a Dataset
---> 84 reof_ds = xr.Dataset(
85 {
86 "spatial_modes": (["lat","lon","mode"],spatial_rotated),
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/dataset.py in init(self, data_vars, coords, attrs)
752 coords = coords.variables
753
--> 754 variables, coord_names, dims, indexes, _ = merge_data_and_coords(
755 data_vars, coords, compat="broadcast_equals"
756 )
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/merge.py in merge_data_and_coords(data, coords, compat, join)
481 objects = [data, coords]
482 explicit_coords = coords.keys()
--> 483 indexes = dict(_extract_indexes_from_coords(coords))
484 return merge_core(
485 objects, compat, join, explicit_coords=explicit_coords, indexes=indexes
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/merge.py in _extract_indexes_from_coords(coords)
490 """Yields the name & index of valid indexes from a mapping of coords"""
491 for name, variable in coords.items():
--> 492 variable = as_variable(variable, name=name)
493 if variable.dims == (name,):
494 yield name, variable._to_xindex()
~/opt/miniconda3/envs/fier/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
Here is the version information:
The text was updated successfully, but these errors were encountered: