Skip to main content

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 dataset
  • query — a FuncADL ObjectStream built from config.FuncADLQueryPHYS() or config.FuncADLQueryPHYSLITE()
  • config — an xAODConfig instance

Returns a dict of arrays (or an awkward array if config.awk=True).

Related Projects

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

func_adl_local-0.1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

func_adl_local-0.1.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for func_adl_local-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4c4059e5b027402329d467c0ea70a4f482d6088602e67fb62e494273edb68adb
MD5 66d319374b0c5407da02e0fb186b3f18
BLAKE2b-256 972d9a3832d0be7baf0f53ab27227e83d4e21335883e9c98386833a7e80e111f

See more details on using hashes here.

Provenance

The following attestation bundles were made for func_adl_local-0.1.3.tar.gz:

Publisher: publish.yml on RogerJanusiak/func_adl_local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for func_adl_local-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b08bd16d09311658b93452b6e6545a11e5111b5f46311b7af047aa87c2a9a2ae
MD5 c8f7976afab29e8797a99aabe620f7ed
BLAKE2b-256 3ddf5d8aad188e50e6128d5e9937596694bc680790f5b95117c636466ccd1c39

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page