pinefarm.external package

External interfaces module.

All imports of external interfaces are ‘hidden’ under the function decide_external_tool to avoid an eager import and thus unnecessary installations of external codes.

pinefarm.external.decide_external_tool(dsname: str)[source]

Decide the external tool to be used.

The decisions are based on the existence of a .yaml file with a specific name.

Parameters:

dsname – name of the pinecard

Returns:

  • external_interface – external interface to be used

  • color – color code of the interface

Subpackages

Submodules

pinefarm.external.integrability module

pinefarm.external.interface module

Abstract interface.

class pinefarm.external.interface.External(name, theory, pdf, timestamp=None, runcards_path=None, output_folder=None)[source]

Bases: ABC

Interface class for external providers.

Parameters:
  • name (str) – dataset name

  • theory (dict) – theory dictionary

  • pdf (str) – PDF name

  • timestamp (str) – timestamp of already generated output folder

  • output_folder (pathlib.Path) – path of the already generated output folder

annotate_versions()[source]

Add version informations as meta data.

abstract collect_versions() dict[source]

Collect necessary version informations.

Returns:

program - version mapping related to programs specific to a single runner (common ones are already abstracted)

Return type:

dict

abstract generate_pineappl()[source]

Generate PineAPPL grid and extract output.

Returns:

output of pineappl convolute on the generate grid and selected pdf

Return type:

str

property grid

Target PineAPPL grid name.

property gridtmp

Intermediate PineAPPL grid name.

static install()[source]

Install all needed programs.

kind = None
load_pinecard() str[source]

Load directory as b64encoded .tar.gz file.

postprocess()[source]

Postprocess grid(s).

First run the postrun.sh script (if present), then apply metadata to all grids present in the folder.

The following environment variables will be populated for the underlying scripts to use:

GRID: if only one grid is available, path to the grid PINECARD: path to the pinecard folder

preparation()[source]

Run the preparation method of the runner.

abstract results()[source]

Results as computed by the program.

Returns:

standardized dataframe with results (containing result, error, sv_min, and sv_max columns)

Return type:

pandas.DataFrame

abstract run()[source]

Execute the program.

property source

Runcard base directory.

update_with_tmp(output_grid=None)[source]

Move intermediate grid to final position.

pinefarm.external.positivity module

Positivity interface.

class pinefarm.external.positivity.Positivity(*args, **kwargs)[source]

Bases: External

Interface provider.

collect_versions()[source]

No additional programs involved.

generate_pineappl()[source]

Generate grid.

kind = 'Positivity'
read_kinematics()[source]

Read kinematics from runcard.

results()[source]

Apply PDF to grid.

run()[source]

Open configuration.

pinefarm.external.vrap module

pinefarm.external.yad module