UnROOT.jl icon indicating copy to clipboard operation
UnROOT.jl copied to clipboard

[RNTuple] Writing Phase 1

Open Moelf opened this issue 1 year ago • 2 comments

This implements Phase 1 as outline in #336

julia> using UnROOT

julia> f = tempname()
"/tmp/jl_Vihin4X8H2"

julia> a = Dict("a" => rand(UInt32, 13));

julia> UnROOT.write_rntuple(open(f, "w"), a)

julia> LazyTree(f, "myntuple")
 Row │ a
     │ UInt32
─────┼────────────
 1   │ 4157448934
 2   │ 1517003214
 3   │ 3621726506
 4   │ 1460426740
 5   │ 3377398072
 6   │ 3689650254
 7   │ 1067622026
 8   │ 2595970883
 9   │ 681771139
 10  │ 2811723385
 11  │ 3599332316
 12  │ 418169821
 13  │ 4049611339


julia> LazyTree(f, "myntuple").a == a["a"]
true
  • [x] Check C++ ROOT can read this
julia> using UnROOT

julia> UnROOT.write_rntuple(open("a.root", "w"), Dict("a" => UInt32[0xcececece]))
In [1]: import ROOT

In [3]: df =  ROOT.RDataFrame("myntuple", "a.root")
[ROOT.NTuple] Warning /build/jenkins/workspace/parallel_publishing_full_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RPageStorageFile.cxx:289 in ROOT::Experimental::Internal::RPageSourceFile::LoadStructureImpl()::<lambda()>:0: RuntimeWarning: Pre-release format version: RC 2

In [4]: list(df.Take['std::uint32_t']('a'))
Out[4]: [3469659854]
julia> UnROOT.write_rntuple(open("a.root", "w"), Dict("abcd" => UInt32[0xcececece, 0xaebecede]))
In [6]: df =  ROOT.RDataFrame("myntuple", "a.root")

In [7]: list(df.Take['std::uint32_t']('abcd'))
Out[7]: [3469659854, 2931740382]
$ root --version
ROOT Version: 6.33.01
Built for linuxx8664gcc on Jun 28 2024, 23:10:42
From heads/master@v6-31-01-2482-g50ec910e98

Moelf avatar Jun 30 '24 07:06 Moelf

Codecov Report

Attention: Patch coverage is 89.97494% with 40 lines in your changes missing coverage. Please review.

Project coverage is 85.01%. Comparing base (ccd8366) to head (23e3b93). Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/RNTuple/Writing/TFileWriter.jl 89.76% 39 Missing :warning:
src/RNTuple/footer.jl 92.30% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
+ Coverage   84.24%   85.01%   +0.76%     
==========================================
  Files          19       20       +1     
  Lines        2565     2950     +385     
==========================================
+ Hits         2161     2508     +347     
- Misses        404      442      +38     

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

codecov[bot] avatar Jun 30 '24 15:06 codecov[bot]

Yeah that's something I still have to figure out. Basically changing that moves too many stuff at the moment so I haven't figured out what bytes to update etc.

Moelf avatar Jul 03 '24 13:07 Moelf

still works as of:

$ root --version
ROOT Version: 6.33.01
Built for linuxx8664gcc on Sep 23 2024, 23:33:01
From heads/master@v6-31-01-3313-g2f5b71d8d9

Moelf avatar Sep 24 '24 19:09 Moelf