⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@silverweed
Copy link
Contributor

This Pull request:

allows RMiniFileWriter to handle RFile and exposes an experimental way to create an RNTupleWriter using RFile.
Currently the semantics are the same as the TDirectory overload: you pass in a reference to RFile and are responsible to keep the file alive until the RNTupleWriter is done.

Main question to answer: is this the semantics we want? It seems to me that it's the most straightforward API in C++, but it requires some extra work in python to avoid use-after-free cases like:

def CreateWriter():
  file = ROOT.RFile.Open(...)
  writer = ROOT.Experimental.RNTupleWriter_Append(..., file)
  return writer  # <- file may be GC'd from here on

This should be solveable by pythonizing Append to hold on to the file's proxy on the python side, but there might be additional complications I'm not considering. I'm open for discussion.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Just for the time being, to avoid exposing experimental API as a public
method of the RNTupleWriter, use a free friend function in the Experimental
namespace. When we settle on the RFile/RNTuple writing semantics we will
remove this function and replace it with a factory method.
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 16h 40m 34s ⏱️
 3 814 tests  3 765 ✅ 0 💤 49 ❌
76 772 runs  76 723 ✅ 0 💤 49 ❌

For more details on these failures, see this check.

Results for commit d4d30f6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant