Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@
# For the list of contributors see $ROOTSYS/README/CREDITS. #
################################################################################

r"""
\pythondoc RNTupleWriter

RNTupleWriter is an interface to write RNTuples to storage.

A simple way to write an RNTuple in python is by:
- creating a model and adding fields to it
- opening an RNTupleWriter
- creating entries and filling them with data
- committing entries to the RNTuple via writer.Fill(entry)

\code{.py}
import ROOT

# Create the model
model = ROOT.RNTupleModel.Create()

# Define the schema by adding fields to the model.
model.MakeField['int']("foo")

# Create a writer as a context manager
with ROOT.RNTupleWriter.Recreate(model, "myNtuple", "file.root") as writer:
# create entries and write them to the RNTuple
for i in range(0,10):
entry = writer.CreateEntry()
entry['foo'] = i
writer.Fill(entry)
# On destruction, the writer will flush the written data to disk

\endcode

\endpythondoc
"""

from . import pythonization
from ._pyz_utils import MethodTemplateGetter, MethodTemplateWrapper

Expand Down