-
Notifications
You must be signed in to change notification settings - Fork 51
Add _show_data function to skip data loading during show #1130
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
Conversation
rafaqz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can_show_data is a bit clearer
Co-authored-by: Rafael Schouten <[email protected]>
|
I applied your suggestions and fixed the show test. julia> x = DimArray(randn(2, 3, 4), (X, Y, Z));
julia> foo(x) = maximum(x; dims=(1, 2))
foo (generic function with 1 method)
julia> @inferred foo(x)
ERROR: return type DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.Lookups.NoLookup{Base.OneTo{Int64}}}, Y{DimensionalData.Dimensions.Lookups.NoLookup{Base.OneTo{Int64}}}, Z{DimensionalData.Dimensions.Lookups.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.Lookups.NoMetadata} does not match inferred return type DimArray{Float64, 3, D, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.Lookups.NoMetadata} where D<:Tuple
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] top-level scope
@ REPL[30]:1I also get this on DimensionalData 0.29.24 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1130 +/- ##
=======================================
Coverage 86.90% 86.91%
=======================================
Files 55 55
Lines 5338 5341 +3
=======================================
+ Hits 4639 4642 +3
Misses 699 699 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is to fix the nightly tests. Because the behaviour has changed in Julia 1.14
|
The last commit was needed because the string before a multiple instance assignment fails now after JuliaLang/julia#59742. I don't see why we wanted to have a string there anyway so I converted it to proper comments. |
This is to make sure, that DiskArrays don't getindex into data during show.
I added a fallback to true so that for non-DiskArray datasets this would not change in behaviour.
I thought about using isdisk, but I wasn't sure, where I could add this check because we don't have isdisk available in DimensionalData and in the extension it is too late.
I also added a test, that checks that DiskArrays based DimArrays don't access the data.