Skip to content

Instantly share code, notes, and snippets.

@hanfeisun
Created July 17, 2012 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanfeisun/3127289 to your computer and use it in GitHub Desktop.
Save hanfeisun/3127289 to your computer and use it in GitHub Desktop.
QC
from chilin.dc import jinja_env, PathFinder
class QC_Controller(object):
def __init__(self, conf):
self.pathfinder = PathFinder(conf)
self.template = jinja_env.get_template(pathfinder.qc_template)
self.has_run = False
def run(self):
pass
def check(self):
pass
def render(self):
self.template.render({})
class MappingQC(QC_Controller):
def __init__(self, conf):
super(MappingQC, self).__init__(conf)
def _mapping(self):
self.mapping_stat = 100
def _mappable(self):
self.mappable_stat = 80
def _redundant(self):
self.redundant_stat = 20
def run(self):
if not self.has_run:
self._mapping()
self._mappable()
self._redundant()
self.has_run =True
def check(self):
self.run()
if self.mapping_stat > 90 and self.mappable_stat > 20 and self.redundant_stat <50:
return True
else:
return False
def render(self):
self.run()
return self.template.render({"mapping_rate":self.mapping_stat,
"mappable_rate":self.mappable_stat,
"redundant_rate":self.redundant_stat,})
class PeakcallingQC(QC_Controller):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment