JuliaDataCubes / JuliaDataCubes/YAXArrays.jl

Saving cubes with duplicated axes fails

Open
#149 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
132
Forks
25
PR merge metrics
No merged PRs in 30d

Description

tmp = YAXArray([CategoricalAxis("Cat", ["a", "b"]),
                CategoricalAxis("Cat", ["a", "b"])],
               rand(2, 2))

savecube(tmp, "data/tmp.zarr")

also fails when trying to save to a "nc" file. Duplicated axes are really useful for e.g. covariance matrices. A workaround is to just rename one of the axes to "Cat2" fails with the same error:

tmp = YAXArray([CategoricalAxis("Cat", ["a", "b"]),
                CategoricalAxis("Cat2", ["a", "b"])],
               rand(2, 2))

savecube(tmp, "data/tmp.zarr")

ERROR: Multiple possible axis matches found for YAXArrays.Cubes.Axes.ByName("Cat")

As a workaround the axis have to be named "Cat1" and "Cat2"

"Variable" also seems to be a forbidden substring, naming the axes "Variable1" and "Variable2" also fails, "Var1", "Var2" works.

Contributor guide

No contributing guide indexed for this repository

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 reproducing the examples through the savecube entry point with duplicated CategoricalAxis names, renamed axes, and both data/tmp.zarr and an nc file. Trace the axis-matching error, especially the ByName("Cat") and forbidden "Variable" cases. Done means cubes with duplicated or otherwise valid axis names save successfully without requiring Cat1/Cat2 or Var1/Var2 workarounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.