JuliaDataCubes / YAXArrays.jl

Yet Another XArray-like Julia package
https://juliadatacubes.github.io/YAXArrays.jl/
Other
89 stars 12 forks source link

fix show for dataset #408

Closed briochemc closed 1 week ago

briochemc commented 1 week ago

This tiny PR fixes how datasets show for me. This is "required" because variables in a dataset are currently printed in a single line with commas, but when a variable has extra dimensions, these dimensions are printed as new lines and mess up the overall display.

Example output with this PR:

julia> g
YAXArray Dataset
Shared Axes: 
↓ nlon Sampled{Int64} 1:1:320 ForwardOrdered Regular Points,
→ nlat Sampled{Int64} 1:1:384 ForwardOrdered Regular Points
Variables: 
lat
agessc
  ↓ lev Sampled{Float64} [500.0, 1500.0, …, 512502.8125, 537500.0] ForwardOrdered Irregular Points,
  → Ti  Sampled{CFTime.DateTimeNoLeap} [CFTime.DateTimeNoLeap(0001-01-15T13:00:01), …, CFTime.DateTimeNoLeap(1200-12-15T12:00:01)] ForwardOrdered Irregular Points
lon

versus what I think it currently looks like (note how the lon variable is hard to spot on the bottom right):

julia> g
YAXArray Dataset
Shared Axes: 
↓ nlon Sampled{Int64} 1:1:320 ForwardOrdered Regular Points,
→ nlat Sampled{Int64} 1:1:384 ForwardOrdered Regular Points
Variables: 
lat, agessc
  ↓ lev Sampled{Float64} [500.0, 1500.0, …, 512502.8125, 537500.0] ForwardOrdered Irregular Points,
  → Ti  Sampled{CFTime.DateTimeNoLeap} [CFTime.DateTimeNoLeap(0001-01-15T13:00:01), …, CFTime.DateTimeNoLeap(1200-12-15T12:00:01)] ForwardOrdered Irregular Points, lon

Let me know if anything else is needed here!

felixcremer commented 1 week ago

Thanks, that looks good to me. I am going to wait for the github actions and merge afterwards.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9688169067

Details


Totals Coverage Status
Change from base Build 9662864356: -0.8%
Covered Lines: 1196
Relevant Lines: 1772

💛 - Coveralls
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.30%. Comparing base (778f635) to head (bf24420). Report is 9 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #408 +/- ## ========================================== + Coverage 68.15% 68.30% +0.14% ========================================== Files 12 12 Lines 1771 1773 +2 ========================================== + Hits 1207 1211 +4 + Misses 564 562 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9688169067

Details


Totals Coverage Status
Change from base Build 9662864356: 0.08%
Covered Lines: 1211
Relevant Lines: 1771

💛 - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9688169067

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 9662864356: 0.08%
Covered Lines: 1211
Relevant Lines: 1771

💛 - Coveralls