JuliaDataCubes / JuliaDataCubes/YAXArrays.jl
convert(Matrix, x') is very slow
Open
Nobody has claimed this yet.
bug
- Dominant language
- Julia
- Stars
- 132
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
convert(Matrix, x') is so slow that I haven't gotten it to finish. convert(Matrix, x) works just fine.
julia> using YAXArrays, Zarr
julia> path = "~/data/DataCube/v3.0.2/esdc-8d-0.25deg-1x720x1440-3.0.2.zarr"
"~/data/DataCube/v3.0.2/esdc-8d-0.25deg-1x720x1440-3.0.2.zarr"
julia> ds = open_dataset(path)
YAXArray Dataset
Shared Axes:
↓ lon Sampled{Float64} -179.875:0.25:179.875 ForwardOrdered Regular Points,
→ lat Sampled{Float64} -89.875:0.25:89.875 ForwardOrdered Regular Points,
↗ Ti Sampled{DateTime} [1979-01-05T00:00:00, …, 2021-12-31T00:00:00] ForwardOrdered Irregular Points
Variables:
....
julia> mat = ds.air_temperature_2m[Ti = 1000]
╭──────────────────────────────╮
│ 1440×720 YAXArray{Float32,2} │
├──────────────────────────────┴──────────────────────────────────────── dims ┐
↓ lon Sampled{Float64} -179.875:0.25:179.875 ForwardOrdered Regular Points,
→ lat Sampled{Float64} -89.875:0.25:89.875 ForwardOrdered Regular Points
├──────────────────────────────────────────────────────
....
julia> @time convert(Matrix{Float32}, mat)
1.809297 seconds (5.15 M allocations: 362.756 MiB, 5.92% gc time, 98.13% compilation time)
...
julia> @time convert(Matrix{Float32}, mat')
# has to be interrupted
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Julia example with YAXArrays and Zarr, comparing convert(Matrix{Float32}, mat) with convert(Matrix{Float32}, mat'). Trace the conversion path for the transposed YAXArray and verify that the transposed conversion completes without the severe slowdown or excessive allocations shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100