Skip to main content

Tool to locally run tests for AnalysisProductions

Project description

LbAPLocal

LbAPLocal is the python library for running offline tests for the LHCb AnalysisProductions framework.

Usage

LbAPLocal is installed by default with the LHCb environment on lxplus. For users on external clusters, one can source the LHCb environment from CVMFS to get setup: source /cvmfs/lhcb.cern.ch/lib/LbEnv After installing, LbAPLocal can be run from the command line with the following options:

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

  Command line tool for the LHCb AnalysisProductions

Options:
  --version
  --help     Show this message and exit.

Commands:
  list         List the available production folders by running lb-ap list
  list-checks  List the checks for a specific production by running lb-ap...
  render       Render the info.yaml for a given production
  validate     Validate the configuration for a given production
  test         Execute a job locally
  check        Run checks for a production
  debug        Start an interactive session inside the job's environment
  reproduce    Reproduce an existing online test locally
  parse-log    Read a Gaudi log file and extract information

To see which productions are available:

$ lb-ap list
The available productions are:
* MyAnalysis

To see which jobs are available for a given production:

$ lb-ap list MyAnalysis
The available jobs for MyAnalysis are:
* My2016MagDownJob
* My2016MagUpJob

To see which checks are defined for a given production:

$ lb-ap list-checks MyAnalysis
The checks defined for MyAnalysis are:
* MyRangeCheck (type: range)
* MyOtherRangeCheck (type: range)
* MyNumEntriesCheck (type: num_entries)

To see which checks are used for a job within a given production:

$ lb-ap list-checks MyAnalysis My2016MagDownJob
The checks defined for MyAnalysis that are required by My2016MagDownJob are:
* MyRangeCheck (type: range)
* MyNumEntriesCheck (type: num_entries)

To render the templating in info.yaml for a given production:

$ lb-ap render MyAnalysis

To validate the configuration of a given production:

$ lb-ap validate MyAnalysis
Rendering info.yaml for MyAnalysis
YAML parsed successfully
YAML validated successfully

To run a test of a job interactively:

$ lb-ap debug MyAnalysis My2016MagDownJob

Welcome to analysis productions debug mode:

The production can be tested by running:

gaudirun.py -T '$ANALYSIS_PRODUCTIONS_DYNAMIC/Lb2Lll/MC_2017_MagDown_Lb2PsiL_mm_strip_autoconf.py' '$ANALYSIS_PRODUCTIONS_BASE/Lb2Lll/stripping_seq.py' prodConf_DaVinci_00012345_00006789_1.py

[DaVinci v45r5] output $

To test a job non-interactively:

$ lb-ap test MyAnalysis My2016MagDownJob
Success! Output can be found in xxxxxxxxxxxx

For both interactive and non-interactive testing, when testing a job that depends on another job to provide the input file the dependent job will be tested first and its output passed to the requested job. If the dependent job has already been run the location of its output can be passed to the requested job by appending -i <output_file_path> to lb-ap test <production_name> <job_name>.

To test a job on a specific input file:

$ lb-ap test MyAnalysis My2016MagDownJob -i InputFileLocation
Success! Output can be found in xxxxxxxxxxxx

InputFileLocation can be either an LFN or a path to a local file. This is also valid for the debug command.

To run only the checks for a job (non-interactively, requiring the output from an earlier successful test command):

$ lb-ap check MyAnalysis My2016MagDownJob local-tests/path/to/output/OUTPUT_NTUPLE.ROOT
All checks passed! Any output can be found in local-tests/path/to/output/checks

To run only the checks for a job but saving the output to a different location (non-interactively, requiring the output from an earlier successful test command):

$ lb-ap check MyAnalysis My2016MagDownJob local-tests/path/to/output/OUTPUT_NTUPLE.ROOT another/file/path
All checks passed! Any output can be found in another/file/path

To read a Gaudi log file and extract information:

$ lb-ap parse-log Job.log
Summary of log messages in: Job.log
    Found 2659 ERROR messages
        * 2649 instances of "*** Flag container MC/TrackInfo not found."
        * 9 instances of "HltSelReportsDecoder::   Failed to add Hlt selection name Hlt2RecSummary to its container "
        * 1 instances of "HltSelReportsDecoder:: The   ERROR message is suppressed : '  Failed to add Hlt selection name Hlt2RecSummary to its container '"
    Found 61 WARNING messages
        * 7 instances of "TupleToolBremInfo:: TupleToolBremInfo requires fullDST -  BremP and BremOrigin might not be reliable (Multiplicity is OK)"
        and 54 others (50 unique), pass "--suppress=0" to show all messages

Errors have been detected!
  * Lines: 3275, 3277, 3279, 3281, 3283 and 17 others
    This message indicates the location specified for the information being accessed by
    RelatedInfo does not exist. It is likely that either:

    * The location specified is incorrect, try looking for it with dst-dump.
    * The given information was never stored for that candidate, in which case the use of
    RelatedInfo should be removed.

General explanations
  * Line: 6318
    Histograms are not being saved as no filename has been specified for storing them. This
    message is harmless and normally ignored.
Error: Found issues in log

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

LbAPLocal-0.3.1.tar.gz (309.4 kB view details)

Uploaded Source

Built Distribution

LbAPLocal-0.3.1-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file LbAPLocal-0.3.1.tar.gz.

File metadata

  • Download URL: LbAPLocal-0.3.1.tar.gz
  • Upload date:
  • Size: 309.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for LbAPLocal-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1d71dccd22d3677af5628fec0513f56cd9a8c2b693830fa1a7c960c1f491066d
MD5 2c4773fae4e92d88bd6b0fa5cd4eb352
BLAKE2b-256 2ad97286465b3c6abf8c5c5a3de78af48437b0e84b36fdbd0230c4de59ca7275

See more details on using hashes here.

File details

Details for the file LbAPLocal-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: LbAPLocal-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for LbAPLocal-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcfc6fbe0e6fdd041297be8f04b6272f6a5ede91cf91ae0e0d7691f76ed9600c
MD5 cf1ee5bb5d9f5caaae3b7c5808d5cfba
BLAKE2b-256 ad00d1e0862ca68a4917da9b74d76be42e62e2633af1273ab8bc2381c40617a7

See more details on using hashes here.

Supported by

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