Belle II Software  release-06-01-15
Sample Class Reference
Inheritance diagram for Sample:

Public Member Functions

def __init__ (self, **kwargs)
 
def encodeable_name (self)
 
def printable_name (self)
 
def as_dict (self)
 
def __str__ (self)
 

Static Public Member Functions

def resolve_path (location)
 

Static Public Attributes

 location = NotImplemented
 

Detailed Description

Base class for skim test samples.

Definition at line 24 of file testfiles.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
**  kwargs 
)
Initialise Sample. Passing any unrecognised keywords will raise an error.

Definition at line 27 of file testfiles.py.

27  def __init__(self, **kwargs):
28  """
29  Initialise Sample. Passing any unrecognised keywords will raise an error.
30  """
31  if kwargs:
32  keys = ", ".join(kwargs.keys())
33  raise ValueError(
34  f"Unrecognised arguments in test sample initialisation: {keys}"
35  )
36 

Member Function Documentation

◆ as_dict()

def as_dict (   self)
Sample serialised as a dictionary.

Reimplemented in CustomSample, MCSample, and DataSample.

Definition at line 75 of file testfiles.py.

◆ encodeable_name()

def encodeable_name (   self)
Identifying string which is safe to be included as a filename component or as a
key in the skim stats JSON file.

As a rough naming convention, data samples should start with 'Data-', MC sample
with 'MC-', and custom samples with 'Custom-'.

Reimplemented in CustomSample, MCSample, and DataSample.

Definition at line 41 of file testfiles.py.

◆ printable_name()

def printable_name (   self)
Human-readable name for displaying in printed tables.

Reimplemented in CustomSample, MCSample, and DataSample.

Definition at line 52 of file testfiles.py.

◆ resolve_path()

def resolve_path (   location)
static
Replace ``'${SampleDirectory}'`` with ``Sample.SampleDirectory``, and resolve
the path.

Parameters:
    location (str, pathlib.Path): Filename to be resolved.

Returns:
    pathlib.Path: Resolved path.

Definition at line 59 of file testfiles.py.


The documentation for this class was generated from the following file: