-
Notifications
You must be signed in to change notification settings - Fork 18
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
factorize interpretation #106
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #106 +/- ##
==========================================
- Coverage 89.84% 89.59% -0.25%
==========================================
Files 11 11
Lines 1319 1326 +7
==========================================
+ Hits 1185 1188 +3
- Misses 134 138 +4
Continue to review full report at Codecov.
|
OK thanks! I just run some random script, just to make sure everything is fine |
Alright, it works nicely! I am just wondering how we should deal with code repetitions in such cases: function interped_data(rawdata, rawoffsets, ::Type{Vector{_KM3NETDAQHit}}, ::Type{Nojagg})
UnROOT.splitup(rawdata, rawoffsets, _KM3NETDAQHit, skipbytes=10)
end
function interped_data(rawdata, rawoffsets, ::Type{Vector{_KM3NETDAQHit}}, ::Type{Offsetjagg})
UnROOT.splitup(rawdata, rawoffsets, _KM3NETDAQHit, skipbytes=10)
end |
I had originally tried to make a Union like this -function interped_data(rawdata, rawoffsets, ::Type{Vector{_KM3NETDAQHit}}, ::Type{Nojagg})
- UnROOT.splitup(rawdata, rawoffsets, _KM3NETDAQHit, skipbytes=10)
-end
-function interped_data(rawdata, rawoffsets, ::Type{Vector{_KM3NETDAQHit}}, ::Type{Offsetjagg})
- UnROOT.splitup(rawdata, rawoffsets, _KM3NETDAQHit, skipbytes=10)
-end
+function interped_data(rawdata, rawoffsets, ::Type{Vector{_KM3NETDAQHit}}, ::Type{Union{Nojagg,Offsetjagg}}) but I saw tons of unit test failures like this ArgumentError: cannot reinterpret `UInt8` as `Vector{UnROOT._KM3NETDAQHit}`, type `Vector{UnROOT._KM3NETDAQHit}` is not a bits type
Stacktrace:
[1] (::Base.var"#throwbits#241")(S::Type, T::Type, U::Type)
@ Base ./reinterpretarray.jl:16
[2] reinterpret(#unused#::Type{Vector{UnROOT._KM3NETDAQHit}}, a::Vector{UInt8})
@ Base ./reinterpretarray.jl:36
[3] interped_data(rawdata::Vector{UInt8}, rawoffsets::Vector{Int32}, #unused#::Type{Vector{UnROOT._KM3NETDAQHit}}, #unused#::Type{UnROOT.Nojagg})
@ UnROOT ~/.julia/dev/UnROOT/src/root.jl:201 so the |
Hmm... maybe some more fine-graded hierarchy for the |
We don't want this right? :) for J in (:Nojagg,:Offsetjagg)
T = _KM3NETDAQHit # can loop over this to get the other struct too
@eval function UnROOT.interped_data(rawdata, rawoffsets, ::Type{Vector{$T}}, ::Type{$J})
UnROOT.splitup(rawdata, rawoffsets, $T, skipbytes=10)
end
end |
I don't know, probably not 😆 |
maybe it's time to figure out a more sane customization interface |
I'm also not opposed to keeping the main |
* try1 * recursive and unit tests * add files * actually add tests
* iterate on baskets * 10-50% speedup for simple benchmarks * simplify
* avoid slow merging * faster than in the try block * faster without dict * single read for rest of tkey bytes
* add some functions * add tests * fix
* add broadcasting fusion * fix allocation and let getindex be lazy * better lazyevent display * fix CI * add tree displaying tests
* Use two threads * Remove Julia 1.3 * Oh, we still support Julia 1.3, readding * Simplify CI and fix threading in Julia 1.3
* Improve thread handling in tests * Test threading
* fix stacktrace too long * fix stacktrace too long try 2 * fix stacktrace too long try 3 * fix before 1.6
…e async, add remote (HTTP) source, (JuliaHEP#154) * reduce basket reading io from 4 -> 1 * use more OffsetBuffer when appropriate * bump compatibility * add HTTP source support * Mmap based local file * async chunking * better error * 100% lock-free * scitoken ready * faster display branch * backport upgrade
* fix split branches
* fix windows `id -u` * remove hacky precompile * fix CI
bump version
* Fix error when file is not existent * Use SystemError instead of general error * Add test for non-existent-file opening
* Add samples for issue 165 * fix C-stype array * fix io Co-authored-by: Jerry Ling <[email protected]>
bump version
* normalize branch alias * touch up docs [skipci]
* xrootd * bump Julia requirement to >=1.6
* Add skeleton * Add open journal PDF generator GHA * Fix path to source file * Set output path * summary and statement of need * Minor cosmetics * Add comparison intro and uproot * Add uproot reference * add functionality * add performance citation * small additions * for ci * Cite pandas and numpy * Add ROOT citation * Cleanup and some additions * Minor updates and additions * Update references * Cleanup and additions * Update conclusions with Jerry's comments * Fix typo * Add NanoAOD refernce * Add reference to CMS/NanoAOD * Fix pandas reference * Add spaces between words and references * Fix typo Co-authored-by: Jerry Ling <[email protected]> Co-authored-by: Nick Amin <[email protected]>
ehh, as always I fucked up the rebase |
Codecov Report
@@ Coverage Diff @@
## master #106 +/- ##
==========================================
- Coverage 90.15% 89.95% -0.21%
==========================================
Files 11 11
Lines 1605 1612 +7
==========================================
+ Hits 1447 1450 +3
- Misses 158 162 +4
Continue to review full report at Codecov.
|
Split up the large interped_data into smaller chunks for non-, singly-, doubly-jagged branches in case we want to cleanly specialize further (like for
Bool
).Replaces #95 .