def get_calculator(cls, matrix_params): # Get all available calculators available_calculators = PluginHandler.get_classes('pyproct.data.matrix', selection_keyword = "MatrixCalculator", skip_list = ["test", "cases"], plugin_name = "matrix") # Choose the calculator we need calculation_method = matrix_params["method"] calculator_classes = filter(lambda x: x.CALCULATION_METHOD == calculation_method, available_calculators) if len(calculator_classes) == 0: print "[ERROR][MatrixCalculator::calculate] %s is not a registered matrix calculation method."%(calculation_method) exit() else: return calculator_classes[0]
def get_loader(self, data_type): """ Chooses the best loader for the type of data we have. """ # Get all available loaders available_loaders = PluginHandler.get_classes('pyproct.data.handler', selection_keyword = "DataLoader", skip_list = ["test"], plugin_name = "data_loader") loaders = filter(lambda x: x.LOADER_TYPE == data_type, available_loaders) if len(loaders) == 0: print "[ERROR][DataHandler::get_loader] There is not a registered data loader for %s data type."%(data_type) exit() else: return loaders[0]
def run(self, clustering, postprocessing_parameters, data_handler, workspace_handler, matrix_handler, generated_files): available_action_classes = PluginHandler.get_classes( 'pyproct.postprocess.actions', "PostAction", ["test"], "postprocess") for postprocessing_action_class in available_action_classes: if postprocessing_action_class.KEYWORD in postprocessing_parameters: try: postprocessing_action_class().run( clustering, postprocessing_parameters[ postprocessing_action_class.KEYWORD], data_handler, workspace_handler, matrix_handler, generated_files) except Exception, e: print "[ERROR][Driver::postprocess] Impossible to perform '%s' postprocessing action." % ( postprocessing_action_class.KEYWORD) print "Message: %s" % str(e) traceback.print_exc()
def run(self, clustering, postprocessing_parameters, data_handler, workspace_handler, matrix_handler, generated_files): available_action_classes = PluginHandler.get_classes('pyproct.postprocess.actions', "PostAction", ["test","confSpaceComparison"], "postprocess") for postprocessing_action_class in available_action_classes: if postprocessing_action_class.KEYWORD in postprocessing_parameters: try: postprocessing_action_class().run(clustering, postprocessing_parameters[postprocessing_action_class.KEYWORD], data_handler, workspace_handler, matrix_handler, generated_files) except Exception, e: print "[ERROR][Driver::postprocess] Impossible to perform '%s' postprocessing action."%(postprocessing_action_class.KEYWORD) print "Message: %s"%str(e) traceback.print_exc()
def get_calculator(cls, matrix_params): # Get all available calculators available_calculators = PluginHandler.get_classes( 'pyproct.data.matrix', selection_keyword="MatrixCalculator", skip_list=["test", "cases"], plugin_name="matrix") # Choose the calculator we need calculation_method = matrix_params["method"] calculator_classes = filter( lambda x: x.CALCULATION_METHOD == calculation_method, available_calculators) if len(calculator_classes) == 0: print "[ERROR][MatrixCalculator::calculate] %s is not a registered matrix calculation method." % ( calculation_method) exit() else: return calculator_classes[0]