microsoft / microsoft/Qcodes

Re-think use of MultiIndex in `to_xarray_dataset`

Open
#7,140 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

The `to_xarray_dataset` method, by default, will create a MultiIndex if there are repeated values along any axis, and will then convert all `coords` to `data_vars`. This can cause problems in the expected xarray dataset structure.

We should re-think what cases really need a pandas index or a MultiIndex to minimize these unexpected issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the `to_xarray_dataset` method and tracing how repeated axis values lead to a pandas index or MultiIndex and how coordinates become data variables. Determine which cases require an index, then define the expected xarray dataset structure and document the cases that should be covered before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.