def _enter_data(args): atm = _get_atm(args) run_conf = RunConfig(args) dataset_conf = DatasetConfig(args) if run_conf.dataset_id is None: dataset = atm.add_dataset(**dataset_conf.to_dict()) run_conf.dataset_id = dataset.id return atm.add_datarun(**run_conf.to_dict())
def atm_run(): data = request.json run_conf = RunConfig(data) dataruns = atm.add_datarun(**run_conf.to_dict()) if not isinstance(dataruns, list): dataruns = [dataruns] response = { 'status': 200, 'datarun_ids': [datarun.id for datarun in dataruns] } return jsonify(response)
def get_new_worker(**kwargs): kwargs['dataset_id'] = kwargs.get('dataset_id', None) kwargs['methods'] = kwargs.get('methods', ['logreg', 'dt']) run_conf = RunConfig(kwargs) kwargs['train_path'] = POLLUTION_PATH dataset_conf = DatasetConfig(kwargs) db = Database(dialect='sqlite', database=DB_PATH) atm = ATM(dialect='sqlite', database=DB_PATH) dataset = atm.add_dataset(**dataset_conf.to_dict()) run_conf.dataset_id = dataset.id datarun = atm.add_datarun(**run_conf.to_dict()) return Worker(db, datarun)