def run(self): # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Group_of_Markov_Models_1().get_name()): print_info("The structure is not registered.") __database__.set_new_structure(Group_of_Markov_Models_1()) else: main_dict = __database__.get_new_structure(Group_of_Markov_Models_1()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log("info", self.description) # Run super(Group_of_Markov_Models_1, self).run() if self.args is None: return # Process the command line if self.args.list: self.list_markov_models(self.args.filter) elif self.args.generate: try: self.create_new_model(self.args.generate, self.args.numberofflows) except AttributeError: numberofflows = 3 self.create_new_model(self.args.generate, numberofflows) elif self.args.printmatrix: self.print_matrix(self.args.printmatrix) elif self.args.simulate: self.simulate(self.args.simulate) elif self.args.delete: self.delete(self.args.delete) elif self.args.printstate: self.printstate(self.args.printstate) elif self.args.regenerate: self.regenerate(self.args.regenerate) elif self.args.train: if "-" in self.args.train: # There is a range of ids to train first = int(self.args.train.split("-")[0]) last = int(self.args.train.split("-")[1]) train_ids = range(first, last + 1) else: train_ids = [self.args.train] for train_id in train_ids: self.train(int(train_id), self.args.filter, self.args.train_ids, self.args.verbose) elif self.args.generateall: try: self.create_new_model(self.args.generate, self.args.numberofflows) except AttributeError: numberofflows = 3 self.generate_all_models(numberofflows) elif self.args.export and self.args.exportpath: self.export_model(self.args.export, self.args.exportpath) elif self.args.threshold: if not self.args.train_ids: print_error("You must specify some markov model id to apply the threshold.") return False self.assign_threshold_to_id(self.args.train_ids, self.args.threshold)
def run(self): ######### Mandatory part! don't delete ######################## # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Visualizations().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Visualizations()) else: main_dict = __database__.get_new_structure(Visualizations()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Visualizations, self).run() if self.args is None: return ######### End Mandatory part! ######################## # Process the command line and call the methods. Here add your own parameters if self.args.visualize: self.visualize_dataset(int(self.args.visualize), self.args.multiplier, self.args.filter) else: print_error('At least one of the parameter is required in this module') self.usage()
def run(self): ######### Mandatory part! don't delete ######################## # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure( Group_of_Template_Objects().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Group_of_Template_Objects()) else: main_dict = __database__.get_new_structure( Group_of_Template_Objects()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Group_of_Template_Objects, self).run() if self.args is None: return ######### End Mandatory part! ######################## # Process the command line and call the methods. Here add your own parameters if self.args.list: self.list_objects() elif self.args.generate: self.create_new_object(self.args.generate) else: print_error('At least one parameter is required in this module') self.usage()
def run(self): ######### Mandatory part! don't delete ######################## # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Group_of_Template_Objects().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Group_of_Template_Objects()) else: main_dict = __database__.get_new_structure(Group_of_Template_Objects()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Group_of_Template_Objects, self).run() if self.args is None: return ######### End Mandatory part! ######################## # Process the command line and call the methods. Here add your own parameters if self.args.list: self.list_objects() elif self.args.generate: self.create_new_object(self.args.generate) else: print_error('At least one parameter is required in this module') self.usage()
def run(self): # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Group_of_Markov_Models_1().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Group_of_Markov_Models_1()) else: main_dict = __database__.get_new_structure(Group_of_Markov_Models_1()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Group_of_Markov_Models_1, self).run() if self.args is None: return # Process the command line if self.args.list: self.list_markov_models(self.args.filter) elif self.args.generate: try: self.create_new_model(self.args.generate, self.args.numberofflows) except AttributeError: numberofflows = 3 self.create_new_model(self.args.generate, numberofflows) elif self.args.printmatrix: self.print_matrix(self.args.printmatrix) elif self.args.simulate: self.simulate(self.args.simulate) elif self.args.delete: self.delete(self.args.delete) elif self.args.printstate: self.printstate(self.args.printstate) elif self.args.regenerate: self.regenerate(self.args.regenerate) elif self.args.train: if '-' in self.args.train: # There is a range of ids to train first = int(self.args.train.split('-')[0]) last = int(self.args.train.split('-')[1]) train_ids = range(first,last + 1) else: train_ids = [self.args.train] for train_id in train_ids: self.train(int(train_id), self.args.filter, self.args.train_ids, self.args.verbose) elif self.args.generateall: try: self.create_new_model(self.args.generate, self.args.numberofflows) except AttributeError: numberofflows = 3 self.generate_all_models(numberofflows) elif self.args.export and self.args.exportpath: self.export_model(self.args.export, self.args.exportpath) elif self.args.threshold: if not self.args.train_ids: print_error('You must specify some markov model id to apply the threshold.') return False self.assign_threshold_to_id(self.args.train_ids, self.args.threshold)
def run(self): ######### Mandatory part! don't delete ######################## # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Group_of_Detections().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Group_of_Detections()) else: main_dict = __database__.get_new_structure(Group_of_Detections()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Group_of_Detections, self).run() if self.args is None: return ######### End Mandatory part! ######################## # Process the command line and call the methods. Here add your own parameters if self.args.list: self.list_distances(self.args.filter) elif self.args.new: self.create_new_distance(self.args.amount, self.args.trainid, self.args.testid, self.args.verbose) elif self.args.delete: self.delete_distance(self.args.delete) elif self.args.letterbyletter: self.detect_letter_by_letter(self.args.letterbyletter, self.args.amount, self.args.verbose) elif self.args.regenerate: self.regenerate(self.args.regenerate, self.args.filter) elif self.args.print_comparison: self.print_comparison(self.args.print_comparison) elif self.args.compareall: self.compare_all(self.args.compareall, self.args.amount, self.args.verbose) elif self.args.deleteall: if self.args.filter: self.delete_all(self.args.filter) else: print_error('Must provide a filter with -f') else: print_error('At least one of the parameter is required in this module') self.usage()
def run(self): # Register the structure in the database, so it is stored and use in the future. if not __database__.has_structure(Group_of_Markov_Models_2().get_name()): print_info('The structure is not registered.') __database__.set_new_structure(Group_of_Markov_Models_2()) else: main_dict = __database__.get_new_structure(Group_of_Markov_Models_2()) self.set_main_dict(main_dict) # List general help. Don't modify. def help(): self.log('info', self.description) # Run super(Group_of_Markov_Models_2, self).run() if self.args is None: return # Process the command line if self.args.list: self.list_markov_models(self.args.filter) elif self.args.generate: self.create_new_model(self.args.generate) elif self.args.printmatrix: self.print_matrix(self.args.printmatrix) elif self.args.simulate: self.simulate(self.args.simulate) elif self.args.delete: self.delete(self.args.delete) elif self.args.printstate: self.printstate(self.args.printstate) elif self.args.regenerate: self.regenerate(self.args.regenerate) elif self.args.generateall: self.generate_all_models() else: print_error('At least one of the parameter is required in this module') self.usage()