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

Improves streamer logic for multiple jaggednes #231

Merged
merged 4 commits into from
Mar 30, 2023

Conversation

tamasgal
Copy link
Member

This adds support for triply jagged stuff, which is buried as vector<something> inside nested classes.

Currently only int32 and double is implemented and this needs a bigger refactoring, now that I understand a bit better a few more edge-cases.

I'll go ahead with the merge since it does not affect the existing functionality. It's clear that the implementation is suboptimal but everything is typesafe, we just need to redesign the Jagg-type-system to e.g. use parametric types for the jaggedness or so.

With this patch, KM3NeT offline ROOT files (simulation and reco) are now fully readable ;)

julia> f = UnROOT.samplefile("triply_jagged_via_custom_class.root");

julia> b = LazyBranch(f, "E/Evt/trks/trks.fitinf");

julia> typeof(b)
LazyBranch{SubArray{Vector{Float64}, 1, Vector{Vector{Float64}}, Tuple{UnitRange{Int64}}, true}, UnROOT.Offset6jaggjagg, ArraysOfArrays.VectorOfVectors{Vector{Float64}, Vector{Vector{Float64}}, Vector{Int32}, Vector{Tuple{}}}}

julia> b[2][3]
8-element Vector{Float64}:
   0.006795213995646554
   0.004663009290056574
 -78.11879123256927
  60.0
   0.0
   0.0
   2.164796367611156
  39.0

@tamasgal tamasgal changed the title Improves streamer logic Improves streamer logic for multiple jaggednes Mar 30, 2023
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Patch coverage: 93.33% and project coverage change: +0.76 🎉

Comparison is base (4ee582e) 88.14% compared to head (e82d2cd) 88.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
+ Coverage   88.14%   88.91%   +0.76%     
==========================================
  Files          18       18              
  Lines        2126     2147      +21     
==========================================
+ Hits         1874     1909      +35     
+ Misses        252      238      -14     
Impacted Files Coverage Δ
src/utils.jl 96.15% <90.90%> (-3.85%) ⬇️
src/root.jl 94.54% <94.73%> (+0.33%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tamasgal tamasgal merged commit 09a3d2a into master Mar 30, 2023
@tamasgal tamasgal deleted the improve-streamer-logic branch March 30, 2023 21:35
@@ -55,32 +55,33 @@ struct Nojagg <:JaggType end
struct Nooffsetjagg<:JaggType end
struct Offsetjagg <:JaggType end
struct Offsetjaggjagg <:JaggType end
# this is a preliminary workaround for 6 byte offset jaggedness
Copy link
Member

@Moelf Moelf Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf hahaha?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry 🤣

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.

2 participants