Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collect of ConcatDiskArray #427

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

danlooo
Copy link
Member

@danlooo danlooo commented Aug 26, 2024

This PR aims to fix the display order of ConcatDiskArray.
Unfortunately, this is going to clash with the DimensionalData.jl Generator behavior, which in a lot of cases will return a DimArray because of the DimUnitRanges returned from axes.
See also meggart/DiskArrays.jl#185 and rafaqz/DimensionalData.jl#771

using DimensionalData
using YAXArrays
using Zarr
using GLMakie

lon_range = X(-180:180)
lat_range = Y(-90:90)
data = [exp(cosd(lon)) + 3 * (lat / 90) for lon in lon_range, lat in lat_range]
a = YAXArray((lon_range, lat_range), data)
ds_ram = Dataset(; properties=Dict(), a)
path = tempname()
savedataset(ds_ram; path=path)
ds_disk = open_dataset(path)
a_ram = cat(ds_ram.a[X=1:100], ds_ram.a[X=101:200], dims=:X)
a_disk = cat(ds_disk.a[X=1:100], ds_disk.a[X=101:200], dims=:X)

all(a_disk .== a_ram) # ok
heatmap(a_ram) # ok
heatmap(a_disk) # bug
heatmap(collect(a_disk)) # ok

image

@danlooo danlooo changed the title Fix collect of concat arrays Fix collect of ConcatDiskArray Aug 26, 2024
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.39%. Comparing base (59d23fc) to head (8ee770d).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #427      +/-   ##
==========================================
+ Coverage   68.30%   68.39%   +0.08%     
==========================================
  Files          12       12              
  Lines        1773     1778       +5     
==========================================
+ Hits         1211     1216       +5     
  Misses        562      562              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

coveralls commented Aug 26, 2024

Pull Request Test Coverage Report for Build 10557936054

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 68.468%

Totals Coverage Status
Change from base Build 10122673885: 0.02%
Covered Lines: 1216
Relevant Lines: 1776

💛 - Coveralls

@lazarusA
Copy link
Collaborator

the top-right panel looks off.

@meggart meggart merged commit df7dd5d into JuliaDataCubes:master Aug 29, 2024
11 checks passed
@meggart
Copy link
Member

meggart commented Aug 29, 2024

Thanks a lot for the patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants