Run FuncADL queries on local files without ServiceX
Project description
func_adl_local
Run FuncADL queries on local files without ServiceX.
FuncADL (Functional Analysis Description Language) is a declarative query language for HEP data analysis. Normally it is used with ServiceX to query remote datasets. func_adl_local brings that same interface to files on your local machine — no ServiceX deployment required.
Installation
pip install func_adl_local
Usage
xAOD files
Use xAODConfig to configure the ATLAS release and runtime platform, then call get_data with your dataset path and FuncADL query:
from func_adl_local import xAODConfig, get_data
config = xAODConfig(
release=22, # ATLAS release: 21, 22, or 25
platform="docker", # "docker", "singularity", or "wsl2"
)
# Build a query using the release-appropriate FuncADL dataset type
query = config.FuncADLQueryPHYS().SelectMany(lambda e: e.Jets("AntiKt4EMTopoJets")).Select(
lambda j: {"pt": j.pt(), "eta": j.eta()}
)
result = get_data("path/to/file.root", query, config)
To get the result as an awkward-array, set awk=True:
config = xAODConfig(release=22, awk=True)
result = get_data("path/to/file.root", query, config)
# result is now an awkward array
Available query types:
| Method | Releases |
|---|---|
config.FuncADLQueryPHYS() |
21, 22, 25 |
config.FuncADLQueryPHYSLITE() |
22, 25 |
Platforms:
| Value | Description |
|---|---|
"docker" |
Run the transformer in Docker (default) |
"singularity" |
Run in Singularity/Apptainer |
"wsl2" |
Run in WSL2 |
Docker image versions:
xAODConfig automatically selects the latest image for the chosen release. You can inspect available versions or pin to a specific one:
config = xAODConfig(release=22)
print(config.available_versions) # all available tags
print(config.latest_r22_version) # e.g. "22.2.110"
config_pinned = xAODConfig(release=22, version="22.2.107")
Uproot / columnar files
For ROOT files and other columnar formats, use the re-exported UprootDataset from func_adl_uproot:
from func_adl_local import UprootDataset
ds = UprootDataset("path/to/file.root", "treename")
result = ds.Select(lambda e: {"pt": e["pt"]}).AsAwkwardArray().value()
API Reference
xAODConfig
@dataclass
class xAODConfig:
release: int = 21 # ATLAS release year: 21, 22, or 25
version: str = "latest" # Docker image tag, or "latest" to auto-select
platform: str = "docker" # "docker", "singularity", or "wsl2"
ignore_cache: bool = False # Bypass the local ServiceX cache
awk: bool = False # Return results as awkward arrays
get_data(ds_name, query, config)
Runs a FuncADL query against a local xAOD file.
ds_name— path to the local datasetquery— a FuncADLObjectStreambuilt fromconfig.FuncADLQueryPHYS()orconfig.FuncADLQueryPHYSLITE()config— anxAODConfiginstance
Returns a dict of arrays (or an awkward array if config.awk=True).
Related Projects
- func_adl — core FuncADL library
- func_adl_uproot — Uproot backend for FuncADL
- servicex_local — local ServiceX runtime
- ServiceX — remote data delivery service
- func_adl_servicex — FuncADL ServiceX backend
Contributing
Contributions are welcome! Please open an issue or pull request on GitHub.
License
MIT License
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_local-0.1.3.tar.gz.
File metadata
- Download URL: func_adl_local-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c4059e5b027402329d467c0ea70a4f482d6088602e67fb62e494273edb68adb
|
|
| MD5 |
66d319374b0c5407da02e0fb186b3f18
|
|
| BLAKE2b-256 |
972d9a3832d0be7baf0f53ab27227e83d4e21335883e9c98386833a7e80e111f
|
Provenance
The following attestation bundles were made for func_adl_local-0.1.3.tar.gz:
Publisher:
publish.yml on RogerJanusiak/func_adl_local
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
func_adl_local-0.1.3.tar.gz -
Subject digest:
4c4059e5b027402329d467c0ea70a4f482d6088602e67fb62e494273edb68adb - Sigstore transparency entry: 1439212478
- Sigstore integration time:
-
Permalink:
RogerJanusiak/func_adl_local@1e34b10a38c78a574c38f4ea2469ca26be0344de -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RogerJanusiak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1e34b10a38c78a574c38f4ea2469ca26be0344de -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file func_adl_local-0.1.3-py3-none-any.whl.
File metadata
- Download URL: func_adl_local-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b08bd16d09311658b93452b6e6545a11e5111b5f46311b7af047aa87c2a9a2ae
|
|
| MD5 |
c8f7976afab29e8797a99aabe620f7ed
|
|
| BLAKE2b-256 |
3ddf5d8aad188e50e6128d5e9937596694bc680790f5b95117c636466ccd1c39
|
Provenance
The following attestation bundles were made for func_adl_local-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on RogerJanusiak/func_adl_local
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
func_adl_local-0.1.3-py3-none-any.whl -
Subject digest:
b08bd16d09311658b93452b6e6545a11e5111b5f46311b7af047aa87c2a9a2ae - Sigstore transparency entry: 1439212481
- Sigstore integration time:
-
Permalink:
RogerJanusiak/func_adl_local@1e34b10a38c78a574c38f4ea2469ca26be0344de -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RogerJanusiak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1e34b10a38c78a574c38f4ea2469ca26be0344de -
Trigger Event:
workflow_dispatch
-
Statement type: