raise KeyError('use_testcache=False') ex2_cxs = helpers.load_testdata('ex2_cxs', uid=hs.get_db_name()) except KeyError: ex2_cxs = encounter.get_chip_encounters(hs) helpers.save_testdata('ex2_cxs', uid=hs.get_db_name()) cxs = ex2_cxs[-1] assert len(cxs) > 1 qcx2_res = encounter.intra_query_cxs(hs, cxs) # Make a graph between the chips graph_netx = encounter.make_chip_graph(qcx2_res) netx.write_dot(graph_netx, 'encounter_graph.dot') try: import graph_tool graph = graph_tool.Graph() except ImportError as ex: print(ex) #encounter.viz_chipgraph(hs, graph, fnum=20, with_images=False) #encounter.viz_chipgraph(hs, graph, fnum=20, with_images=True) df2.update() if __name__ == '__main__': multiprocessing.freeze_support() hs = test_api.main() test_encounter(hs) exec(df2.present()) ''' python _tests/test_encounter.py --dbdir ~/data/work/MISC_Jan12 python _tests/test_encounter.py --dbdir ~/data/work/NAUTS_Dan '''
#!/usr/bin/env python # TODO: ADD COPYRIGHT TAG from __future__ import print_function, division from hscom import helpers as util from hsdev import test_api from hsgui import guitools from os.path import join import multiprocessing if __name__ == '__main__': multiprocessing.freeze_support() app, is_root = guitools.init_qtapp() hs, back = test_api.main(defaultdb=None, preload=False, app=app) # Build the test db name work_dir = back.get_work_directory() new_dbname = 'scripted_test_db' new_dbdir = join(work_dir, new_dbname) # Remove it if it exists util.delete(new_dbdir) back.new_database(new_dbdir) back.import_images_from_file() guitools.run_main_loop(app, is_root, back, frequency=100)
#!/usr/bin/env python # TODO: ADD COPYRIGHT TAG from __future__ import print_function, division from hsdev import test_api from hsgui import guitools import multiprocessing if __name__ == '__main__': # For windows multiprocessing.freeze_support() # Initialize a qt app (or get parent's) app, is_root = guitools.init_qtapp() # Create a HotSpotter API (hs) and GUI backend (back) hs, back = test_api.main(defaultdb='NAUTS', preload=False, app=app) # The test api returns a list of interesting chip indexes cx = test_api.get_test_cxs(hs, 1)[0] # Convert chip-index in to chip-id cid = hs.cx2_cid(cx) # Query the chip-id res = back.query(cid) # LAAEFTR: use res to do stuff # Run Qt Loop to use the GUI guitools.run_main_loop(app, is_root, back, frequency=20)
args_ = (kpts1_m, kpts2_m) kwargs_ = dict(fs=fs, scale_factor=scale_factor, draw_ell=False, draw_lines=False, heatmap=True) return dstimg1, dstimg2, args_, kwargs_ if __name__ == '__main__': exec_str = 'exec(open("_tests/test_coverage.py").read())' multiprocessing.freeze_support() np.set_printoptions(precision=2, threshold=1000000, linewidth=180) # --- LOAD TABLES --- # hs = test_api.main(preload=True) # Test variables cx = test_api.get_test_cxs(hs, 1)[0] if hs.get_db_name() == 'HSDB_zebra_with_mothers': cx = hs.cid2_cx(13) kpts = hs.get_kpts(cx) chip = hs.get_chip(cx) chip_shape = chip.shape[0:2] np.tau = 2 * np.pi fnum = 2 # Reload test_api.reload_all() coverage.rrr() scale_factor = .1
#!/usr/bin/env python # TODO: ADD COPYRIGHT TAG from __future__ import print_function, division from hsdev import test_api from hsviz import viz import multiprocessing if __name__ == '__main__': # INITIALIZATION CODE # For windows multiprocessing.freeze_support() # Create a HotSpotter API (hs) and GUI backend (back) hs = test_api.main(defaultdb='NAUTS', preload=True, app=None) # The test api returns a list of interesting chip indexes qcx = test_api.get_test_cxs(hs, 1)[0] # Convert chip-index in to chip-id viz.viz_spatial_verification(hs, qcx) exec(viz.df2.present(num_rc=(1, 1), wh=2500)) ''' Some test variables for SV things fx1_m = np.array( (1, 2, 3, 4, 5)) x1_m = np.array( (1, 2, 1, 4, 5)) y1_m = np.array( (1, 2, 1, 4, 5)) acd1_m = np.array(((1, 1, 1, 1, 1), (0, 0, 0, 0, 0), (1, 1, 1, 1, 1))) fx2_m = np.array( (1, 2, 3, 2, 5)) x2_m = np.array( (1, 2, 1, 4, 5))