示例#1
0
文件: main.py 项目: JCM333/JPP
def main(args):
	if args.test:
		import run_tests
		run_tests.run()
	else:
		cm = charmatrix.charmatrix(args.datafile)
		cm.print_summary()

		if args.algorithm == 'exhaustive':
			import exhaustive
			trees = exhaustive.exhaustive_search(cm)
			for tree in trees:
				print tree.to_string(cm)
		elif args.algorithm in ('bnb', 'branch-and-bound'):
			import branchnbound
			trees = branchnbound.branchnbound_search(cm)
			for tree in trees:
				print tree.to_string(cm)
		else:
			import parallel_search
			comm = parallel_search.communicator(cm, args.time, args.interval)
			if args.algorithm == 'nni':
				import nni
				nni.nni_search(cm, comm)
			elif args.algorithm == 'spr':
				import spr
				spr.spr_search(cm, comm)
			elif args.algorithm == 'tbr':
				import tbr
				tbr.tbr_search(cm, comm)
			elif args.algorithm == 'mixed':
				import mixed
				mixed.mixed_search(cm, comm)
示例#2
0
    def run(self):
        matches = []
        for root, dirnames, filenames in os.walk('tests'):
            for filename in fnmatch.filter(filenames, '*.py'):
                matches.append(os.path.join(root, filename).split('.py')[0])

        [importlib.import_module('.'.join(m.split('/'))) for m in matches]
        run_tests.run()
示例#3
0
def test_countFP_anon():
    paramfile =  "params_anonadds_CountFPMatch_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[8,168])
    results2, networkspec = run(paramfile,netfile)
    assert (results == results2)
def test_countFP_anon():
    paramfile =  "params_anonadds_CountFPMatch_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[8,168])
    results2, networkspec = run(paramfile,netfile)
    assert (results == results2)
示例#5
0
def test_patternmatch_path_wavepool():
    paramfile = "params_patternmatch_path_domaingraph_wavepool.json"
    results, networkspec = run(paramfile,"good_wavepool.txt","query_results_PathMatchInDomainGraph_wt1_microarray_coregenes_lifepoints_interpol_trim.json")
    print(networkspec)
    print(results)
    assert(results=={'SWI4 : (NDD1)(~YOX1) : E\nHCM1 : SWI4 : E\nNDD1 : HCM1 : E\nYOX1 : SWI4 : E': [[0.0, 0, 14], [0.01, 8, 14], [0.05, 5, 14]]})
    results, networkspec = run(paramfile,"good_wavepool.txt","query_results_PathMatchInStableFullCycle_wt1_microarray_coregenes_lifepoints_interpol_trim.json")
    print(networkspec)
    print(results)
    assert(results=={'SWI4 : (NDD1)(~YOX1) : E\nHCM1 : SWI4 : E\nNDD1 : HCM1 : E\nYOX1 : SWI4 : E': [[0.0, 0, 2, 14], [0.01, 2, 2, 14], [0.05, 1, 2, 14]]})
示例#6
0
def test_patternmatch_path():
    paramfile = "params_patternmatch_path_domaingraph_X1X2X3.json"
    results, networkspec = run(paramfile,netfile,"query_results_PathMatchInDomainGraph_no_time_series_file.json")
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[[0.0, 58, 168], [0.1, 80, 168]])
def test_patternmatch_stable():
    paramfile = "params_patternmatch_stable_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[[0.0, 40, 168], [0.1, 54, 168]])
def test_patternmatch_path():
    paramfile = "params_patternmatch_path_domaingraph_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[[0.0, 58, 168], [0.1, 80, 168]])
示例#9
0
def test_patternmatch2():
    paramfile = "params_empty2.json"
    results, networkspec = run(
        paramfile, netfile,
        "query_results_PathMatchInDomainGraph_no_time_series_file.json")
    print(results)
    assert (len(results) == 3)
def test_countFC():
    paramfile = "params_CountStableFC_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[76,168])
示例#11
0
def test_patternmatch_stable():
    paramfile = "params_patternmatch_stable_X1X2X3.json"
    results, networkspec = run(paramfile,netfile,"query_results_CycleMatchInStableMorseSet_no_time_series_file.json")
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results=={'X1 : (X1)(~X3) : E\nX2 : (X1 + X3) : E\nX3 : (X1 + X2) : E\n': [[0.0, 205, 2352], [0.1, 317, 2352]], 'X1 : (X1)(~X3) : E\nX2 : (X1) : E\nX3 : (X1 + X2) : E\n': [[0.0, 40, 168], [0.1, 54, 168]], 'X1 : (X1)(~X3) : E\nX2 : (X3)(~X1) : E\nX3 : (X1 + X2) : E\n': [[0.0, 0, 2352], [0.1, 0, 2352]]})
示例#12
0
def test_countFC():
    paramfile = "params_CountStableFC_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    print(results)
    assert(len(results)==3)
    assert(networkspec in results)
    assert(results[networkspec]==[76,168])
