Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cannot re-index or align objects with conflicting indexes found for the following dimensions: 'station' (2 conflicting indexes) #5

Open
jmp75 opened this issue Sep 3, 2024 · 0 comments

Comments

@jmp75
Copy link
Member

jmp75 commented Sep 3, 2024

Description of the bug

Creating an empty EFTS xarray, then trying to assign a new dataarray to the dataset.

Exception has occurred: ValueError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
cannot re-index or align objects with conflicting indexes found for the following dimensions: 'station' (2 conflicting indexes)
Conflicting indexes may occur when
- they relate to different sets of coordinate and/or dimension names
- they don't have the same type
- they may be used to reindex data along common dimensions

Occurs at commit aa91106 when trying to run round-tripping unit test.

I was trying to set multiple indexes (coordinates) for the 'station' dimension, to accomodate the selection of stations by string or by integers, the "old way". I thought I had found the magic via

    # Credits to the work reported in https://github.com/pydata/xarray/issues/2028#issuecomment-1265252754
    d = d.set_xindex(STATION_ID_VARNAME)

However, this makes it difficult without a serious workaround to create new data variables then: pydata/xarray#7695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant