Skip to content

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

Open
@jmp75

Description

@jmp75

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions