ensembl-hive-python3  2.3
eHive.Params.ParamContainer Class Reference

Equivalent of eHive's Param module. More...

+ Inheritance diagram for eHive.Params.ParamContainer:

Public Member Functions

def __init__ (self, unsubstituted_params, debug=False)
 Constructor. More...
 
def set_param (self, param_name, value)
 Setter. More...
 
def get_param (self, param_name)
 Getter. More...
 
def has_param (self, param_name)
 Returns a boolean. More...
 
def validate_parameter_name (self, param_name)
 Tells whether "param_name" is a non-empty string. More...
 
def debug_print (self, args, kwargs)
 Print debug information if the debug flag is turned on (cf constructor) More...
 
def internal_get_param (self, param_name)
 Equivalent of get_param() that assumes "param_name" is a valid parameter name and hence, doesn't have to raise ParamNameException. More...
 
def param_substitute (self, structure)
 Take any structure and replace the pairs of hashes with the values of the parameters / expression they represent Compatible types: numbers, strings, lists, dictionaries (otherwise, ParamSubstitutionException is raised) More...
 
def subst_all_hashpairs (self, structure, callback)
 Parse "structure" and replace all the pairs of hashes by the result of calling callback() on the pair content #expr()expr# are treated differently by calling subst_one_hashpair() The result is a string (like structure) More...
 
def subst_one_hashpair (self, inside_hashes, is_expr)
 Run the parameter substitution for a single pair of hashes. More...
 

Public Attributes

 unsubstituted_param_hash
 
 param_hash
 
 debug
 
 substitution_in_progress
 

Detailed Description

Equivalent of eHive's Param module.

Definition at line 44 of file Params.py.

Constructor & Destructor Documentation

◆ __init__()

def eHive.Params.ParamContainer.__init__ (   self,
  unsubstituted_params,
  debug = False 
)

Constructor.

"unsubstituted_params" is a dictionary

Definition at line 48 of file Params.py.

Member Function Documentation

◆ debug_print()

def eHive.Params.ParamContainer.debug_print (   self,
  args,
  kwargs 
)

Print debug information if the debug flag is turned on (cf constructor)

Definition at line 94 of file Params.py.

+ Here is the caller graph for this function:

◆ get_param()

def eHive.Params.ParamContainer.get_param (   self,
  param_name 
)

Getter.

Performs the parameter substitution

Definition at line 67 of file Params.py.

+ Here is the call graph for this function:

◆ has_param()

def eHive.Params.ParamContainer.has_param (   self,
  param_name 
)

Returns a boolean.

It checks both substituted and unsubstituted parameters

Definition at line 79 of file Params.py.

+ Here is the call graph for this function:

◆ internal_get_param()

def eHive.Params.ParamContainer.internal_get_param (   self,
  param_name 
)

Equivalent of get_param() that assumes "param_name" is a valid parameter name and hence, doesn't have to raise ParamNameException.

It is only used internally

Definition at line 101 of file Params.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ param_substitute()

def eHive.Params.ParamContainer.param_substitute (   self,
  structure 
)

Take any structure and replace the pairs of hashes with the values of the parameters / expression they represent Compatible types: numbers, strings, lists, dictionaries (otherwise, ParamSubstitutionException is raised)

Definition at line 114 of file Params.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_param()

def eHive.Params.ParamContainer.set_param (   self,
  param_name,
  value 
)

Setter.

Returns the new value

Definition at line 59 of file Params.py.

+ Here is the call graph for this function:

◆ subst_all_hashpairs()

def eHive.Params.ParamContainer.subst_all_hashpairs (   self,
  structure,
  callback 
)

Parse "structure" and replace all the pairs of hashes by the result of calling callback() on the pair content #expr()expr# are treated differently by calling subst_one_hashpair() The result is a string (like structure)

Definition at line 156 of file Params.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subst_one_hashpair()

def eHive.Params.ParamContainer.subst_one_hashpair (   self,
  inside_hashes,
  is_expr 
)

Run the parameter substitution for a single pair of hashes.

Here, we only need to handle #expr()expr#, #func:params# and #param_name# as each condition has been parsed in the other methods

Definition at line 188 of file Params.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate_parameter_name()

def eHive.Params.ParamContainer.validate_parameter_name (   self,
  param_name 
)

Tells whether "param_name" is a non-empty string.

Definition at line 89 of file Params.py.

+ Here is the caller graph for this function:

Member Data Documentation

◆ debug

eHive.Params.ParamContainer.debug

Definition at line 51 of file Params.py.

◆ param_hash

eHive.Params.ParamContainer.param_hash

Definition at line 50 of file Params.py.

◆ substitution_in_progress

eHive.Params.ParamContainer.substitution_in_progress

Definition at line 70 of file Params.py.

◆ unsubstituted_param_hash

eHive.Params.ParamContainer.unsubstituted_param_hash

Definition at line 49 of file Params.py.


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