def solve(dat): """ core solving routine :param dat: a good ticdat for the input_schema :return: a good ticdat for the solution_schema, or None """ return opl_run("netflow.mod", input_schema, dat, solution_schema)
def solve(dat): """ core solving routine :param dat: a good ticdat for the input_schema :return: a good ticdat for the solution_schema, or None """ assert input_schema.good_tic_dat_object(dat) assert not input_schema.find_foreign_key_failures(dat) assert not input_schema.find_data_type_failures(dat) assert not input_schema.find_data_row_failures(dat) return opl_run("oil_blend.mod", input_schema, dat, solution_schema)
def solve(dat): """ core solving routine :param dat: a good ticdat for the input_schema :return: a good ticdat for the solution_schema, or None """ assert input_schema.good_tic_dat_object(dat) assert not input_schema.find_foreign_key_failures(dat) assert not input_schema.find_data_type_failures(dat) assert not input_schema.find_data_row_failures(dat) rtn = opl_run("jobs.mod", input_schema, dat, solution_schema) if rtn: # for simplicities sake, I'm just going to treat OPL time as 'minutes from now' now = time.time() format_iso = lambda x : datetime.datetime.utcfromtimestamp(now + x*60).isoformat() + "Z" for k,r in rtn.act.items(): rtn.act_as_dates[k] = [format_iso(r["Start"]), format_iso(r["End"])] return rtn