diff --git a/main_package/classes/cache.py b/main_package/classes/cache.py index b3e15e1..16adc09 100644 --- a/main_package/classes/cache.py +++ b/main_package/classes/cache.py @@ -10,6 +10,8 @@ class Cache: def find(self, parents_comb: typing.Set): try: + #print("Cache State:", self.list_of_sets_of_indxs) + #print("Look For:", parents_comb) result = self.actual_cache[self.list_of_sets_of_indxs.index(parents_comb)] print("CACHE HIT!!!!") return result @@ -17,6 +19,7 @@ class Cache: return None def put(self, parents_comb: typing.Set, socim: sofc.SetOfCims): + #print("Putting in cache:", parents_comb) self.list_of_sets_of_indxs.append(parents_comb) self.actual_cache.append(socim) diff --git a/main_package/classes/network_graph.py b/main_package/classes/network_graph.py index 7e47167..aaf297b 100644 --- a/main_package/classes/network_graph.py +++ b/main_package/classes/network_graph.py @@ -40,7 +40,6 @@ class NetworkGraph(): def add_nodes(self, list_of_nodes): #self.graph.add_nodes_from(list_of_nodes) - set_node_attr = nx.set_node_attributes nodes_indxs = self.graph_struct.list_of_nodes_indexes() nodes_vals = self.graph_struct.nodes_values() pos = 0 @@ -59,19 +58,8 @@ class NetworkGraph(): #p_indxes= [] #p_values = [] get_node_indx = self.get_node_indx - get_states_number_by_indx = self.get_states_number_by_indx p_indxes = [get_node_indx(node) for node in sorted_parents] - p_values = [get_states_number_by_indx(indx) for indx in p_indxes] - """for n in parents: - #indx = self.graph_struct.get_node_indx(n) - - #print(indx) - #ordered_set[n] = indx - node_indx = self.get_node_indx(n) - p_indxes.append(node_indx) - #p_values.append(self.graph_struct.get_states_number(n)) - p_values.append(self.get_states_number_by_indx(node_indx))""" - #ordered_set = (sorted_parents, p_indxes, p_values) + p_values = [self.get_states_number(node) for node in sorted_parents] return (sorted_parents, p_indxes, p_values) def get_ord_set_of_par_of_all_nodes(self): @@ -106,16 +94,6 @@ class NetworkGraph(): return states_number_list def build_fancy_indexing_structure(self, start_indx): - """list_of_parents_list = self.get_ord_set_of_par_of_all_nodes() - #print(list_of_parents_list) - index_structure = [] - for i, list_of_parents in enumerate(list_of_parents_list): - indexes_for_a_node = [] - for j, node in enumerate(list_of_parents): - indexes_for_a_node.append(self.get_node_indx(node) + start_indx) - index_structure.append(np.array(indexes_for_a_node, dtype=np.int)) - #print(index_structure) - return index_structure""" if start_indx > 0: pass else: @@ -123,35 +101,19 @@ class NetworkGraph(): return fancy_indx - def build_time_scalar_indexing_structure_for_a_node(self, node_indx, parents_indxs): - #print(node_indx) - #print("Parents_id", parents_indxs) - #T_vector = np.array([self.graph_struct.variables_frame.iloc[node_id, 1].astype(np.int)]) - get_states_number_by_indx = self.graph_struct.get_states_number_by_indx - T_vector = np.array([get_states_number_by_indx(node_indx)]) - #print(T_vector) - #T_vector = np.append(T_vector, [get_states_number_by_indx(x) for x in parents_indxs]) + def build_time_scalar_indexing_structure_for_a_node(self, node_id, parents_indxs): + T_vector = np.array([self.get_states_number(node_id)]) T_vector = np.append(T_vector, parents_indxs) - #print(T_vector) T_vector = T_vector.cumprod().astype(np.int) + # print(T_vector) return T_vector - #print(T_vector) - def build_time_scalar_indexing_structure(self): - #parents_indexes_list = self._fancy_indexing - """for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), self._fancy_indexing): - self._time_scalar_indexing_structure.append( - self.build_time_scalar_indexing_structure_for_a_node(node_indx, p_indxs))""" - build_time_scalar_indexing_structure_for_a_node = self.build_time_scalar_indexing_structure_for_a_node - self._time_scalar_indexing_structure = [build_time_scalar_indexing_structure_for_a_node(node_indx, p_indxs) - for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), - self.get_ordered_by_indx_parents_values_for_all_nodes())] - def build_transition_scalar_indexing_structure_for_a_node(self, node_indx, parents_indxs): + def build_transition_scalar_indexing_structure_for_a_node(self, node_id, parents_indxs): #M_vector = np.array([self.graph_struct.variables_frame.iloc[node_id, 1], #self.graph_struct.variables_frame.iloc[node_id, 1].astype(np.int)]) - node_states_number = self.get_states_number_by_indx(node_indx) - get_states_number_by_indx = self.graph_struct.get_states_number_by_indx + node_states_number = self.get_states_number(node_id) + #get_states_number_by_indx = self.graph_struct.get_states_number_by_indx M_vector = np.array([node_states_number, node_states_number]) #M_vector = np.append(M_vector, [get_states_number_by_indx(x) for x in parents_indxs]) @@ -159,32 +121,22 @@ class NetworkGraph(): M_vector = M_vector.cumprod().astype(np.int) return M_vector - def build_transition_scalar_indexing_structure(self): - #parents_indexes_list = self._fancy_indexing - """for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), self._fancy_indexing): - self._transition_scalar_indexing_structure.append( - self.build_transition_scalar_indexing_structure_for_a_node(node_indx, p_indxs))""" - build_transition_scalar_indexing_structure_for_a_node = self.build_transition_scalar_indexing_structure_for_a_node - self._transition_scalar_indexing_structure = \ - [build_transition_scalar_indexing_structure_for_a_node(node_indx, p_indxs) - for node_indx, p_indxs in - zip(self.graph_struct.list_of_nodes_indexes(), - self.get_ordered_by_indx_parents_values_for_all_nodes())] - def build_time_columns_filtering_structure(self): #parents_indexes_list = self._fancy_indexing """for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), self._fancy_indexing): self._time_filtering.append(np.append(np.array([node_indx], dtype=np.int), p_indxs).astype(np.int))""" + nodes_indxs = self.graph_struct.list_of_nodes_indexes() self._time_filtering = [np.append(np.array([node_indx], dtype=np.int), p_indxs).astype(np.int) - for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), self._fancy_indexing)] + for node_indx, p_indxs in zip(nodes_indxs, self._fancy_indexing)] def build_transition_columns_filtering_structure(self): #parents_indexes_list = self._fancy_indexing nodes_number = self.graph_struct.total_variables_number """for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), self._fancy_indexing): self._transition_filtering.append(np.array([node_indx + nodes_number, node_indx, *p_indxs], dtype=np.int))""" + nodes_indxs = self.graph_struct.list_of_nodes_indexes() self._transition_filtering = [np.array([node_indx + nodes_number, node_indx, *p_indxs], dtype=np.int) - for node_indx, p_indxs in zip(self.graph_struct.list_of_nodes_indexes(), + for node_indx, p_indxs in zip(nodes_indxs, self._fancy_indexing)] def build_scalar_indexing_structures(self): @@ -194,7 +146,7 @@ class NetworkGraph(): aggr = [(build_transition_scalar_indexing_structure_for_a_node(node_indx, p_indxs), build_time_scalar_indexing_structure_for_a_node(node_indx, p_indxs)) for node_indx, p_indxs in - zip(self.graph_struct.list_of_nodes_indexes(), + zip(self._nodes_labels, parents_values_for_all_nodes)] self._transition_scalar_indexing_structure = [i[0] for i in aggr] self._time_scalar_indexing_structure = [i[1] for i in aggr] diff --git a/main_package/classes/sample_path.py b/main_package/classes/sample_path.py index 2d67fe6..25ba7d5 100644 --- a/main_package/classes/sample_path.py +++ b/main_package/classes/sample_path.py @@ -33,7 +33,11 @@ class SamplePath: def build_structure(self): self.total_variables_count = len(self.importer.sorter) - self._structure = st.Structure(self.importer.structure, self.importer.variables, + labels = self.importer._df_variables['Name'].to_list() + indxs = self.importer._df_variables.index.to_numpy() + vals = self.importer._df_variables['Value'].to_numpy() + edges = list(self.importer._df_structure.to_records(index=False)) + self._structure = st.Structure(labels, indxs, vals, edges, self.total_variables_count) @property diff --git a/main_package/classes/structure.py b/main_package/classes/structure.py index c706ee3..4f89978 100644 --- a/main_package/classes/structure.py +++ b/main_package/classes/structure.py @@ -10,44 +10,48 @@ class Structure: rispetto alle colonne del dataset """ - def __init__(self, structure, variables, total_variables_number): - self.structure_frame = structure - self.variables_frame = variables + def __init__(self, nodes_label_list, node_indexes_arr, nodes_vals_arr, edges_list, total_variables_number): + #self.structure_frame = structure + #self.variables_frame = variables + self.nodes_labels_list = nodes_label_list + self.nodes_indexes_arr = node_indexes_arr + self.nodes_vals_arr = nodes_vals_arr + self.edges_list = edges_list self.total_variables_number = total_variables_number - self.name_label = variables.columns.values[0] - self.value_label = variables.columns.values[1] + #self.name_label = variables.columns.values[0] + #self.value_label = variables.columns.values[1] def list_of_edges(self): - records = self.structure_frame.to_records(index=False) - edges_list = list(records) - return edges_list + #records = self.structure_frame.to_records(index=False) + #edges_list = list(records) + return self.edges_list def list_of_nodes_labels(self): - return self.variables_frame[self.name_label].values.tolist() + return self.nodes_labels_list def list_of_nodes_indexes(self): - return self.variables_frame.index.to_list() + return self.nodes_indexes_arr def get_node_id(self, node_indx): - return self.variables_frame[self.name_label][node_indx] + return self.nodes_labels_list[node_indx] def get_node_indx(self, node_id): - return self.variables_frame[self.name_label][self.variables_frame[self.name_label] == node_id].index[0] + return self.nodes_indexes_arr[self.nodes_labels_list.index(node_id)] def get_positional_node_indx(self, node_id): - return np.flatnonzero(self.variables_frame[self.name_label] == node_id)[0] + return self.nodes_labels_list.index(node_id) def get_states_number(self, node): #print("node", node) - return self.variables_frame[self.value_label][self.get_node_indx(node)] + return self.nodes_vals_arr[self.get_positional_node_indx(node)] def get_states_number_by_indx(self, node_indx): #print(self.value_label) #print("Node indx", node_indx) - return self.variables_frame[self.value_label][node_indx] + return self.nodes_vals_arr[node_indx] def nodes_values(self): - return self.variables_frame[self.value_label].to_list() + return self.nodes_vals_arr def total_variables_number(self): return self.total_variables_number diff --git a/main_package/classes/structure_estimator.py b/main_package/classes/structure_estimator.py index b22a091..e5e0cee 100644 --- a/main_package/classes/structure_estimator.py +++ b/main_package/classes/structure_estimator.py @@ -5,10 +5,6 @@ import networkx as nx from scipy.stats import f as f_dist from scipy.stats import chi2 as chi2_dist - - - -import sample_path as sp import structure as st import network_graph as ng import parameters_estimator as pe @@ -19,7 +15,10 @@ class StructureEstimator: def __init__(self, sample_path, exp_test_alfa, chi_test_alfa): self.sample_path = sample_path - self.complete_graph_frame = self.build_complete_graph_frame(self.sample_path.structure.list_of_nodes_labels()) + #self.complete_graph_frame = self.build_complete_graph_frame(self.sample_path.structure.list_of_nodes_labels()) + self.nodes = np.array(self.sample_path.structure.list_of_nodes_labels()) + self.nodes_vals = self.sample_path.structure.nodes_vals_arr + self.nodes_indxs = self.sample_path.structure.nodes_indexes_arr self.complete_graph = self.build_complete_graph(self.sample_path.structure.list_of_nodes_labels()) self.exp_test_sign = exp_test_alfa self.chi_test_alfa = chi_test_alfa @@ -36,52 +35,23 @@ class StructureEstimator: complete_graph.add_edges_from(itertools.permutations(node_ids, 2)) return complete_graph #TODO Tutti i valori che riguardano il test child possono essere settati una volta sola - def complete_test(self, tmp_df, test_parent, test_child, parent_set, child_states_numb): + def complete_test(self, test_parent, test_child, parent_set, child_states_numb, tot_vars_count): p_set = parent_set[:] complete_info = parent_set[:] - complete_info.append(test_parent) - #tmp_df = self.complete_graph_frame.loc[self.complete_graph_frame['To'].isin([test_child])] - #tmp_df = self.complete_graph_frame.loc[np.in1d(self.complete_graph_frame['To'], test_child)] - d2 = tmp_df.loc[tmp_df['From'].isin(complete_info)] complete_info.append(test_child) - values_frame = self.sample_path.structure.variables_frame - v2 = values_frame.loc[ - values_frame['Name'].isin(complete_info)] - - #print(tmp_df) - #d1 = tmp_df.loc[tmp_df['From'].isin(parent_set)] - #parent_set.append(test_child) - #print(parent_set) - """v1 = self.sample_path.structure.variables_frame.loc[self.sample_path.structure.variables_frame['Name'].isin(parent_set)] - s1 = st.Structure(d1, v1, self.sample_path.total_variables_count) - g1 = ng.NetworkGraph(s1) - g1.init_graph()""" - - #parent_set.append(test_parent) - """d2 = tmp_df.loc[tmp_df['From'].isin(parent_set)] - v2 = self.sample_path.structure.variables_frame.loc[self.sample_path.structure.variables_frame['Name'].isin(parent_set)] - s2 = st.Structure(d2, v2, self.sample_path.total_variables_count) - g2 = ng.NetworkGraph(s2) - g2.init_graph()""" - #parent_set.append(test_child) - #sofc1 = None - #if not sofc1: if not p_set: sofc1 = self.cache.find(test_child) else: sofc1 = self.cache.find(set(p_set)) if not sofc1: - #d1 = tmp_df.loc[tmp_df['From'].isin(parent_set)] - d1 = d2[d2.From != test_parent] - - #v1 = self.sample_path.structure.variables_frame.loc[ - #self.sample_path.structure.variables_frame['Name'].isin(parent_set)] - v1 = v2[v2.Name != test_parent] - #print("D1", d1) - #print("V1", v1) + bool_mask1 = np.isin(self.nodes,complete_info) + l1 = list(self.nodes[bool_mask1]) + indxs1 = self.nodes_indxs[bool_mask1] + vals1 = self.nodes_vals[bool_mask1] + eds1 = list(itertools.product(parent_set,test_child)) #TODO il numero di variabili puo essere passato dall'esterno - s1 = st.Structure(d1, v1, self.sample_path.total_variables_count) + s1 = st.Structure(l1, indxs1, vals1, eds1, tot_vars_count) g1 = ng.NetworkGraph(s1) g1.init_graph() p1 = pe.ParametersEstimator(self.sample_path, g1) @@ -93,7 +63,8 @@ class StructureEstimator: else: self.cache.put(set(p_set), sofc1) sofc2 = None - p_set.append(test_parent) + #p_set.append(test_parent) + p_set.insert(0, test_parent) if p_set: #p_set.append(test_parent) #print("PSET ", p_set) @@ -108,15 +79,13 @@ class StructureEstimator: p2.compute_parameters_for_node(test_child) sofc2 = p2.sets_of_cims_struct.sets_of_cims[s2.get_positional_node_indx(test_child)]""" if not sofc2: - #print("Cache Miss SOC2") - #parent_set.append(test_parent) - #d2 = tmp_df.loc[tmp_df['From'].isin(p_set)] - #v2 = self.sample_path.structure.variables_frame.loc[ - #self.sample_path.structure.variables_frame['Name'].isin(parent_set)] - #print("D2", d2) - #print("V2", v2) - #s2 = st.Structure(d2, v2, self.sample_path.total_variables_count) - s2 = st.Structure(d2, v2, self.sample_path.total_variables_count) + complete_info.append(test_parent) + bool_mask2 = np.isin(self.nodes, complete_info) + l2 = list(self.nodes[bool_mask2]) + indxs2 = self.nodes_indxs[bool_mask2] + vals2 = self.nodes_vals[bool_mask2] + eds2 = list(itertools.product(p_set, test_child)) + s2 = st.Structure(l2, indxs2, vals2, eds2, tot_vars_count) g2 = ng.NetworkGraph(s2) g2.init_graph() p2 = pe.ParametersEstimator(self.sample_path, g2) @@ -151,7 +120,7 @@ class StructureEstimator: for val in range(0, child_states_numb): if F_stats[val] < f_dist.ppf(self.exp_test_sign / 2, r1s[val], r2s[val]) or \ F_stats[val] > f_dist.ppf(1 - self.exp_test_sign / 2, r1s[val], r2s[val]): - print("CONDITIONALLY DEPENDENT EXP") + #print("CONDITIONALLY DEPENDENT EXP") return False #M1_no_diag = self.remove_diagonal_elements(cim1.state_transition_matrix) #M2_no_diag = self.remove_diagonal_elements(cim2.state_transition_matrix) @@ -176,26 +145,26 @@ class StructureEstimator: #print("Chi Quantile", chi_2_quantile) if Chi > chi_2_quantile: #if np.any(chi_stats > chi_2_quantile): - print("CONDITIONALLY DEPENDENT CHI") + #print("CONDITIONALLY DEPENDENT CHI") return False #print("Chi test", Chi) return True - def one_iteration_of_CTPC_algorithm(self, var_id): + def one_iteration_of_CTPC_algorithm(self, var_id, tot_vars_count): + print("TESTING VAR", var_id) u = list(self.complete_graph.predecessors(var_id)) - tests_parents_numb = len(u) - complete_frame = self.complete_graph_frame - test_frame = complete_frame.loc[complete_frame['To'].isin([var_id])] + #tests_parents_numb = len(u) + #complete_frame = self.complete_graph_frame + #test_frame = complete_frame.loc[complete_frame['To'].isin([var_id])] child_states_numb = self.sample_path.structure.get_states_number(var_id) b = 0 while b < len(u): #for parent_id in u: parent_indx = 0 - while u and parent_indx < tests_parents_numb and b < len(u): + while parent_indx < len(u): # list_without_test_parent = u.remove(parent_id) + removed = False - #print("b", b) - #print("Parent Indx", parent_indx) #if not list(self.generate_possible_sub_sets_of_size(u, b, u[parent_indx])): #break S = self.generate_possible_sub_sets_of_size(u, b, parent_indx) @@ -204,19 +173,9 @@ class StructureEstimator: for parents_set in S: #print("Parent Set", parents_set) #print("Test Parent", u[parent_indx]) - if self.complete_test(test_frame, u[parent_indx], var_id, parents_set, child_states_numb): - #print("Removing EDGE:", u[parent_indx], var_id) + if self.complete_test(u[parent_indx], var_id, parents_set, child_states_numb, tot_vars_count): + print("Removing EDGE:", u[parent_indx], var_id) self.complete_graph.remove_edge(u[parent_indx], var_id) - #print(self.complete_graph_frame) - """self.complete_graph_frame = \ - self.complete_graph_frame.drop( - self.complete_graph_frame[(self.complete_graph_frame.From == - u[parent_indx]) & (self.complete_graph_frame.To == var_id)].index)""" - - complete_frame.drop(complete_frame[(complete_frame.From == u[parent_indx]) & - (complete_frame.To == var_id)].index, inplace=True) - #print(self.complete_graph_frame) - #u.remove(u[parent_indx]) del u[parent_indx] removed = True #else: @@ -227,8 +186,6 @@ class StructureEstimator: self.cache.clear() def generate_possible_sub_sets_of_size(self, u, size, parent_indx): - #print("Inside Generate subsets", u) - #print("InsideGenerate Subsets", parent_id) list_without_test_parent = u[:] del list_without_test_parent[parent_indx] # u.remove(parent_id) @@ -243,10 +200,10 @@ class StructureEstimator: def ctpc_algorithm(self): ctpc_algo = self.one_iteration_of_CTPC_algorithm - nodes = self.sample_path.structure.list_of_nodes_labels() + total_vars_numb = self.sample_path.total_variables_count #for node_id in self.sample_path.structure.list_of_nodes_labels(): #print("TESTING VAR:", node_id) #self.one_iteration_of_CTPC_algorithm(node_id) #print(self.complete_graph_frame) - [ctpc_algo(n) for n in nodes] + [ctpc_algo(n, total_vars_numb) for n in self.nodes] diff --git a/main_package/tests/test_structure.py b/main_package/tests/test_structure.py index 47e90a4..1f0e909 100644 --- a/main_package/tests/test_structure.py +++ b/main_package/tests/test_structure.py @@ -2,13 +2,18 @@ import sys sys.path.append("/Users/Zalum/Desktop/Tesi/CTBN_Project/main_package/classes/") import unittest import pandas as pd +import numpy as np + +import sample_path as sp import structure as st +import network_graph as ng +import parameters_estimator as pe class TestStructure(unittest.TestCase): def setUp(self): - self.structure_frame = pd.DataFrame([{"From":"X","To":"Z"}, {"From":"X","To":"Y"},{"From":"Y","To":"X"}, - {"From":"Y","To":"Z"},{"From":"Z","To":"Y"}, {"From":"Z","To":"X"} ]) + self.structure_frame = pd.DataFrame([{"From":"X","To":"Z"}, {"From":"Y","To":"Z"}, + {"From":"Z","To":"Y"} ]) self.variables_frame = pd.DataFrame([{"Name":"X","Value":3},{"Name":"Y","Value":3},{"Name":"Z","Value":3}]) def test_init(self): @@ -68,13 +73,52 @@ class TestStructure(unittest.TestCase): for indx, row in self.variables_frame.iterrows(): self.assertEqual(row[1], s1.get_states_number_by_indx(indx)) - def test_remove_node(self): - s1 = st.Structure(self.structure_frame, self.variables_frame, len(self.variables_frame.index)) - s1.remove_node('Y') - print(s1.variables_frame) - print(s1.structure_frame) + def test_new_init(self): + #self.variables_frame.drop(self.variables_frame[(self.variables_frame['Name'] == 'Y')].index, inplace=True) + """labels = self.variables_frame['Name'].to_list() + indxs = self.variables_frame.index.to_numpy() + vals = self.variables_frame['Value'].to_numpy() + edges = list(self.structure_frame.to_records(index=False)) + print(labels) + print(indxs) + print(vals) + print(edges) + s1 = st.Structure(labels, indxs, vals, edges, len(self.variables_frame.index)) + #print(s1.get_node_id(2)) print(s1.get_node_indx('Z')) print(s1.get_positional_node_indx('Z')) + print(s1.get_states_number('Z')) + print(s1.get_states_number_by_indx(1)) + [CIM: +[[-4.82318981 1.18421625 3.63997346] + [ 4.44726473 -9.20141291 4.755239 ] + [ 2.93950444 4.36292948 -7.30152554]], CIM: +[[-6.0336893 1.69212904 4.34235011] + [ 3.32692085 -5.03977237 1.7137923 ] + [ 3.65519241 3.81402509 -7.46819716]], CIM: +[[-6.78778897 1.98559721 4.80306557] + [ 1.23811008 -6.26366842 5.0265376 ] + [ 3.02720526 4.0256821 -7.05222539]]] + array([ 3, 9, 27]) + array([3, 9]) + array([1, 2]) + array([4, 1, 2]) + """ + sp1 = sp.SamplePath('../data', 'samples', 'dyn.str', 'variables', 'Time', 'Name') + sp1.build_trajectories() + sp1.build_structure() + st1 = st.Structure(['X', 'Y', 'Z'], np.array([0,1,2]), np.array([3,3,3]), [('X', 'Y'), ('Z', 'Y')], sp1.total_variables_count) + g1 = ng.NetworkGraph(st1) + g1.init_graph() + print(g1.transition_scalar_indexing_structure) + print(g1.time_scalar_indexing_strucure) + print(g1.time_filtering) + print(g1.transition_filtering) + p1 = pe.ParametersEstimator(sp1,g1) + p1.init_sets_cims_container() + p1.compute_parameters_for_node('Y') + print(p1.sets_of_cims_struct.sets_of_cims[1].actual_cims) + if __name__ == '__main__': unittest.main() diff --git a/main_package/tests/test_structure_estimator.py b/main_package/tests/test_structure_estimator.py index 14651cb..10b2004 100644 --- a/main_package/tests/test_structure_estimator.py +++ b/main_package/tests/test_structure_estimator.py @@ -1,6 +1,5 @@ import unittest from line_profiler import LineProfiler -from multiprocessing import Pool import sample_path as sp import structure_estimator as se @@ -31,7 +30,7 @@ class TestStructureEstimator(unittest.TestCase): lp_wrapper() lp.print_stats() #se1.ctpc_algorithm() - print(se1.complete_graph.edges) + #print(se1.complete_graph.edges) def aux_test_complete_test(self, estimator, test_par, test_child, p_set): estimator.complete_test(test_par, test_child, p_set)