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

[RNTuple] write multiple fields #349

Merged
merged 22 commits into from
Oct 16, 2024
Merged

[RNTuple] write multiple fields #349

merged 22 commits into from
Oct 16, 2024

Conversation

Moelf
Copy link
Member

@Moelf Moelf commented Sep 28, 2024

Nitems = 10
       data = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
       newtable = Dict(
               "x1" => Float64.(data),
               "x2" => Float32.(data),
               "x3" => Int32.(data),
               "y1" => UInt16.(data),
           )
       UnROOT.write_rntuple(open("/tmp/a.root", "w"), newtable; rntuple_name="myntuple")
       LazyTree("/tmp/a.root", "myntuple")
 Row │ x1       y1      x2       x3
     │ Float64  UInt16  Float32  Int32
─────┼─────────────────────────────────
 15.0      5       5.0      5
 26.0      6       6.0      6
 37.0      7       7.0      7
 48.0      8       8.0      8
 59.0      9       9.0      9
 610.0     10      10.0     10
 711.0     11      11.0     11
 812.0     12      12.0     12
 913.0     13      13.0     13
 1014.0     14      14.0     14

ROOT is now happy

$ root --version
ROOT Version: 6.33.01
Built for linuxx8664gcc on Oct 03 2024, 22:53:26
From heads/master@v6-31-01-3492-g65de35a80f
$ python
Python 3.11.9 (main, Jun 24 2024, 14:32:54) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
df  =  ROOT.RDataFrame("myntuple", "/tmp/a.root")
[ROOT.NTuple] Warning /build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RPageStorageFile.cxx:326 in ROOT::Experimental::Internal::RPageSourceFile::LoadStructureImpl()::<lambda()>:0: RuntimeWarning: Pre-release format version: RC 2
>>> df.GetColumnNames()
vector<string>{ "x1", "x2", "x3", "y1" }
>>> list(df.Take['std::int32_t']("x3"))
[5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
>>> list(df.Take['float']("x2"))
[5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0]
  • Do round trips within UnROOT.jl
  • make ROOT happy

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 89.02439% with 9 lines in your changes missing coverage. Please review.

Project coverage is 84.65%. Comparing base (10599f9) to head (1094f62).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/RNTuple/Writing/page_writing.jl 82.05% 7 Missing ⚠️
src/RNTuple/Writing/TFileWriter.jl 97.56% 1 Missing ⚠️
src/RNTuple/footer.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   84.57%   84.65%   +0.07%     
==========================================
  Files          21       21              
  Lines        2976     3043      +67     
==========================================
+ Hits         2517     2576      +59     
- Misses        459      467       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Moelf Moelf changed the title [RNTuple] write multiple cols [RNTuple] write multiple fields Sep 28, 2024
@Moelf Moelf requested review from tamasgal and peremato October 11, 2024 21:14
@Moelf
Copy link
Member Author

Moelf commented Oct 11, 2024

the current "C++ ROOT read back" CI setup is a bit janky, it will be better once there exists a ROOT release with 1.0.0 RNTuple spec.

I also would want to move to using Julia's Artifacts system for distribution test .root files, but for now maybe this is good enough.

Another thing is I bumped version of Julia and StaticArrays, @tamasgal can you let me know if you guys all moved to at least 1.10?

@Moelf Moelf requested a review from pviscone October 11, 2024 21:15
@tamasgal
Copy link
Member

Yes that's fine, keep moving!

src/RNTuple/Writing/TFileWriter.jl Show resolved Hide resolved
src/RNTuple/Writing/page_writing.jl Show resolved Hide resolved
@Moelf Moelf merged commit 0110b5f into main Oct 16, 2024
12 checks passed
@Moelf Moelf deleted the rntuple_writing_more_cols branch October 16, 2024 08:12
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