Esempio n. 1
0
 def layout_figures(back):
     # Options -> Layout Figures
     print('[back] layout_figures')
     nCols = 3
     nRows = 2
     if back.app is None:
         print('[*back] WARNING: cannot detect screen geometry')
         dlen = 1618
     else:
         app = back.app
         screen_rect = app.desktop().screenGeometry()
         width = screen_rect.width()
         height = screen_rect.height()
         dlen = np.sqrt(width**2 + height**2) / 1.618
     df2.present(num_rc=(nRows, nCols), wh=dlen, wh_off=(0, 60))
Esempio n. 2
0
 def layout_figures(back):
     # Options -> Layout Figures
     print('[back] layout_figures')
     nCols = 3
     nRows = 2
     if back.app is None:
         print('[*back] WARNING: cannot detect screen geometry')
         dlen = 1618
     else:
         app = back.app
         screen_rect = app.desktop().screenGeometry()
         width  = screen_rect.width()
         height = screen_rect.height()
         dlen = np.sqrt(width ** 2 + height ** 2) / 1.618
     df2.present(num_rc=(nRows, nCols), wh=dlen, wh_off=(0, 60))
Esempio n. 3
0
            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
'''
Esempio n. 4
0
if __name__ == '__main__':
    multiprocessing.freeze_support()
    print('[dev] __main__ ')
    # useful when copy and pasting into ipython
    main_locals = dev_main()
    hs = main_locals['hs']
    qcx_list = main_locals['qcx_list']
    exec(helpers.execstr_dict(main_locals, 'main_locals'))
    print('[dev]====================')
    if hs.args.printoff:
        all_printoff()
    mf.print_off()  # Make testing slightly faster
    # Big test function. Should be replaced with something
    # not as ugly soon.
    run_investigations(hs, qcx_list)
    # A redundant query argument. Again, needs to be replaced.
    if hs.args.query is not None and len(hs.args.query) > 0:
        qcx = hs.cid2_cx(hs.args.query[0])
        res = hs.query(qcx)
        res.show_top(hs)
    print('[dev]====================')
    kwargs = {}
    dcxs = None
    query_cfg = None
    if hs.args.nopresent:
        print('...not presenting')
        sys.exit(0)
    allres = allres_ptr[0]
    exec(df2.present())  # **df2.OooScreen2()
Esempio n. 5
0
if __name__ == '__main__':
    multiprocessing.freeze_support()
    print('[dev] __main__ ')
    # useful when copy and pasting into ipython
    main_locals = dev_main()
    hs = main_locals['hs']
    qcx_list = main_locals['qcx_list']
    exec(helpers.execstr_dict(main_locals, 'main_locals'))
    print('[dev]====================')
    if hs.args.printoff:
        all_printoff()
    mf.print_off()  # Make testing slightly faster
    # Big test function. Should be replaced with something
    # not as ugly soon.
    run_investigations(hs, qcx_list)
    # A redundant query argument. Again, needs to be replaced.
    if hs.args.query is not None and len(hs.args.query) > 0:
        qcx = hs.cid2_cx(hs.args.query[0])
        res = hs.query(qcx)
        res.show_top(hs)
    print('[dev]====================')
    kwargs = {}
    dcxs = None
    query_cfg = None
    if hs.args.nopresent:
        print('...not presenting')
        sys.exit(0)
    allres = allres_ptr[0]
    exec(df2.present())  # **df2.OooScreen2()