def test_GN_03(): conf = hearsay.Parser() conf.load_config(['nran'], ['2']) G = hearsay.C3Net(conf) G.set_parameters() A = [20000, 30000, 40000] S = [10000, 12000, 14000] D = [10000, 12000, 14000] G.set_parameters(A=A, S=S, D=D) res = G.run(interactive=True) assert len(res) == 54
def test_GN_04(): conf = hearsay.Parser() conf.load_config(['nran'], ['1']) G = hearsay.C3Net(conf) G.set_parameters() A = [20000, 30000] S = [10000, 12000] D = [10000] lista = [A, S, D] G.set_parameters(spars=lista) res = G.run(interactive=True) assert len(res) == 4
def test_GN_08(): conf = hearsay.Parser() conf.load_config(['nran', 'njobs', 'run_parallel'], ['10', '2', 'Y']) G = hearsay.C3Net(conf) G.set_parameters() A = [20000] S = [10000] D = [10000] lista = [A, S, D] G.set_parameters(spars=lista) res = G.run(interactive=True) res = G.show_single_ccns(interactive=True) assert isinstance(res, dict)
def test_results_01(): conf = hearsay.Parser() conf.load_config(['nran'], ['1']) G = hearsay.C3Net(conf) G.set_parameters() A = [20000, 30000] S = [10000, 12000] D = [10000] lista = [A, S, D] G.set_parameters(spars=lista) res = G.run(interactive=True) R = hearsay.Results(G) R.load() res = R.show_ccns(0, True) assert isinstance(res, dict)
def test_GN_01(): conf = hearsay.Parser() G = hearsay.C3Net(conf) conf.load_config(['nran'], ['7']) tau_awakening = 20000 tau_survive = 20000 D_max = 20000 directory = ''.join( [G.config.filenames.dir_output, G.config.filenames.exp_id]) filename = ''.join([directory, 'test.pk']) pars = [[tau_awakening, tau_survive, D_max, filename]] df = pd.DataFrame( pars, columns=['tau_awakening', 'tau_survive', 'D_max', 'filename']) G.set_parameters(df) res = G.run(interactive=True) assert len(res) == 1
from hearsay import hearsay from sys import argv if len(argv) > 1: conf = hearsay.Parser(argv[1]) else: conf = hearsay.Parser() G = hearsay.C3Net(conf) G.set_parameters() G.run()
d_max.append(i[2]) fname.append(f"../out/F2b/{str(k).zfill(5)}_001.pk") df = pd.DataFrame( list(zip(tau_a, tau_s, d_max, fname)), columns=['tau_awakening', 'tau_survive', 'D_max', 'filename']) df.to_csv('F2b.csv') # 1) Correr las simulaciones ::::::::::::::::::: # ....(a) df = pd.read_csv('F2b.csv') config = hearsay.Parser('F2b.ini') config.load_config() G = hearsay.C3Net(config) G.set_parameters(df) G.run() # 2) Leer las simulaciones ::::::::::::::::::::: dfa = pd.read_csv('F2b.csv') config = hearsay.Parser('F2b.ini') config.load_config() G = hearsay.C3Net(config) G.set_parameters(dfa) R = hearsay.Results(G) R.load() res = R.redux()