def test_patternmatch_path_badwavepool():
    paramfile = "params_patternmatch_path_domaingraph_badwavepool.json"
    with warnings.catch_warnings(record=True) as w:
        # Trigger a warning.
        _ = run(paramfile,"bad_wavepool.txt")
        # Verify some things
        print(w)
        assert(len(w) == 0)
示例#14
0
def test_patternmatch_path_badwavepool():
    paramfile = "params_patternmatch_path_domaingraph_badwavepool.json"
    with warnings.catch_warnings(record=True) as w:
        # Trigger a warning.
        _ = run(paramfile,"bad_wavepool.txt","query_results_PathMatchInDomainGraph_wt1_microarray_coregenes_lifepoints_interpol_trim.json")
        # Verify some things
        print(w)
        assert(len(w) == 0)
示例#15
0
def test_countFP_remove_with_filter():
    paramfile =  "params_remove_CountFPMatch_with_filter_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    print(results)
    assert(len(results)==6)
    assert(networkspec in results)
    assert(results[networkspec]==[8,168])
    assert(results=={'X1 : (X1)(~X3) : E\nX2 : (X1) : E\nX3 : (X2) : E\n': [4, 14], 'X1 : (X1)(~X3) : E\nX2 : (X1) : E\nX3 : (X1 + X2 + x4) : E\nx4 : (X1) : E\n': [120, 4968], 'X1 : (X1)(~X3) : E\nX2 : (X1) : E\nX3 : (X1 + X2) : E\n': [8, 168], 'X1 : (X1 + X3) : E\nX2 : (X1) : E\nX3 : (X1 + X2) : E\n': [24, 168], 'X1 : (X1)(~X3) : E\nX2 : (X3) : E\nX3 : (X1 + X2 + x4) : E\nx4 : (~X2) : E\n': [0, 4872], 'X1 : (X1)(~X3) : E\nX2 : (X1)(~X3) : E\nX3 : (X1 + X2) : E\n': [48, 2352]})
示例#16
0
def worker(u, i):
	username =  getusername(u)
	# if even, do write first, else do reads first
	query = ["run_tests.py", username]
	query.extend(task)
	query.extend([getuserfile(basehtml, u, i),getuserfile(basecookie, u, i)])
	if u % 2 == 0:
		query.append("1") # do reads first
	else:
		query.append("0") # do writes first
	assert len(query) == 10, "wrong number of arguments"
	stat.set(u)
	assert stat.worker != 0, "not a worker :-("
	res = run_tests.run(query,stat)

	workerFinish()
示例#17
0
    'arguments': '$IN_FILE$'
}

directory = ''

if ADDRESS_STYLE == 'PARENT':
    folder = input(colored('Input folder name: ', 'blue'))
    if folder != '':
        folder = '/' + folder + '/'
    path = Path(__file__).resolve().parents[1].as_posix()
    directory = path + folder
elif ADDRESS_STYLE == 'CURRENT':
    folder = input(colored('Input folder name: ', 'blue'))
    if folder != '':
        folder = '/' + folder + '/'
    path = Path(__file__).resolve().parents[0].as_posix()
    directory = path + folder
elif ADDRESS_STYLE == 'ABSOLUTE':
    directory = input(colored('Input folder\'s absolute path: ', 'blue'))
    if directory[-1] != '/':
        directory += '/'

if directory != '':
    config = settings.open_settings(default_settings=DEFAULT_SETTINGS, directory=directory)
    files = find_file.find_files(directory=directory)
    if not build.build(files, directory=directory, settings=config):
        run_tests.run(directory=directory, settings=config)
        if config['style_check']:
            style_check.check(files, directory=directory)
        if config['cleanup']:
            cleanup.cleanup(directory=directory, settings=config)
def test_patternmatch_path_wavepool():
    paramfile = "params_patternmatch_path_domaingraph_wavepool.json"
    results, networkspec = run(paramfile,"good_wavepool.txt")
    print(networkspec)
    print(results)
    assert(results=={'SWI4 : (NDD1)(~YOX1) : E\nHCM1 : SWI4 : E\nNDD1 : HCM1 : E\nYOX1 : SWI4 : E': [[0.0, 0, 14], [0.01, 8, 14], [0.05, 5, 14]]})
示例#19
0
#!/usr/bin/env python2.7
import run_tests

run_tests.run("examples", "prod")
示例#20
0
def test_countFP_remove():
    paramfile =  "params_remove_CountFPMatch_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    assert(len(results)==6)
    assert(networkspec in results)
    assert(results[networkspec]==[8,168])
def test_countFP_remove():
    paramfile =  "params_remove_CountFPMatch_X1X2X3.json"
    results, networkspec = run(paramfile,netfile)
    assert(len(results)==6)
    assert(networkspec in results)
    assert(results[networkspec]==[8,168])
示例#22
0
文件: setup.py 项目: fvalverd/AutoApi
 def run_tests(self):
     import shlex
     from run_tests import run
     run(args=[shlex.split(self.runtests_args)])
示例#23
0
 def run_tests(self):
     import shlex
     from run_tests import run
     run(args=[shlex.split(self.runtests_args)])