Open asinghvi17 opened 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.87%. Comparing base (
37cd1eb
) to head (05c464d
). Report is 3 commits behind head on main.:exclamation: Current head 05c464d differs from pull request most recent head a10403b. Consider uploading reports for the commit a10403b to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
May need to check we don't have function metadata end
or metadata(x) = nothing
lying around
We have function metadata end
in interface.jl that needs removing.
And these methods are going to be a piracy problem:
[2] metadata(::Tuple{})
@ DimensionalData.Dimensions ~/.julia/dev/DimensionalData/src/Dimensions/dimension.jl:232
[15] metadata(ds::Tuple, I)
@ DimensionalData.Dimensions ~/.julia/dev/DimensionalData/src/Dimensions/dimension.jl:234
[16] metadata(ds::Tuple, i1, I...)
@ DimensionalData.Dimensions ~/.julia/dev/DimensionalData/src/Dimensions/dimension.jl:233
[17] metadata(ds::Tuple)
@ DimensionalData.Dimensions ~/.julia/dev/DimensionalData/src/Dimensions/dimension.jl:231
[18] metadata(x)
@ ~/.julia/dev/DimensionalData/src/Lookups/metadata.jl:107
I guess we can make all the Tuple
s into DimTuple
so we own them, with the slight downside that it will error on empty Tuple{}
.
The untyped case may be a problem too, we can try deleting it and see what breaks.
Thanks - will take a look today!
julia> DataAPI.metadata(tuple())
ERROR: ArgumentError: Objects of type Tuple{} do not support reading metadata
Stacktrace:
[1] metadata(x::Tuple{}; style::Bool)
@ DataAPI ~/.julia/packages/DataAPI/atdEM/src/DataAPI.jl:373
[2] metadata(x::Tuple{})
@ DataAPI ~/.julia/packages/DataAPI/atdEM/src/DataAPI.jl:371
[3] top-level scope
@ REPL[41]:1
so that method is at least open...
Ah damn, I just realized that the way that DD handles metadata (DD.NoLookup
) is not the same way as DataAPI handles metadata (Nothing
). I guess this could potentially stay the same for now, and maybe just hook into DataAPI.metadata
as well for DD native types...
DD.NoMetadata
but we could maybe change it. One nice thing about NoMetadata
is Dict functions like haskey
work on it (and we can as more as needed) so its a nice fallback that both wont cause errors anywhere and e.g. works on GPUs like nothing
would.
Fix #706 by explicitly importing DataAPI.metadata.