Submit Functional Queries to a ServiceX endpoint.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
func_adl_servicex
Send func_adl expressions to a ServiceX endpoint
Introduction
This package contains the single object ServiceXSourceXAOD and ``ServiceXSourceUpROOTwhich can be used as a root of afunc_adl` expression to query large LHC datasets from an active `ServiceX` instance located on the net.
See below for simple examples.
Further Information
servicexdocumentationfunc_adldocumentation
Usage
To use func_adl on servicex, the only func_adl package you only need to install this package. All others required will be pulled in as dependencies of this package.
Using the xAOD backend
See the further information for documentation above to understand how this works. Here is a quick sample that will run against an ATLAS xAOD backend in servicex to get out jet pt's for those jets with pt > 30 GeV.
from func_adl_servicex import ServiceXSourceXAOD
dataset_xaod = "mc15_13TeV:mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.merge.DAOD_STDM3.e3601_s2576_s2132_r6630_r6264_p2363_tid05630052_00"
ds = ServiceXSourceXAOD(dataset_xaod)
data = ds \
.SelectMany('lambda e: (e.Jets("AntiKt4EMTopoJets"))') \
.Where('lambda j: (j.pt()/1000)>30') \
.Select('lambda j: j.pt()') \
.AsAwkwardArray(["JetPt"]) \
.value()
print(data['JetPt'])
Using the uproot backend
See the further information for documentation above to understand how this works. Here is a quick sample that will run against a ROOT file (TTree) in the uproot backend in servicex to get out jet pt's. Note that the image name tag is likely wrong here. See XXX to get the current one.
from servicex import ServiceXDataset
from func_adl_servicex import ServiceXSourceUpROOT
dataset_uproot = "user.kchoi:user.kchoi.ttHML_80fb_ttbar"
uproot_transformer_image = "sslhep/servicex_func_adl_uproot_transformer:issue6"
sx_dataset = ServiceXDataset(dataset_uproot, image=uproot_transformer_image)
ds = ServiceXSourceUpROOT(sx_dataset, "nominal")
data = ds.Select("lambda e: {'lep_pt_1': e.lep_Pt_1, 'lep_pt_2': e.lep_Pt_2}") \
.AsParquetFiles('junk.parquet') \
.value()
print(data)
Development
PR's are welcome! Feel free to add an issue for new features or questions.
The master branch is the most recent commits that both pass all tests and are slated for the next release. Releases are tagged. Modifications to any released versions are made off those tags.
Qastle
This is for people working with the back-ends that run in servicex.
This is the qastle produced for an xAOD dataset:
(call EventDataset 'ServiceXDatasetSource')
(the actual dataset name is passed in the servicex web API call.)
This is the qastle produced for a ROOT flat file:
(call EventDataset 'ServiceXDatasetSource' 'tree_name')
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file func_adl_servicex-1.1b2.tar.gz.
File metadata
- Download URL: func_adl_servicex-1.1b2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
831cddbe87243d16ac9fcc0cb4637502e4cfce3fc007adfdd4695d5523decc82
|
|
| MD5 |
5e5ae5b2b3c46434a1bd273f2f612dbd
|
|
| BLAKE2b-256 |
25630b383d5f4b19cab55259a55dc412c1f2685c2612b13301689f5c35daf517
|
File details
Details for the file func_adl_servicex-1.1b2-py3-none-any.whl.
File metadata
- Download URL: func_adl_servicex-1.1b2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aff6e36b8b0956f32aed6950fc0f2b446a6aa6663e84f5b432cfd1fd325da85
|
|
| MD5 |
1c9b2d371af2198d8d2c09f65078c750
|
|
| BLAKE2b-256 |
528834b5aeba138bd99d501046913ee6ebb32f23df160eed01e95c86eda6954b
|