def compare_results(ut, test_name, result_file, compressed): result_name = test_name + '_' + result_file if compressed: result_name += '.gz' computed = CSIO._ascii_grid_reader(os.path.join(BIG_TESTS_OUT, result_name), 'float64') saved = CSIO._ascii_grid_reader(os.path.join(BIG_TESTS_BASELINE, result_name), 'float64') ut.assertEquals(approxEqual(saved, computed), True)
def check_role_limits(roles, cfg, qlogger): qlogger.clnt_log("Your roles: " + str(roles)) if ("admin" in roles) or ("standalone" in roles): return (True, None) try: # check max parallel qlogger.clnt_log("Parallelization requested: " + str(cfg.parallelize)) if cfg.parallelize: qlogger.clnt_log("Parallel processes requested: " + (str(cfg.max_parallel) if (cfg.max_parallel > 0) else "maximum")) if cfg.max_parallel == 0: cfg.max_parallel = CircuitscapeRunner.MAX_PARALLEL else: return (False, "Your profile is restricted to a maximum of " + str(CircuitscapeRunner.MAX_PARALLEL) + " parallel processors.") # check for cumulative maps qlogger.clnt_log("Output maps required for - voltage: " + str(cfg.write_volt_maps) + ", current: " + str(cfg.write_cur_maps) + ", cumulative only: " + str(cfg.write_cum_cur_map_only)) if cfg.write_volt_maps or (cfg.write_cur_maps and (not cfg.write_cum_cur_map_only)): return (False, "Your profile is restricted to create only cumulative current maps.") # check problem size prob_sz = CSIO.problem_size(cfg.data_type, cfg.habitat_file) qlogger.clnt_log("Landscape size: " + str(prob_sz)) if prob_sz > 24000000: return (False, "Your profile is restricted for landscape sizes of 24m nodes only.") except Exception as e: return (False, "Unknown error verifying limits. (" + str(e) + "). Please check your input files.") return (True, None)