JuliaDataCubes / JuliaDataCubes/YAXArrays.jl

cubefittable finds only one group when using by with not aligned dimensions

Open
#54 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This might be related to #53.
When I try to fit an online Statistic on a cubetable that is build of a cube which has the lon and lat axis at position 3 and 4 this goes through, but it builds only one label from the palfreq mask.
palfreqmix is a cube that was build from cubefromshape in ESDL.jl.

Sorry, that this is not really a MWE.

julia> ctmix = CubeTable(metrics = cubemix, include_axes=(:Distfuns, :FrequencyBins), palfreq=palfreqmix)
Datacube iterator with 6048 elements with fields: ("metrics", "palfreq", "Distfuns", "FrequencyBins")

julia> cubemix
YAXArray with the following dimensions
Distfuns            Axis with 3 elements: euclidean crosscormax cityblock 
FrequencyBins       Axis with 3 elements: Fast Annual Slow 
Lon                 Axis with 21 Elements from 627309.15 to 627909.15
Lat                 Axis with 32 Elements from 9.31474066e6 to 9.31381066e6
Total size: 23.62 KB


julia> cubemixperm = permutedims(cubemix, (3,4,1,2))
YAXArray with the following dimensions
Lon                 Axis with 21 Elements from 627309.15 to 627909.15
Lat                 Axis with 32 Elements from 9.31474066e6 to 9.31381066e6
Distfuns            Axis with 3 elements: euclidean crosscormax cityblock 
FrequencyBins       Axis with 3 elements: Fast Annual Slow 
Total size: 23.62 KB


julia> ctmixperm = CubeTable(metrics = cubemixperm, include_axes=(:Distfuns, :FrequencyBins), palfreq=palfreqmix)
Datacube iterator with 6048 elements with fields: ("metrics", "palfreq", "Distfuns", "FrequencyBins")

julia> fitcubemeanmix = cubefittable(ctmix, Mean(),:metrics, by=(:palfreq,:Distfuns, :FrequencyBins))
YAXArray with the following dimensions
Label1              Axis with 1 elements: 1.0e32 
Distfuns            Axis with 3 elements: euclidean crosscormax cityblock 
FrequencyBins       Axis with 3 elements: Fast Annual Slow 
Total size: 72.0 bytes


julia> fitcubemeanmixperm = cubefittable(ctmixperm, mean(),:metrics, by=(:palfreq,:Distfuns, :FrequencyBins))
YAXArray with the following dimensions
Label1              Axis with 2 elements: 9.0 1.0e32 
Distfuns            Axis with 3 elements: euclidean crosscormax cityblock 
FrequencyBins       Axis with 3 elements: Fast Annual Slow 
Total size: 144.0 bytes

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 cubefittable and CubeTable entry points, then reproduce the provided examples with cubemix and cubemixperm. Compare the grouping results for aligned and non-aligned dimensions; done means by=(:palfreq, :Distfuns, :FrequencyBins) finds the expected labels in both cases.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.