manoharan-lab / holopy

Hologram processing and light scattering in python
GNU General Public License v3.0
131 stars 50 forks source link

Incorrect way of initializing xarray.DataArray #411

Closed VasLem closed 7 months ago

VasLem commented 1 year ago

This line updates the coords variable with a value that breaks the indexing of the DataArray.

The problem can easily be replicated by running the tutorial

The error raised is:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\user\.conda\envs\triseq\lib\site-packages\xarray\core\dataarray.py", line 417, in __init__
    indexes, coords = _create_indexes_from_coords(coords)
  File "C:\Users\user\.conda\envs\triseq\lib\site-packages\xarray\core\merge.py", line 609, in _create_indexes_from_coords
    idx, idx_vars = create_default_index_implicit(variable, all_variables)
  File "C:\Users\user\.conda\envs\triseq\lib\site-packages\xarray\core\indexes.py", line 1061, in create_default_index_implicit
    raise ValueError(
ValueError: conflicting MultiIndex level / variable name(s):
x
y
z
VasLem commented 1 year ago

xarray version 0.21.1 seems compatible with the current code. Maybe it should be explicitly stated in the requirements.txt, until an update to the code is composed.

emanuelevivoli commented 1 year ago

same problem here