"""orientdb_exporter.py Decorator for :class:`brass_api.translator.orientdb_exporter` Developed to provide a progress update while exporting MDL files. Author: Tameem Samawi ([email protected]) """ from brass_api.translator.orientdb_exporter import OrientDBXMLExporter from cp1.common.logger import Logger logger = Logger().logger class OrientDBExporter(OrientDBXMLExporter): def __init__(self, databaseName, xmlfile, configFile='config.json'): self.export_count = 0 return super(OrientDBExporter, self).__init__(databaseName=databaseName, xmlfile=xmlfile, configFile=configFile) def print_node(self, record, numberTabs=0): if (self.export_count == 0): logger.debug('Exporting OrientDB Nodes...') elif (self.export_count % 100 == 0): logger.debug('Exported {0} Nodes'.format(self.export_count)) self.export_count += 1 return super(OrientDBExporter, self).print_node(record=record, numberTabs=numberTabs)
from cp1.algorithms.optimizers.integer_program import IntegerProgram from cp1.algorithms.optimizers.greedy_optimizer import GreedyOptimizer from cp1.algorithms.schedulers.conservative_scheduler import ConservativeScheduler from cp1.algorithms.schedulers.hybrid_scheduler import HybridScheduler from cp1.utils.constraints_object_generator import * from cp1.utils.configuration_utils import * from cp1.utils.string_utils import * from cp1.utils.file_utils import * from cp1.utils.decorators.timedelta import timedelta for dir in [RAW_DIR, LOGGING_DIR, MDL_DIR, VISUAL_DIR]: os.makedirs(dir, exist_ok=True) logger = Logger() logger.setup_file_handler(os.path.abspath(LOGGING_DIR)) logger = logger.logger timestamp = None total_runs = 0 def solve_challenge_problem_instance(constraints_object, discretizer, optimizer, scheduler, config, averages, perturber=None, lower_bound_or=None, webserver=False):