def one_explo(param, param_to_explore): PARAMFILE = "params.xml" MEASUREFILE = "measures.xml" result_path = "/media/thor/data/ktsimu/small_explo_ld_slope_ld0" result_path = "/home/hadim/local/data/ktsimu/explo_ld_slope_ld0" number_simu = 500 name = "explo_%s_%s" % (param['name'], str(param['value'])) ncore = 4 paramtree = ParamTree(PARAMFILE) paramtree.change_dic(param['name'], param['value']) explorator = Explorator(result_path, number_simu, name=name, ncore=ncore, paramtree=paramtree, measurefile=MEASUREFILE, parameter_to_explore=parameter_to_explore, pool_eval=True, name_without_date=True ) explorator.run() p = ProcessExploration(results_path=explorator.results_path) p.evaluate(run_all=True, debug=True) del explorator del p gc.collect()
import sys sys.path.append('..') from kt_simul.io.xml_handler import ParamTree from kt_simul.core.simul_spindle import Metaphase from kt_simul.io.simuio import SimuIO from kt_simul.core import parameters if __name__ == '__main__': PARAMFILE = parameters.PARAMFILE MEASUREFILE = parameters.MEASUREFILE # Change some parameters paramtree = ParamTree(PARAMFILE) paramtree.change_dic('dt', 10) paramtree.change_dic('span', 2000) paramtree.change_dic('t_A', 1750) measuretree = ParamTree(MEASUREFILE, adimentionalized=False) # Arguments parser parser = argparse.ArgumentParser(description='KtSimu Launcher') parser.add_argument('--new', '-n', action='store_true', default=False, help="Run a new simulation") parser.add_argument('--results', '-r', type=str, default="simu.h5", help="Specified results hdf5 file for new or already runned simulation") args = parser.parse_args() results_file = args.results