arviz-devs / arviz-devs/arviz-base

Check `var_names` behaviour and define what should be its type hint

Open
#83 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8
Forks
26
Avg merge
7d 23h
Merged PRs (30d)
2

Description

xarray allows any hashable as variable name or dimension name. That means that `("tuple", "name")` is a valid dimension or variable name. If we had a dataset with such a variable, would `var_names=("tuple", "name")` work? What about `var_names=[("tuple", "name"), "str_name"]` or `(("tuple", "name"), "str_name")`?

I suspect `str or list of str` is too restrictive but I don't really know what is the correct way to extend. And we are probably missing tests for these edge cases.

Final note, this is completely irrelevant in 99% of cases, but it does happen sometimes, for example https://github.com/arviz-devs/arviz/pull/1997

Contributor guide

Open the contributing guide

Research direction

Start by locating the var_names type hint and the existing handling and tests for variable or dimension names. Check the cases described for tuple names, list inputs, and tuple inputs, then define the supported type and add tests that demonstrate the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.