def test_format_df(): logger.debug('\n> 树的合并') from function_ultra import utils mStandAddrTreeBuilder = StandAddrTreeBuilder() # 实例 my_tree = utils.read_var(myconfig.MY_TREE) mStandAddrTreeBuilder.format_tree(my_tree.root) utils.save_var(my_tree, myconfig.MY_TREE) pdb.set_trace() logger.debug('\n> 树的合并测试完成')
def first_init_DG(self): my_tree = utils.read_var(myconfig.MY_TREE) di = nx.DiGraph() my_tree.trans_tree_2_graph(my_tree.root,di) utils.save_var(di,myconfig.DIGRAPH) return my_tree,utils.read_var(myconfig.DIGRAPH)
def init_DG(self): my_tree = utils.read_var(myconfig.MY_TREE) di = utils.read_var(myconfig.DIGRAPH) return my_tree, di
def __init__(self): pass self.my_tree,self.di = self.init_DG() self.full_my_tree = utils.read_var(myconfig.MY_TREE)
def load_address_tree(sav_file='./my_tree.pkl'): my_tree = utils.read_var(sav_file) return my_tree
def show_tree(): my_tree = utils.read_var(myconfig.MY_TREE) my_tree.show_tree(my_tree.root) pdb.set_trace()
graph.add_edge(node_char, childnode_char, wealth=childnode.wealth) self.trans_tree_2_graph(childnode, graph) except: import traceback traceback.print_exc() pdb.set_trace() if __name__ == '__main__': import business_ultra from business_ultra import init_data from business_ultra import activity_match #business_ultra.init_data.gen_std_tree_from_dataframe() my_tree = utils.read_var(myconfig.MY_TREE) pdb.set_trace() my_tree.show_tree(my_tree.root) acti_match_ins = activity_match.ActiMatch('dummy') #gen = acti_match_ins.read_file(myconfig.STDTXTPATH) lst = [] lst.append(['青山区/DIST']) def gen(): for i in lst: yield i gen = gen() while (1): item = gen.__next__()