JuliaDataCubes / JuliaDataCubes/YAXArrays.jl

mapCube of Dataset gives NamedTuple in inner function

Open
#209 0 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

When I run a mapCube on a Dataset I would expect, that the mapCube function would loop over the different data cubes in the data set as long as they would have the InDims axes. When I run the mapCube function on a Dataset, I get a NamedTuple for the input instead.

I am not sure, whether this is a misconception from my side or whether this is a change in behavior, because it is untested.

This is related to #206.

The following is a code snippet to reproduce the problem:

    x,y = (RangeAxis("x",1:4), RangeAxis("y", 1:5))
    zs = [RangeAxis("z_$i", 1:6) for i in 1:3]
    a1 = YAXArray([x,y,zs[1]], rand(4,5,6))
    a2 = YAXArray([x,zs[2],y], rand(4,6,5))
    a3 = YAXArray([x,y, zs[3]], rand(4,5,6))
    ds = Dataset(;a1,a2,a3)
        indims = InDims("x")
        outdims = OutDims("x")
        r = mapCube(ds, indims=indims, outdims=outdims) do xout, x1
            #@show xout, x1
            @show typeof(xout)
            @show typeof(x1)
            xout .= x1 .+ 4
        end

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 at the mapCube entry point for Dataset inputs and read the behavior discussed in related issue #206. Run the Julia reproduction snippet to compare the expected per-cube iteration with the observed NamedTuple input; done means the behavior is clarified and the reproduction is covered by an appropriate test.

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.