Belle II Software  release-05-02-19
MetaOptionParser Class Reference

Public Member Functions

def __init__ (self, Optional[Iterable] meta_option_list=None)
 
def has_option (self, option_name)
 
def pvalue_warn (self)
 
def pvalue_error (self)
 
def float_value (self, key, default=None)
 
def int_value (self, key, default=None)
 
def parse_key_value (self, key)
 

Public Attributes

 mo
 store the meta option list for usage in the functions below
 

Detailed Description

Class to simplify the parsing of plot options
supplied by the MetaOption named object attached
to root plots.

A typical meta options list might look like this:
["pvalue-warn=0.9", "pvalue-error=0.4"]

Definition at line 8 of file metaoptions.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
Optional[Iterable]   meta_option_list = None 
)
Initialize MetaOptionParser
@param meta_option_list: list of meta options read from ROOT object
    or None

Definition at line 18 of file metaoptions.py.

18  def __init__(self, meta_option_list: Optional[Iterable] = None):
19  """
20  Initialize MetaOptionParser
21  @param meta_option_list: list of meta options read from ROOT object
22  or None
23  """
24  if meta_option_list is None:
25  meta_option_list = []
26  meta_option_list = list(meta_option_list)
27 
28  self.mo = meta_option_list # type: List[str]
29 

Member Function Documentation

◆ float_value()

def float_value (   self,
  key,
  default = None 
)
Extract the float value from a meta option list
@param key: the key to identify the value from the list
@param default: default value
@return: The float value or the default value if this key did not exist
 or the float value could not be parsed.

Definition at line 54 of file metaoptions.py.

◆ has_option()

def has_option (   self,
  option_name 
)
Checks whether an option is contained in the
meta options
@param option_name: name of the option to check for
@return: True if the option is contained in the meta option list
 False otherwise

Definition at line 30 of file metaoptions.py.

◆ int_value()

def int_value (   self,
  key,
  default = None 
)
Extract the int value from a meta option list
@param key: the key to identify the value from the list
@param default: default value
@return: The int value or None if this key did not exist
 or the float value could not be parsed.

Definition at line 70 of file metaoptions.py.

◆ parse_key_value()

def parse_key_value (   self,
  key 
)
Searches the meta options list for a key value entry and parses it
@param key: The key to look for
@retun: The value which was associated to the key or None if the
key was not found.

Definition at line 86 of file metaoptions.py.

◆ pvalue_error()

def pvalue_error (   self)
@return: The custom error level for the pvalue setting of plot
 comparison. None if no custom value was set for the plot.

Definition at line 47 of file metaoptions.py.

◆ pvalue_warn()

def pvalue_warn (   self)
@return: The custom warning level for the pvalue setting of plot
 comparison. None if no custom value was set for the plot.

Definition at line 40 of file metaoptions.py.


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