Skip to main content

LbAPLocal

LbAPLocal is the Python library and CLI for running offline tests for the LHCb AnalysisProductions framework.

Installation

LbAPLocal is installed by default with the LHCb environment on lxplus. For users on external clusters, source the LHCb environment from CVMFS:

source /cvmfs/lhcb.cern.ch/lib/LbEnv

Usage

Usage: lb-ap [OPTIONS] COMMAND [ARGS]...

  CLI for LHCb AnalysisProductions

Options:
  -C, --change-dir PATH  Change to this directory before running
  -b, --branch TEXT      Branch or tag to use
  -v, --verbose          Enable verbose output
  --version              Show version and exit
  --help                 Show this message and exit

Commands:
  versions        List available tags of the Analysis Productions repository
  clone           Clone the AnalysisProductions repository
  checkout        Check out a branch or tag
  list            List available productions and jobs
  test            Test a job using CWL workflow
  parse-log       Analyse a Gaudi log file and show a summary with advice
  make-reproducer Create a minimal reproducer from a failed grid job
  cwl             CWL-based workflow commands (generate, run, validate, test)

Testing a job

The primary command. Generates a CWL workflow from the production configuration and executes it locally:

lb-ap test MyAnalysis My2016MagDownJob

Key options:

lb-ap test MyAnalysis MyJob -i /path/to/input.dst   # Use a specific input file
lb-ap test MyAnalysis MyJob -n 100                   # Slice input to 100 events
lb-ap test MyAnalysis MyJob --n-lfns 5               # Test with 5 input LFNs
lb-ap test MyAnalysis MyJob --pick-smallest-lfn      # Use smallest LFN for speed
lb-ap test MyAnalysis MyJob --download               # Download input files locally
lb-ap test MyAnalysis MyJob --pretty                 # Real-time TUI monitoring
lb-ap test MyAnalysis MyJob --dry-run                # Validate without executing
lb-ap test MyAnalysis MyJob -o ./output              # Custom output directory

If arguments are omitted, an interactive wizard guides you through the setup.

The -n <N> flag slices the input file to N events using GaudiConf.mergeDST:dst (remote read, local write). After slicing, a reuse hint is printed so subsequent runs can skip the slicing step by passing the sliced file with -i.

Custom input files

When testing a job that depends on another job, pass the upstream output with -i:

lb-ap test MyAnalysis MyDownstreamJob -i /path/to/upstream_output.dst

The input can be a local file path or an LFN (LFN:/lhcb/...).

Analysing log files

Parse a Gaudi log file for FATAL, ERROR, and WARNING messages with contextual advice:

lb-ap parse-log DaVinci_00012345_00006789_1.log

Log analysis is also integrated into lb-ap test — after a test completes (success or failure), any Gaudi log files in the output are automatically analysed and a summary is displayed.

Listing productions and jobs

lb-ap list                    # List available productions
lb-ap list MyAnalysis         # List jobs in a production
lb-ap list --tree             # Tree view of all productions and jobs

Repository management

lb-ap clone --protocol ssh    # Clone AnalysisProductions
lb-ap checkout v1r4315        # Check out a version
lb-ap versions MyAnalysis     # List available versions

Creating a minimal reproducer

From a failed grid job, create a self-contained reproducer package:

lb-ap make-reproducer 12345678                        # From DIRAC job ID
lb-ap make-reproducer --job-dir ./downloaded_job_dir   # From local job directory

Development

Platform: pixi targets linux-64 only (requires CERN CVMFS and DIRAC).

# On linux-64 (lxplus or CI):
pixi install
pixi run pytest              # Run tests
pixi run lb-ap               # Run the CLI

# Linting (any platform):
ruff check src/ tests/       # Lint
ruff check --fix src/        # Auto-fix
ruff format src/ tests/      # Format

Legacy CLI

The original Click-based CLI is still available as lb-ap-legacy for backward compatibility but is deprecated.

Metadata

Release files for LbAPLocal 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for LbAPLocal 0.16.0
File Size Uploaded
lbaplocal-0.16.0.tar.gz 477.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for LbAPLocal 0.16.0
File Interpreter ABI Platform
lbaplocal-0.16.0-py3-none-any.whl Python 3 none any Details

Total release size: 648.0 kB

Release files / lbaplocal-0.16.0.tar.gz

Download URL lbaplocal-0.16.0.tar.gz
Size 477.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b79c90957f76bcad911a5867c61fb85bc7f660b350bb09b1a09eb9628acaaec
BLAKE2b-256 checksum
How to use checksums
52aafd4a02c949da671402029ef739046a3057517aabe6cfb48b84807068d873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / lbaplocal-0.16.0-py3-none-any.whl

Download URL lbaplocal-0.16.0-py3-none-any.whl
Size 170.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71409e0638dc002ee7c7a6c0b7e03c1b9402c0a5a73c78df7e8750ce4f70cf4a
BLAKE2b-256 checksum
How to use checksums
81acd85d8a9e87e5ad38d0a3278c3411da7633b9b9e473bffa282dadeb1bc0c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.8.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page