ServiceX data management using a configuration file
Project description
ServiceX DataBinder
Release v0.1.1
ServiceX DataBinder is a Python package for making multiple ServiceX requests and managing ServiceX delivered data from a configuration file.
Installation
pip install servicex-databinder
Configuration file
The configuration file is a yaml file containing all the information. An example configuration file is shown below:
General:
ServiceXBackendName: uproot
OutputDirectory: /path/to/output
OutputFormat: parquet
Sample:
- Name: ttH
GridDID: user.kchoi:user.kchoi.sampleA,
user.kchoi:user.kchoi.sampleB
Tree: nominal
FuncADL: "Select(lambda event: {'jet_e': event.jet_e, 'jet_pt': event.jet_pt})"
- Name: ttW
GridDID: user.kchoi:user.kchoi.sampleC
Tree: nominal
Filter: n_jet > 5
Columns: jet_e, jet_pt
ServiceX query can be constructed with either TCut syntax or func-adl.
- TCut expression1:
Filter
andColumns
- Func-adl expression2:
FuncADL
The following settings are available options:
Option for General |
Description | DataType |
---|---|---|
ServiceXBackendName |
ServiceX backend name (only uproot is supported at the moment) |
String |
OutputDirectory |
Path to the directory for ServiceX delivered files | String |
OutputFormat |
Output file format of ServiceX delivered data (only parquet is supported at the moment) |
String |
WriteOutputDict |
Write a yaml file containing Python nested dictionary of output file paths | String |
IgnoreServiceXCache |
Ignore the existing ServiceX cache and force to make ServiceX requests | Boolean |
Option for Sample |
Description | DataType |
---|---|---|
Name |
sample name defined by a user | String |
GridDID |
Rucio Dataset Id (DID) for a given sample; Can be multiple DIDs separated by comma | String |
Tree |
Name of the input ROOT TTree |
String |
Filter 1 |
Selection in the TCut syntax, e.g. jet_pt > 10e3 && jet_eta < 2.0 |
String |
Columns 1 |
List of columns (or branches) to be delivered; multiple columns separately by comma | String |
FuncADL 2 |
func-adl expression for a given sample | String |
Deliver data
from servicex_databinder import DataBinder
sx_db = DataBinder('<CONFIG>.yml')
out = sx_db.deliver()
The function deliver()
returns a Python nested dictionary: out['<SAMPLE>']['<TREE>'] = [ List of output files ]
.
Acknowledgements
Support for this work was provided by the the U.S. Department of Energy, Office of High Energy Physics under Grant No. DE-SC0007890
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for servicex_databinder-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc4201cab414fb00e45c52656a42aab265841fac371f6a78865b6708bfc5f83a |
|
MD5 | e2c0e8ca633bb8aa2a620b138670395a |
|
BLAKE2b-256 | 1075e623f5e077ac4696be1884d2ea338bb2d3d775c2a690829bf8bd5eda7773 |
Hashes for servicex_databinder-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 008cecb1b7f87604b6ad41ef8c57ae34c111e0496f2051c3ab21df8370626e2a |
|
MD5 | f420b0817eb8fae734ebef5362d576cb |
|
BLAKE2b-256 | d4a214ae0f36b934c9ea50c9dfe7b6f57dbc403f483166712550ec63415427b2 |