This project demonstrates how to use the uproot-custom package to customize branch data reading. You can use this project as a template to create your own downstream projects that leverage uproot-custom for reading custom ROOT data structures.
It implements 2 factory-reader pairs to read TOverrideStreamer and TObjWithObjArray objects from demo ROOT files. The class definitions and the program generating demo file is located at ./gen-demo-data.
A typical downstream project using uproot-custom will have the following structure:
my_project/
├── pyproject.toml
├── my_module/
│ └── Python source files...
└── cpp/
└── C++ source files...
pyproject.tomlfile is required to specify the project metadata and build system requirements.my_moduledirectory contains the Python source files, which is the entry point for users to doimport my_module.cppdirectory contains the C++ source files that implement custom data reading logic.
Tip
The name of this example project is my-reader, and the Python module name is my_reader. See Python Packaging User Guide to learn more about pyproject.toml.
To install this package, run:
cd /path/to/this/project
pip install .You can also install it in editable mode for development:
cd /path/to/this/project
pip install -e .