def display_alch_profit(): ge = OSRS_GE_Data() #This doesn't work right if the traded quantity is 0 alchfunc = lambda x: ge.ge_json[x][ 'sp'] * 0.6 - ge.nature_rune - ge.ge_json[x][ 'overall_average'] if ge.ge_json[x]['overall_average' ] > 0 else -sys.maxsize - 1 lf = alchfunc jl = ge.sort_json(ge.ge_json, lf, True) small_list = ge.get_top_values(10, jl) sorted_list = [] for id in small_list: #TODO: This should be parameterized and maybe made into an insert function temp_entry = ge.get_entry(id) temp_entry['alch_diff'] = lf(id) print(temp_entry) sorted_list.append(temp_entry) '''header = sorted_list[0].keys() rows = [x.values() for x in sorted_list] print(tabulate.tabulate(rows, header))''' vis = Visualization() vis.display(sorted_list, x='name', y='alch_diff')
path_plugin_instances = project.get_plugin_instances(project.plugin_names.PATHS) print("Number of path plugins: {0:d}".format(len(path_plugin_instances))) for name in path_plugin_instances: test_project.show_path(project, name) ## Get an SV segmentation object. # #show_segmentation(project, vis, "right_iliac") seg_plugin_instances = project.get_plugin_instances(project.plugin_names.SEGMENTATIONS) print("Number of segmentation plugin instances: {0:d}".format(len(seg_plugin_instances))) for name in seg_plugin_instances: test_project.show_segmentation(project, name) ## Get an SV model object. # # test_project.show_model(project, "demo") ## Get an image object. # # test_project.show_image(project, "sample_data-cm") ## Get a mesh object. # test_project.show_mesh(project, "demo") ## Display geometry. # if True: vis.display()