ensembl-hive-python3  2.3
TestRunnable.py
Go to the documentation of this file.
1 
2 import eHive
3 
5  """Simple Runnable to test as a standaloneJob"""
6 
7  def param_defaults(self):
8  return {
9  'alpha' : 37,
10  'beta' : 78
11  }
12 
13  def fetch_input(self):
14  self.warning("Fetch the world !")
15  print("alpha is", self.param_required('alpha'))
16  print("beta is", self.param_required('beta'))
17 
18  def run(self):
19  self.warning("Run the world !")
20  s = self.param('alpha') + self.param('beta')
21  print("set gamma to", s)
22  self.param('gamma', s)
23 
24  def write_output(self):
25  self.warning("Write to the world !")
26  print("gamma is", self.param('gamma'))
27  self.dataflow( {'gamma': self.param('gamma')}, 2 )
28 
def param_required(self, param_name)
Returns the value of the parameter "param_name" or raises an exception if anything wrong happens...
Definition: Process.py:242
This is the counterpart of GuestProcess.
Definition: Process.py:50
def warning(self, message, is_error=False)
Store a message in the log_message table with is_error indicating whether the warning is actually an ...
Definition: Process.py:208
def param(self, param_name, args)
When called as a setter: sets the value of the parameter "param_name".
Definition: Process.py:254
def dataflow(self, output_ids, branch_name_or_code=1)
Dataflows the output_id(s) on a given branch (default 1).
Definition: Process.py:213
Simple Runnable to test as a standaloneJob.
Definition: TestRunnable.py:6