ensembl-hive-python3  2.8.1
eHive.params.ParamContainer Class Reference

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

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 substitute_string (self, string)
 Apply the parameter substitution to the string. 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 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. 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 57 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 60 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 107 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 76 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 86 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 113 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 numbers, strings, lists, dictionaries (otherwise, ParamSubstitutionException is raised)

Definition at line 125 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 70 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 168 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 204 of file params.py.

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

◆ substitute_string()

def eHive.params.ParamContainer.substitute_string (   self,
  string 
)

Apply the parameter substitution to the string.

Definition at line 91 of file params.py.

+ Here is the call 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 102 of file params.py.

+ Here is the caller graph for this function:

Member Data Documentation

◆ debug

eHive.params.ParamContainer.debug

Definition at line 63 of file params.py.

◆ param_hash

eHive.params.ParamContainer.param_hash

Definition at line 62 of file params.py.

◆ substitution_in_progress

eHive.params.ParamContainer.substitution_in_progress

Definition at line 78 of file params.py.

◆ unsubstituted_param_hash

eHive.params.ParamContainer.unsubstituted_param_hash

Definition at line 61 of file params.py.


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