diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..bf26b40 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,28 @@ +environment: + matrix: + - PYTHON: "C:\\Python35" + - PYTHON: "C:\\Python35-x64" + - PYTHON: "C:\\Python36" + - PYTHON: "C:\\Python36-x64" + - PYTHON: "C:\\Python37" + - PYTHON: "C:\\Python37-x64" + - PYTHON: "C:\\Python38" + - PYTHON: "C:\\Python38-x64" + +# skip_commits: +# files: +# - "*.yml" +# - "*.rst" +# - "LICENSE" + +install: + - "%PYTHON%\\python.exe -m pip install -U pip" + - "%PYTHON%\\python.exe -m pip install -U pytest" + - "%PYTHON%\\python.exe -m pip install -r requirements.txt" + - "%PYTHON%\\python.exe -m pip install wheel" + +build: off + +test_script: + - "%PYTHON%\\python.exe setup.py bdist_wheel" + - "%PYTHON%\\python.exe -m pytest -v gklearn/tests/" diff --git a/README.md b/README.md index 1f5aec6..3958704 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # graphkit-learn [![Build Status](https://travis-ci.org/jajupmochi/graphkit-learn.svg?branch=master)](https://travis-ci.org/jajupmochi/graphkit-learn) +[![Build status](https://ci.appveyor.com/api/projects/status/bdxsolk0t1uji9rd?svg=true)](https://ci.appveyor.com/project/jajupmochi/graphkit-learn) [![codecov](https://codecov.io/gh/jajupmochi/graphkit-learn/branch/master/graph/badge.svg)](https://codecov.io/gh/jajupmochi/graphkit-learn) [![Documentation Status](https://readthedocs.org/projects/graphkit-learn/badge/?version=master)](https://graphkit-learn.readthedocs.io/en/master/?badge=master) [![PyPI version](https://badge.fury.io/py/graphkit-learn.svg)](https://badge.fury.io/py/graphkit-learn) diff --git a/gklearn/ged/env/__init__.py b/gklearn/ged/env/__init__.py index 17aefc7..7db022c 100644 --- a/gklearn/ged/env/__init__.py +++ b/gklearn/ged/env/__init__.py @@ -1 +1,2 @@ -from gklearn.ged.env.common_types import AlgorithmState \ No newline at end of file +from gklearn.ged.env.common_types import AlgorithmState +from gklearn.ged.env.node_map import NodeMap \ No newline at end of file diff --git a/gklearn/ged/env/node_map.py b/gklearn/ged/env/node_map.py new file mode 100644 index 0000000..4812486 --- /dev/null +++ b/gklearn/ged/env/node_map.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 22 11:31:26 2020 + +@author: ljia +""" +import numpy as np + +class NodeMap(object): + + def __init__(self, num_nodes_g, num_nodes_h): + self.__forward_map = [np.inf] * num_nodes_g + self.__backward_map = [np.inf] * num_nodes_h + self.__induced_cost = np.inf + + + def num_source_nodes(self): + return len(self.__forward_map) + + + def num_target_nodes(self): + return len(self.__backward_map) + + + def image(self, node): + if node < len(self.__forward_map): + return self.__forward_map[node] + else: + raise Exception('The node with ID ', str(node), ' is not contained in the source nodes of the node map.') + return np.inf + + + def pre_image(self, node): + if node < len(self.__backward_map): + return self.__backward_map[node] + else: + raise Exception('The node with ID ', str(node), ' is not contained in the target nodes of the node map.') + return np.inf + + + def get_forward_map(self): + return self.__forward_map + + + def get_backward_map(self): + return self.__backward_map + + + def as_relation(self, relation): + relation.clear() + for i in range(0, len(self.__forward_map)): + k = self.__forward_map[i] + if k != np.inf: + relation.append(tuple((i, k))) + for k in range(0, len(self.__backward_map)): + i = self.__backward_map[k] + if i == np.inf: + relation.append(tuple((i, k))) + + + def add_assignment(self, i, k): + if i != np.inf: + if i < len(self.__forward_map): + self.__forward_map[i] = k + else: + raise Exception('The node with ID ', str(i), ' is not contained in the source nodes of the node map.') + if k != np.inf: + if k < len(self.__backward_map): + self.__backward_map[k] = i + else: + raise Exception('The node with ID ', str(k), ' is not contained in the target nodes of the node map.') + + + def set_induced_cost(self, induced_cost): + self.__induced_cost = induced_cost + + + def induced_cost(self): + return self.__induced_cost \ No newline at end of file diff --git a/gklearn/ged/median/median_graph_estimator.py b/gklearn/ged/median/median_graph_estimator.py index 7cbb6d6..b5a829c 100644 --- a/gklearn/ged/median/median_graph_estimator.py +++ b/gklearn/ged/median/median_graph_estimator.py @@ -6,7 +6,7 @@ Created on Mon Mar 16 18:04:55 2020 @author: ljia """ import numpy as np -from gklearn.ged.env import AlgorithmState +from gklearn.ged.env import AlgorithmState, NodeMap from gklearn.ged.util import misc from gklearn.utils import Timer import time @@ -15,7 +15,7 @@ import sys import networkx as nx -class MedianGraphEstimator(object): +class MedianGraphEstimator(object): # @todo: differ dummy_node from undifined node? def __init__(self, ged_env, constant_node_costs): """Constructor. @@ -47,6 +47,7 @@ class MedianGraphEstimator(object): self.__desired_num_random_inits = 10 self.__use_real_randomness = True self.__seed = 0 + self.__update_order = True self.__refine = True self.__time_limit_in_sec = 0 self.__epsilon = 0.0001 @@ -57,7 +58,6 @@ class MedianGraphEstimator(object): self.__max_itrs_increase_order = 10 self.__print_to_stdout = 2 self.__median_id = np.inf # @todo: check - self.__median_node_id_prefix = '' # @todo: check self.__node_maps_from_median = {} self.__sum_of_distances = 0 self.__best_init_sum_of_distances = np.inf @@ -126,6 +126,16 @@ class MedianGraphEstimator(object): else: raise Exception('Invalid argument "' + opt_val + '" for option stdout. Usage: options = "[--stdout 0|1|2] [...]"') + elif opt_name == 'update-order': + if opt_val == 'TRUE': + self.__update_order = True + + elif opt_val == 'FALSE': + self.__update_order = False + + else: + raise Exception('Invalid argument "' + opt_val + '" for option update-order. Usage: options = "[--update-order TRUE|FALSE] [...]"') + elif opt_name == 'refine': if opt_val == 'TRUE': self.__refine = True @@ -281,7 +291,6 @@ class MedianGraphEstimator(object): all_graphs_empty = True for graph_id in graph_ids: if self.__ged_env.get_graph_num_nodes(graph_id) > 0: - self.__median_node_id_prefix = self.__ged_env.get_original_node_ids(graph_id)[0] all_graphs_empty = False break if all_graphs_empty: @@ -298,11 +307,11 @@ class MedianGraphEstimator(object): for graph_id in graph_ids: # @todo: get_nx_graph() function may need to be modified according to the coming code. graphs[graph_id] = self.__ged_env.get_nx_graph(graph_id, True, True, False) -# print(self.__ged_env.get_graph_internal_id(0)) -# print(graphs[0].graph) -# print(graphs[0].nodes(data=True)) -# print(graphs[0].edges(data=True)) -# print(nx.adjacency_matrix(graphs[0])) +# print(self.__ged_env.get_graph_internal_id(0)) +# print(graphs[0].graph) +# print(graphs[0].nodes(data=True)) +# print(graphs[0].edges(data=True)) +# print(nx.adjacency_matrix(graphs[0])) # Construct initial medians. @@ -310,10 +319,10 @@ class MedianGraphEstimator(object): self.__construct_initial_medians(graph_ids, timer, medians) end_init = time.time() self.__runtime_initialized = end_init - start -# print(medians[0].graph) -# print(medians[0].nodes(data=True)) -# print(medians[0].edges(data=True)) -# print(nx.adjacency_matrix(medians[0])) +# print(medians[0].graph) +# print(medians[0].nodes(data=True)) +# print(medians[0].edges(data=True)) +# print(nx.adjacency_matrix(medians[0])) # Reset information about iterations and number of times the median decreases and increases. self.__itrs = [0] * len(medians) @@ -353,12 +362,12 @@ class MedianGraphEstimator(object): # Compute node maps and sum of distances for initial median. self.__sum_of_distances = 0 - self.__node_maps_from_median.clear() # @todo + self.__node_maps_from_median.clear() for graph_id in graph_ids: self.__ged_env.run_method(gen_median_id, graph_id) self.__node_maps_from_median[graph_id] = self.__ged_env.get_node_map(gen_median_id, graph_id) # print(self.__node_maps_from_median[graph_id]) - self.__sum_of_distances += self.__ged_env.get_induced_cost(gen_median_id, graph_id) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. + self.__sum_of_distances += self.__node_maps_from_median[graph_id].induced_cost() # print(self.__sum_of_distances) # Print information about current iteration. if self.__print_to_stdout == 2: @@ -389,12 +398,13 @@ class MedianGraphEstimator(object): decreased_order = False increased_order = False - # Update the median. # @todo!!!!!!!!!!!!!!!!!!!!!! + # Update the median. median_modified = self.__update_median(graphs, median) - if not median_modified or self.__itrs[median_pos] == 0: - decreased_order = False - if not decreased_order or self.__itrs[median_pos] == 0: - increased_order = False + if self.__update_order: + if not median_modified or self.__itrs[median_pos] == 0: + decreased_order = self.__decrease_order(graphs, median) + if not decreased_order or self.__itrs[median_pos] == 0: + increased_order = self.__increase_order(graphs, median) # Update the number of iterations without update of the median. if median_modified or decreased_order or increased_order: @@ -421,26 +431,28 @@ class MedianGraphEstimator(object): # Compute induced costs of the old node maps w.r.t. the updated median. for graph_id in graph_ids: -# print(self.__ged_env.get_induced_cost(gen_median_id, graph_id)) - # @todo: watch out if compute_induced_cost is correct, this may influence: increase/decrease order, induced_cost() in the following code.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - self.__ged_env.compute_induced_cost(gen_median_id, graph_id) -# print('---------------------------------------') -# print(self.__ged_env.get_induced_cost(gen_median_id, graph_id)) +# print(self.__node_maps_from_median[graph_id].induced_cost()) +# xxx = self.__node_maps_from_median[graph_id] + self.__ged_env.compute_induced_cost(gen_median_id, graph_id, self.__node_maps_from_median[graph_id]) +# print('---------------------------------------') +# print(self.__node_maps_from_median[graph_id].induced_cost()) + # @todo:!!!!!!!!!!!!!!!!!!!!!!!!!!!!This value is a slight different from the c++ program, which might be a bug! Use it very carefully! # Print information about current iteration. if self.__print_to_stdout == 2: print('done.') # Update the node maps. - node_maps_modified = self.__update_node_maps() # @todo + node_maps_modified = self.__update_node_maps() # Update the order of the median if no improvement can be found with the current order. # Update the sum of distances. old_sum_of_distances = self.__sum_of_distances self.__sum_of_distances = 0 - for graph_id in self.__node_maps_from_median: - self.__sum_of_distances += self.__ged_env.get_induced_cost(gen_median_id, graph_id) # @todo: see above. + for graph_id, node_map in self.__node_maps_from_median.items(): + self.__sum_of_distances += node_map.induced_cost() +# print(self.__sum_of_distances) # Print information about current iteration. if self.__print_to_stdout == 2: @@ -460,7 +472,7 @@ class MedianGraphEstimator(object): # Update the best median. if self.__sum_of_distances < best_sum_of_distances: best_sum_of_distances = self.__sum_of_distances - node_maps_from_best_median = self.__node_maps_from_median + node_maps_from_best_median = self.__node_maps_from_median.copy() # @todo: this is a shallow copy, not sure if it is enough. best_median = median # Update the number of converged descents. @@ -478,7 +490,7 @@ class MedianGraphEstimator(object): # Refine the sum of distances and the node maps for the converged median. self.__converged_sum_of_distances = self.__sum_of_distances if self.__refine: - self.__improve_sum_of_distances(timer) # @todo + self.__improve_sum_of_distances(timer) # Record end time, set runtime and reset the number of initial medians. end = time.time() @@ -513,8 +525,52 @@ class MedianGraphEstimator(object): print('Overall number of times the order decreased: ', self.__num_decrease_order) print('Overall number of times the order increased: ', self.__num_increase_order) print('===========================================================\n') + + + def __improve_sum_of_distances(self, timer): # @todo: go through and test + # Use method selected for refinement phase. + self.__ged_env.set_method(self.__refine_method, self.__refine_options) + + # Print information about current iteration. + if self.__print_to_stdout == 2: + progress = tqdm(desc='Improving node maps', total=len(self.__node_maps_from_median), file=sys.stdout) + print('\n===========================================================') + print('Improving node maps and SOD for converged median.') + print('-----------------------------------------------------------') + progress.update(1) + + # Improving the node maps. + for graph_id, node_map in self.__node_maps_from_median.items(): + if time.expired(): + if self.__state == AlgorithmState.TERMINATED: + self.__state = AlgorithmState.CONVERGED + break + self.__ged_env.run_method(self.__gen_median_id, graph_id) + if self.__ged_env.get_upper_bound(self.__gen_median_id, graph_id) < node_map.induced_cost(): + self.__node_maps_from_median[graph_id] = self.__ged_env.get_node_map(self.__gen_median_id, graph_id) + self.__sum_of_distances += self.__node_maps_from_median[graph_id].induced_cost() + # Print information. + if self.__print_to_stdout == 2: + progress.update(1) + self.__sum_of_distances = 0.0 + for key, val in self.__node_maps_from_median.items(): + self.__sum_of_distances += val.induced_cost() + + # Print information. + if self.__print_to_stdout == 2: + print('===========================================================\n') + + + def __median_available(self): + return self.__gen_median_id != np.inf + def get_state(self): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_state().') + return self.__state + + def get_sum_of_distances(self, state=''): """Returns the sum of distances. @@ -535,6 +591,44 @@ class MedianGraphEstimator(object): if state == 'converged': return self.__converged_sum_of_distances return self.__sum_of_distances + + + def get_runtime(self, state): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_runtime().') + if state == AlgorithmState.INITIALIZED: + return self.__runtime_initialized + if state == AlgorithmState.CONVERGED: + return self.__runtime_converged + return self.__runtime + + + def get_num_itrs(self): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_num_itrs().') + return self.__itrs + + + def get_num_times_order_decreased(self): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_num_times_order_decreased().') + return self.__num_decrease_order + + + def get_num_times_order_increased(self): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_num_times_order_increased().') + return self.__num_increase_order + + + def get_num_converged_descents(self): + if not self.__median_available(): + raise Exception('No median has been computed. Call run() before calling get_num_converged_descents().') + return self.__num_converged_descents + + + def get_ged_env(self): + return self.__ged_env def __set_default_options(self): @@ -543,6 +637,7 @@ class MedianGraphEstimator(object): self.__desired_num_random_inits = 10 self.__use_real_randomness = True self.__seed = 0 + self.__update_order = True self.__refine = True self.__time_limit_in_sec = 0 self.__epsilon = 0.0001 @@ -568,16 +663,16 @@ class MedianGraphEstimator(object): self.__compute_medoid(graph_ids, timer, initial_medians) elif self.__init_type == 'MAX': pass # @todo -# compute_max_order_graph_(graph_ids, initial_medians) +# compute_max_order_graph_(graph_ids, initial_medians) elif self.__init_type == 'MIN': pass # @todo -# compute_min_order_graph_(graph_ids, initial_medians) +# compute_min_order_graph_(graph_ids, initial_medians) elif self.__init_type == 'MEAN': pass # @todo -# compute_mean_order_graph_(graph_ids, initial_medians) +# compute_mean_order_graph_(graph_ids, initial_medians) else: pass # @todo -# sample_initial_medians_(graph_ids, initial_medians) +# sample_initial_medians_(graph_ids, initial_medians) # Print information about current iteration. if self.__print_to_stdout == 2: @@ -655,20 +750,20 @@ class MedianGraphEstimator(object): # Iterate through all nodes of the median. for i in range(0, nx.number_of_nodes(median)): -# print('i: ', i) +# print('i: ', i) # Collect the labels of the substituted nodes. node_labels = [] for graph_id, graph in graphs.items(): -# print('graph_id: ', graph_id) -# print(self.__node_maps_from_median[graph_id]) - k = self.__get_node_image_from_map(self.__node_maps_from_median[graph_id], i) -# print('k: ', k) +# print('graph_id: ', graph_id) +# print(self.__node_maps_from_median[graph_id]) + k = self.__node_maps_from_median[graph_id].image(i) +# print('k: ', k) if k != np.inf: node_labels.append(graph.nodes[k]) # Compute the median label and update the median. if len(node_labels) > 0: -# median_label = self.__ged_env.get_median_node_label(node_labels) +# median_label = self.__ged_env.get_median_node_label(node_labels) median_label = self.__get_median_node_label(node_labels) if self.__ged_env.get_node_rel_cost(median.nodes[i], median_label) > self.__epsilon: nx.set_node_attributes(median, {i: median_label}) @@ -679,10 +774,10 @@ class MedianGraphEstimator(object): if self.__print_to_stdout == 2: print('edges ... ', end='') - # Clear the adjacency lists of the median and reset number of edges to 0. - median_edges = list(median.edges) - for (head, tail) in median_edges: - median.remove_edge(head, tail) +# # Clear the adjacency lists of the median and reset number of edges to 0. +# median_edges = list(median.edges) +# for (head, tail) in median_edges: +# median.remove_edge(head, tail) # @todo: what if edge is not labeled? # Iterate through all possible edges (i,j) of the median. @@ -692,8 +787,8 @@ class MedianGraphEstimator(object): # Collect the labels of the edges to which (i,j) is mapped by the node maps. edge_labels = [] for graph_id, graph in graphs.items(): - k = self.__get_node_image_from_map(self.__node_maps_from_median[graph_id], i) - l = self.__get_node_image_from_map(self.__node_maps_from_median[graph_id], j) + k = self.__node_maps_from_median[graph_id].image(i) + l = self.__node_maps_from_median[graph_id].image(j) if k != np.inf and l != np.inf: if graph.has_edge(k, l): edge_labels.append(graph.edges[(k, l)]) @@ -711,11 +806,13 @@ class MedianGraphEstimator(object): rel_cost += self.__ged_env.get_edge_rel_cost(median_label, edge_label) # Update the median. + if median.has_edge(i, j): + median.remove_edge(i, j) if rel_cost < (self.__edge_ins_cost + self.__edge_del_cost) * len(edge_labels) - self.__edge_del_cost * len(graphs): median.add_edge(i, j, **median_label) - else: - if median.has_edge(i, j): - median.remove_edge(i, j) +# else: +# if median.has_edge(i, j): +# median.remove_edge(i, j) def __update_node_maps(self): @@ -725,10 +822,12 @@ class MedianGraphEstimator(object): # Update the node maps. node_maps_were_modified = False - for graph_id in self.__node_maps_from_median: + for graph_id, node_map in self.__node_maps_from_median.items(): self.__ged_env.run_method(self.__median_id, graph_id) - if self.__ged_env.get_upper_bound(self.__median_id, graph_id) < self.__ged_env.get_induced_cost(self.__median_id, graph_id) - self.__epsilon: # @todo: see above. - self.__node_maps_from_median[graph_id] = self.__ged_env.get_node_map(self.__median_id, graph_id) # @todo: node_map may not assigned. + if self.__ged_env.get_upper_bound(self.__median_id, graph_id) < node_map.induced_cost() - self.__epsilon: +# xxx = self.__node_maps_from_median[graph_id] + self.__node_maps_from_median[graph_id] = self.__ged_env.get_node_map(self.__median_id, graph_id) +# yyy = self.__node_maps_from_median[graph_id] node_maps_were_modified = True # Print information about current iteration. if self.__print_to_stdout == 2: @@ -742,6 +841,406 @@ class MedianGraphEstimator(object): return node_maps_were_modified + def __decrease_order(self, graphs, median): + # Print information about current iteration + if self.__print_to_stdout == 2: + print('Trying to decrease order: ... ', end='') + + # Initialize ID of the node that is to be deleted. + id_deleted_node = [None] # @todo: or np.inf + decreased_order = False + + # Decrease the order as long as the best deletion delta is negative. + while self.__compute_best_deletion_delta(graphs, median, id_deleted_node) < -self.__epsilon: + decreased_order = True + median = self.__delete_node_from_median(id_deleted_node[0], median) + + # Print information about current iteration. + if self.__print_to_stdout == 2: + print('done.') + + # Return true iff the order was decreased. + return decreased_order + + + def __compute_best_deletion_delta(self, graphs, median, id_deleted_node): + best_delta = 0.0 + + # Determine node that should be deleted (if any). + for i in range(0, nx.number_of_nodes(median)): + # Compute cost delta. + delta = 0.0 + for graph_id, graph in graphs.items(): + k = self.__node_maps_from_median[graph_id].image(i) + if k == np.inf: + delta -= self.__node_del_cost + else: + delta += self.__node_ins_cost - self.__ged_env.get_node_rel_cost(median.nodes[i], graph.nodes[k]) + for j, j_label in median[i].items(): + l = self.__node_maps_from_median[graph_id].image(j) + if k == np.inf or l == np.inf: + delta -= self.__edge_del_cost + elif not graph.has_edge(k, l): + delta -= self.__edge_del_cost + else: + delta += self.__edge_ins_cost - self.__ged_env.get_edge_rel_cost(j_label, graph.edges[(k, l)]) + + # Update best deletion delta. + if delta < best_delta - self.__epsilon: + best_delta = delta + id_deleted_node[0] = i +# id_deleted_node[0] = 3 # @todo: + + return best_delta + + + def __delete_node_from_median(self, id_deleted_node, median): + # Update the median. + median.remove_node(id_deleted_node) + median = nx.convert_node_labels_to_integers(median, first_label=0, ordering='default', label_attribute=None) # @todo: This doesn't guarantee that the order is the same as in G. + + # Update the node maps. + for key, node_map in self.__node_maps_from_median.items(): + new_node_map = NodeMap(nx.number_of_nodes(median), node_map.num_target_nodes()) + is_unassigned_target_node = [True] * node_map.num_target_nodes() + for i in range(0, nx.number_of_nodes(median) + 1): + if i != id_deleted_node: + new_i = (i if i < id_deleted_node else i - 1) + k = node_map.image(i) + new_node_map.add_assignment(new_i, k) + if k != np.inf: + is_unassigned_target_node[k] = False + for k in range(0, node_map.num_target_nodes()): + if is_unassigned_target_node[k]: + new_node_map.add_assignment(np.inf, k) +# print(new_node_map.get_forward_map(), new_node_map.get_backward_map()) + self.__node_maps_from_median[key] = new_node_map + + # Increase overall number of decreases. + self.__num_decrease_order += 1 + + return median + + + def __increase_order(self, graphs, median): + # Print information about current iteration. + if self.__print_to_stdout == 2: + print('Trying to increase order: ... ', end='') + + # Initialize the best configuration and the best label of the node that is to be inserted. + best_config = {} + best_label = self.__ged_env.get_node_label(1) + increased_order = False + + # Increase the order as long as the best insertion delta is negative. + while self.__compute_best_insertion_delta(graphs, best_config, best_label) < - self.__epsilon: + increased_order = True + self.__add_node_to_median(best_config, best_label, median) + + # Print information about current iteration. + if self.__print_to_stdout == 2: + print('done.') + + # Return true iff the order was increased. + return increased_order + + + def __compute_best_insertion_delta(self, graphs, best_config, best_label): + # Construct sets of inserted nodes. + no_inserted_node = True + inserted_nodes = {} + for graph_id, graph in graphs.items(): + inserted_nodes[graph_id] = [] + best_config[graph_id] = np.inf + for k in range(nx.number_of_nodes(graph)): + if self.__node_maps_from_median[graph_id].pre_image(k) == np.inf: + no_inserted_node = False + inserted_nodes[graph_id].append((k, tuple(item for item in graph.nodes[k].items()))) # @todo: can order of label names be garantteed? + + # Return 0.0 if no node is inserted in any of the graphs. + if no_inserted_node: + return 0.0 + + # Compute insertion configuration, label, and delta. + best_delta = 0.0 # @todo + if len(self.__label_names['node_labels']) == 0 and len(self.__label_names['node_attrs']) == 0: # @todo + best_delta = self.__compute_insertion_delta_unlabeled(inserted_nodes, best_config, best_label) + elif len(self.__label_names['node_labels']) > 0: # self.__constant_node_costs: + best_delta = self.__compute_insertion_delta_constant(inserted_nodes, best_config, best_label) + else: + best_delta = self.__compute_insertion_delta_generic(inserted_nodes, best_config, best_label) + + # Return the best delta. + return best_delta + + + def __compute_insertion_delta_unlabeled(self, inserted_nodes, best_config, best_label): # @todo: go through and test. + # Construct the nest configuration and compute its insertion delta. + best_delta = 0.0 + best_config.clear() + for graph_id, node_set in inserted_nodes.items(): + if len(node_set) == 0: + best_config[graph_id] = np.inf + best_delta += self.__node_del_cost + else: + best_config[graph_id] = node_set[0][0] + best_delta -= self.__node_ins_cost + + # Return the best insertion delta. + return best_delta + + + def __compute_insertion_delta_constant(self, inserted_nodes, best_config, best_label): + # Construct histogram and inverse label maps. + hist = {} + inverse_label_maps = {} + for graph_id, node_set in inserted_nodes.items(): + inverse_label_maps[graph_id] = {} + for node in node_set: + k = node[0] + label = node[1] + if label not in inverse_label_maps[graph_id]: + inverse_label_maps[graph_id][label] = k + if label not in hist: + hist[label] = 1 + else: + hist[label] += 1 + + # Determine the best label. + best_count = 0 + for key, val in hist.items(): + if val > best_count: + best_count = val + best_label_tuple = key + + # get best label. + best_label.clear() + for key, val in best_label_tuple: + best_label[key] = val + + # Construct the best configuration and compute its insertion delta. + best_config.clear() + best_delta = 0.0 + node_rel_cost = self.__ged_env.get_node_rel_cost(self.__ged_env.get_node_label(1), self.__ged_env.get_node_label(2)) + triangle_ineq_holds = (node_rel_cost <= self.__node_del_cost + self.__node_ins_cost) + for graph_id, _ in inserted_nodes.items(): + if best_label_tuple in inverse_label_maps[graph_id]: + best_config[graph_id] = inverse_label_maps[graph_id][best_label_tuple] + best_delta -= self.__node_ins_cost + elif triangle_ineq_holds and not len(inserted_nodes[graph_id]) == 0: + best_config[graph_id] = inserted_nodes[graph_id][0][0] + best_delta += node_rel_cost - self.__node_ins_cost + else: + best_config[graph_id] = np.inf + best_delta += self.__node_del_cost + + # Return the best insertion delta. + return best_delta + + + def __compute_insertion_delta_generic(self, inserted_nodes, best_config, best_label): + # Collect all node labels of inserted nodes. + node_labels = [] + for _, node_set in inserted_nodes.items(): + for node in node_set: + node_labels.append(node[1]) + + # Compute node label medians that serve as initial solutions for block gradient descent. + initial_node_labels = [] + self.__compute_initial_node_labels(node_labels, initial_node_labels) + + # Determine best insertion configuration, label, and delta via parallel block gradient descent from all initial node labels. + best_delta = 0.0 + for node_label in initial_node_labels: + # Construct local configuration. + config = {} + for graph_id, _ in inserted_nodes.items(): + config[graph_id] = tuple((np.inf, tuple(item for item in self.__ged_env.get_node_label(1).items()))) + + # Run block gradient descent. + converged = False + itr = 0 + while not self.__insertion_termination_criterion_met(converged, itr): + converged = not self.__update_config(node_label, inserted_nodes, config, node_labels) + node_label_dict = dict(node_label) + converged = converged and (not self.__update_node_label([dict(item) for item in node_labels], node_label_dict)) # @todo: the dict is tupled again in the function, can be better. + node_label = tuple(item for item in node_label_dict.items()) # @todo: watch out: initial_node_labels[i] is not modified here. + + itr += 1 + + # Compute insertion delta of converged solution. + delta = 0.0 + for _, node in config.items(): + if node[0] == np.inf: + delta += self.__node_del_cost + else: + delta += self.__ged_env.get_node_rel_cost(dict(node_label), dict(node[1])) - self.__node_ins_cost + + # Update best delta and global configuration if improvement has been found. + if delta < best_delta - self.__epsilon: + best_delta = delta + best_label.clear() + for key, val in node_label: + best_label[key] = val + best_config.clear() + for graph_id, val in config.items(): + best_config[graph_id] = val[0] + + # Return the best delta. + return best_delta + + + def __compute_initial_node_labels(self, node_labels, median_labels): + median_labels.clear() + if self.__use_real_randomness: # @todo: may not work if parallelized. + rng = np.random.randint(0, high=2**32 - 1, size=1) + urng = np.random.RandomState(seed=rng[0]) + else: + urng = np.random.RandomState(seed=self.__seed) + + # Generate the initial node label medians. + if self.__init_type_increase_order == 'K-MEANS++': + # Use k-means++ heuristic to generate the initial node label medians. + already_selected = [False] * len(node_labels) + selected_label_id = urng.randint(low=0, high=len(node_labels), size=1)[0] # c++ test: 23 + median_labels.append(node_labels[selected_label_id]) + already_selected[selected_label_id] = True +# xxx = [41, 0, 18, 9, 6, 14, 21, 25, 33] for c++ test +# iii = 0 for c++ test + while len(median_labels) < self.__num_inits_increase_order: + weights = [np.inf] * len(node_labels) + for label_id in range(0, len(node_labels)): + if already_selected[label_id]: + weights[label_id] = 0 + continue + for label in median_labels: + weights[label_id] = min(weights[label_id], self.__ged_env.get_node_rel_cost(dict(label), dict(node_labels[label_id]))) + selected_label_id = urng.choice(range(0, len(weights)), size=1, p=np.array(weights) / np.sum(weights))[0] # for c++ test: xxx[iii] +# iii += 1 for c++ test + median_labels.append(node_labels[selected_label_id]) + already_selected[selected_label_id] = True + else: + # Compute the initial node medians as the medians of randomly generated clusters of (roughly) equal size. + # @todo: go through and test. + shuffled_node_labels = [np.inf] * len(node_labels) #@todo: random? + # @todo: std::shuffle(shuffled_node_labels.begin(), shuffled_node_labels.end(), urng);? + cluster_size = len(node_labels) / self.__num_inits_increase_order + pos = 0.0 + cluster = [] + while len(median_labels) < self.__num_inits_increase_order - 1: + while pos < (len(median_labels) + 1) * cluster_size: + cluster.append(shuffled_node_labels[pos]) + pos += 1 + median_labels.append(self.__get_median_node_label(cluster)) + cluster.clear() + while pos < len(shuffled_node_labels): + pos += 1 + cluster.append(shuffled_node_labels[pos]) + median_labels.append(self.__get_median_node_label(cluster)) + cluster.clear() + + # Run Lloyd's Algorithm. + converged = False + closest_median_ids = [np.inf] * len(node_labels) + clusters = [[] for _ in range(len(median_labels))] + itr = 1 + while not self.__insertion_termination_criterion_met(converged, itr): + converged = not self.__update_clusters(node_labels, median_labels, closest_median_ids) + if not converged: + for cluster in clusters: + cluster.clear() + for label_id in range(0, len(node_labels)): + clusters[closest_median_ids[label_id]].append(node_labels[label_id]) + for cluster_id in range(0, len(clusters)): + node_label = dict(median_labels[cluster_id]) + self.__update_node_label([dict(item) for item in clusters[cluster_id]], node_label) # @todo: the dict is tupled again in the function, can be better. + median_labels[cluster_id] = tuple(item for item in node_label.items()) + itr += 1 + + + def __insertion_termination_criterion_met(self, converged, itr): + return converged or (itr >= self.__max_itrs_increase_order if self.__max_itrs_increase_order > 0 else False) + + + def __update_config(self, node_label, inserted_nodes, config, node_labels): + # Determine the best configuration. + config_modified = False + for graph_id, node_set in inserted_nodes.items(): + best_assignment = config[graph_id] + best_cost = 0.0 + if best_assignment[0] == np.inf: + best_cost = self.__node_del_cost + else: + best_cost = self.__ged_env.get_node_rel_cost(dict(node_label), dict(best_assignment[1])) - self.__node_ins_cost + for node in node_set: + cost = self.__ged_env.get_node_rel_cost(dict(node_label), dict(node[1])) - self.__node_ins_cost + if cost < best_cost - self.__epsilon: + best_cost = cost + best_assignment = node + config_modified = True + if self.__node_del_cost < best_cost - self.__epsilon: + best_cost = self.__node_del_cost + best_assignment = tuple((np.inf, best_assignment[1])) + config_modified = True + config[graph_id] = best_assignment + + # Collect the node labels contained in the best configuration. + node_labels.clear() + for key, val in config.items(): + if val[0] != np.inf: + node_labels.append(val[1]) + + # Return true if the configuration was modified. + return config_modified + + + def __update_node_label(self, node_labels, node_label): + new_node_label = self.__get_median_node_label(node_labels) + if self.__ged_env.get_node_rel_cost(new_node_label, node_label) > self.__epsilon: + node_label.clear() + for key, val in new_node_label.items(): + node_label[key] = val + return True + return False + + + def __update_clusters(self, node_labels, median_labels, closest_median_ids): + # Determine the closest median for each node label. + clusters_modified = False + for label_id in range(0, len(node_labels)): + closest_median_id = np.inf + dist_to_closest_median = np.inf + for median_id in range(0, len(median_labels)): + dist_to_median = self.__ged_env.get_node_rel_cost(dict(median_labels[median_id]), dict(node_labels[label_id])) + if dist_to_median < dist_to_closest_median - self.__epsilon: + dist_to_closest_median = dist_to_median + closest_median_id = median_id + if closest_median_id != closest_median_ids[label_id]: + closest_median_ids[label_id] = closest_median_id + clusters_modified = True + + # Return true if the clusters were modified. + return clusters_modified + + + def __add_node_to_median(self, best_config, best_label, median): + # Update the median. + median.add_node(nx.number_of_nodes(median), **best_label) + + # Update the node maps. + for graph_id, node_map in self.__node_maps_from_median.items(): + node_map_as_rel = [] + node_map.as_relation(node_map_as_rel) + new_node_map = NodeMap(nx.number_of_nodes(median), node_map.num_target_nodes()) + for assignment in node_map_as_rel: + new_node_map.add_assignment(assignment[0], assignment[1]) + new_node_map.add_assignment(nx.number_of_nodes(median) - 1, best_config[graph_id]) + self.__node_maps_from_median[graph_id] = new_node_map + + # Increase overall number of increases. + self.__num_increase_order += 1 + + def __improve_sum_of_distances(self, timer): pass @@ -750,37 +1249,37 @@ class MedianGraphEstimator(object): return self.__median_id != np.inf - def __get_node_image_from_map(self, node_map, node): - """ - Return ID of the node mapping of `node` in `node_map`. +# def __get_node_image_from_map(self, node_map, node): +# """ +# Return ID of the node mapping of `node` in `node_map`. - Parameters - ---------- - node_map : list[tuple(int, int)] - List of node maps where the mapping node is found. - - node : int - The mapping node of this node is returned +# Parameters +# ---------- +# node_map : list[tuple(int, int)] +# List of node maps where the mapping node is found. +# +# node : int +# The mapping node of this node is returned - Raises - ------ - Exception - If the node with ID `node` is not contained in the source nodes of the node map. +# Raises +# ------ +# Exception +# If the node with ID `node` is not contained in the source nodes of the node map. - Returns - ------- - int - ID of the mapping of `node`. - - Notes - ----- - This function is not implemented in the `ged::MedianGraphEstimator` class of the `GEDLIB` library. Instead it is a Python implementation of the `ged::NodeMap::image` function. - """ - if node < len(node_map): - return node_map[node][1] if node_map[node][1] < len(node_map) else np.inf - else: - raise Exception('The node with ID ', str(node), ' is not contained in the source nodes of the node map.') - return np.inf +# Returns +# ------- +# int +# ID of the mapping of `node`. +# +# Notes +# ----- +# This function is not implemented in the `ged::MedianGraphEstimator` class of the `GEDLIB` library. Instead it is a Python implementation of the `ged::NodeMap::image` function. +# """ +# if node < len(node_map): +# return node_map[node][1] if node_map[node][1] < len(node_map) else np.inf +# else: +# raise Exception('The node with ID ', str(node), ' is not contained in the source nodes of the node map.') +# return np.inf def __are_graphs_equal(self, g1, g2): @@ -883,9 +1382,9 @@ class MedianGraphEstimator(object): for label in labels: coords = {} for key, val in label.items(): - label = float(val) - sums[key] += label - coords[key] = label + label_f = float(val) + sums[key] += label_f + coords[key] = label_f labels_as_coords.append(coords) median = {} for key, val in sums.items(): @@ -905,7 +1404,7 @@ class MedianGraphEstimator(object): norm = 0 for key, val in label_as_coord.items(): norm += (val - median[key]) ** 2 - norm += np.sqrt(norm) + norm = np.sqrt(norm) if norm > 0: for key, val in label_as_coord.items(): numerator[key] += val / norm @@ -930,64 +1429,64 @@ class MedianGraphEstimator(object): return median_label -# def __get_median_edge_label_symbolic(self, edge_labels): -# pass +# def __get_median_edge_label_symbolic(self, edge_labels): +# pass -# def __get_median_edge_label_nonsymbolic(self, edge_labels): -# if len(edge_labels) == 0: -# return {} -# else: -# # Transform the labels into coordinates and compute mean label as initial solution. -# edge_labels_as_coords = [] -# sums = {} -# for key, val in edge_labels[0].items(): -# sums[key] = 0 -# for edge_label in edge_labels: -# coords = {} -# for key, val in edge_label.items(): -# label = float(val) -# sums[key] += label -# coords[key] = label -# edge_labels_as_coords.append(coords) -# median = {} -# for key, val in sums.items(): -# median[key] = val / len(edge_labels) -# -# # Run main loop of Weiszfeld's Algorithm. -# epsilon = 0.0001 -# delta = 1.0 -# num_itrs = 0 -# all_equal = False -# while ((delta > epsilon) and (num_itrs < 100) and (not all_equal)): -# numerator = {} -# for key, val in sums.items(): -# numerator[key] = 0 -# denominator = 0 -# for edge_label_as_coord in edge_labels_as_coords: -# norm = 0 -# for key, val in edge_label_as_coord.items(): -# norm += (val - median[key]) ** 2 -# norm += np.sqrt(norm) -# if norm > 0: -# for key, val in edge_label_as_coord.items(): -# numerator[key] += val / norm -# denominator += 1.0 / norm -# if denominator == 0: -# all_equal = True -# else: -# new_median = {} -# delta = 0.0 -# for key, val in numerator.items(): -# this_median = val / denominator -# new_median[key] = this_median -# delta += np.abs(median[key] - this_median) -# median = new_median -# -# num_itrs += 1 -# -# # Transform the solution to ged::GXLLabel and return it. -# median_label = {} -# for key, val in median.items(): -# median_label[key] = str(val) -# return median_label \ No newline at end of file +# def __get_median_edge_label_nonsymbolic(self, edge_labels): +# if len(edge_labels) == 0: +# return {} +# else: +# # Transform the labels into coordinates and compute mean label as initial solution. +# edge_labels_as_coords = [] +# sums = {} +# for key, val in edge_labels[0].items(): +# sums[key] = 0 +# for edge_label in edge_labels: +# coords = {} +# for key, val in edge_label.items(): +# label = float(val) +# sums[key] += label +# coords[key] = label +# edge_labels_as_coords.append(coords) +# median = {} +# for key, val in sums.items(): +# median[key] = val / len(edge_labels) +# +# # Run main loop of Weiszfeld's Algorithm. +# epsilon = 0.0001 +# delta = 1.0 +# num_itrs = 0 +# all_equal = False +# while ((delta > epsilon) and (num_itrs < 100) and (not all_equal)): +# numerator = {} +# for key, val in sums.items(): +# numerator[key] = 0 +# denominator = 0 +# for edge_label_as_coord in edge_labels_as_coords: +# norm = 0 +# for key, val in edge_label_as_coord.items(): +# norm += (val - median[key]) ** 2 +# norm += np.sqrt(norm) +# if norm > 0: +# for key, val in edge_label_as_coord.items(): +# numerator[key] += val / norm +# denominator += 1.0 / norm +# if denominator == 0: +# all_equal = True +# else: +# new_median = {} +# delta = 0.0 +# for key, val in numerator.items(): +# this_median = val / denominator +# new_median[key] = this_median +# delta += np.abs(median[key] - this_median) +# median = new_median +# +# num_itrs += 1 +# +# # Transform the solution to ged::GXLLabel and return it. +# median_label = {} +# for key, val in median.items(): +# median_label[key] = str(val) +# return median_label \ No newline at end of file diff --git a/gklearn/ged/median/test_median_graph_estimator.py b/gklearn/ged/median/test_median_graph_estimator.py index bc4beae..7497bab 100644 --- a/gklearn/ged/median/test_median_graph_estimator.py +++ b/gklearn/ged/median/test_median_graph_estimator.py @@ -7,11 +7,10 @@ Created on Mon Mar 16 17:26:40 2020 """ def test_median_graph_estimator(): - from gklearn.utils.graphfiles import loadDataset + from gklearn.utils import load_dataset from gklearn.ged.median import MedianGraphEstimator, constant_node_costs from gklearn.gedlib import librariesImport, gedlibpy from gklearn.preimage.utils import get_same_item_indices - from gklearn.preimage.ged import convertGraph import multiprocessing # estimator parameters. @@ -22,17 +21,17 @@ def test_median_graph_estimator(): # algorithm parameters. algo = 'IPFP' - initial_solutions = 40 - algo_options_suffix = ' --initial-solutions ' + str(initial_solutions) + ' --ratio-runs-from-initial-solutions 1' + initial_solutions = 1 + algo_options_suffix = ' --initial-solutions ' + str(initial_solutions) + ' --ratio-runs-from-initial-solutions 1 --initialization-method NODE ' edit_cost_name = 'LETTER2' edit_cost_constants = [0.02987291, 0.0178211, 0.01431966, 0.001, 0.001] - ds_name = 'COIL-DEL' + ds_name = 'Letter_high' # Load dataset. # dataset = '../../datasets/COIL-DEL/COIL-DEL_A.txt' dataset = '../../../datasets/Letter-high/Letter-high_A.txt' - Gn, y_all = loadDataset(dataset) + Gn, y_all, label_names = load_dataset(dataset) y_idx = get_same_item_indices(y_all) for i, (y, values) in enumerate(y_idx.items()): Gn_i = [Gn[val] for val in values] @@ -43,7 +42,7 @@ def test_median_graph_estimator(): # gedlibpy.restart_env() ged_env.set_edit_cost(edit_cost_name, edit_cost_constant=edit_cost_constants) for G in Gn_i: - ged_env.add_nx_graph(convertGraph(G, edit_cost_name), '') + ged_env.add_nx_graph(G, '') graph_ids = ged_env.get_all_graph_ids() set_median_id = ged_env.add_graph('set_median') gen_median_id = ged_env.add_graph('gen_median') @@ -54,11 +53,89 @@ def test_median_graph_estimator(): mge.set_refine_method(algo, '--threads ' + str(threads) + ' --initial-solutions ' + str(initial_solutions) + ' --ratio-runs-from-initial-solutions 1') mge_options = '--time-limit ' + str(time_limit) + ' --stdout 2 --init-type ' + init_type - mge_options += ' --random-inits ' + str(num_inits) + ' --seed ' + '1' + ' --refine FALSE'# @todo: std::to_string(rng()) + mge_options += ' --random-inits ' + str(num_inits) + ' --seed ' + '1' + ' --update-order TRUE --refine FALSE --randomness PSEUDO '# @todo: std::to_string(rng()) # Select the GED algorithm. algo_options = '--threads ' + str(threads) + algo_options_suffix mge.set_options(mge_options) + mge.set_label_names(node_labels=label_names['node_labels'], + edge_labels=label_names['edge_labels'], + node_attrs=label_names['node_attrs'], + edge_attrs=label_names['edge_attrs']) + mge.set_init_method(algo, algo_options) + mge.set_descent_method(algo, algo_options) + + # Run the estimator. + mge.run(graph_ids, set_median_id, gen_median_id) + + # Get SODs. + sod_sm = mge.get_sum_of_distances('initialized') + sod_gm = mge.get_sum_of_distances('converged') + print('sod_sm, sod_gm: ', sod_sm, sod_gm) + + # Get median graphs. + set_median = ged_env.get_nx_graph(set_median_id) + gen_median = ged_env.get_nx_graph(gen_median_id) + + return set_median, gen_median + + +def test_median_graph_estimator_symb(): + from gklearn.utils import load_dataset + from gklearn.ged.median import MedianGraphEstimator, constant_node_costs + from gklearn.gedlib import librariesImport, gedlibpy + from gklearn.preimage.utils import get_same_item_indices + import multiprocessing + + # estimator parameters. + init_type = 'MEDOID' + num_inits = 1 + threads = multiprocessing.cpu_count() + time_limit = 60000 + + # algorithm parameters. + algo = 'IPFP' + initial_solutions = 1 + algo_options_suffix = ' --initial-solutions ' + str(initial_solutions) + ' --ratio-runs-from-initial-solutions 1 --initialization-method NODE ' + + edit_cost_name = 'CONSTANT' + edit_cost_constants = [4, 4, 2, 1, 1, 1] + ds_name = 'MUTAG' + + # Load dataset. + dataset = '../../../datasets/MUTAG/MUTAG_A.txt' + Gn, y_all, label_names = load_dataset(dataset) + y_idx = get_same_item_indices(y_all) + for i, (y, values) in enumerate(y_idx.items()): + Gn_i = [Gn[val] for val in values] + break + Gn_i = Gn_i[0:10] + + # Set up the environment. + ged_env = gedlibpy.GEDEnv() + # gedlibpy.restart_env() + ged_env.set_edit_cost(edit_cost_name, edit_cost_constant=edit_cost_constants) + for G in Gn_i: + ged_env.add_nx_graph(G, '') + graph_ids = ged_env.get_all_graph_ids() + set_median_id = ged_env.add_graph('set_median') + gen_median_id = ged_env.add_graph('gen_median') + ged_env.init(init_option='EAGER_WITHOUT_SHUFFLED_COPIES') + + # Set up the estimator. + mge = MedianGraphEstimator(ged_env, constant_node_costs(edit_cost_name)) + mge.set_refine_method(algo, '--threads ' + str(threads) + ' --initial-solutions ' + str(initial_solutions) + ' --ratio-runs-from-initial-solutions 1') + + mge_options = '--time-limit ' + str(time_limit) + ' --stdout 2 --init-type ' + init_type + mge_options += ' --random-inits ' + str(num_inits) + ' --seed ' + '1' + ' --update-order TRUE --refine FALSE'# @todo: std::to_string(rng()) + + # Select the GED algorithm. + algo_options = '--threads ' + str(threads) + algo_options_suffix + mge.set_options(mge_options) + mge.set_label_names(node_labels=label_names['node_labels'], + edge_labels=label_names['edge_labels'], + node_attrs=label_names['node_attrs'], + edge_attrs=label_names['edge_attrs']) mge.set_init_method(algo, algo_options) mge.set_descent_method(algo, algo_options) @@ -78,4 +155,5 @@ def test_median_graph_estimator(): if __name__ == '__main__': - set_median, gen_median = test_median_graph_estimator() \ No newline at end of file + set_median, gen_median = test_median_graph_estimator() + # set_median, gen_median = test_median_graph_estimator_symb() \ No newline at end of file diff --git a/gklearn/ged/median/utils.py b/gklearn/ged/median/utils.py index f6d43bb..908cb11 100644 --- a/gklearn/ged/median/utils.py +++ b/gklearn/ged/median/utils.py @@ -30,6 +30,8 @@ def mge_options_to_string(options): opt_str += '--randomness ' + str(val) + ' ' elif key == 'verbose': opt_str += '--stdout ' + str(val) + ' ' + elif key == 'update_order': + opt_str += '--update-order ' + ('TRUE' if val else 'FALSE') + ' ' elif key == 'refine': opt_str += '--refine ' + ('TRUE' if val else 'FALSE') + ' ' elif key == 'time_limit': diff --git a/gklearn/gedlib/gedlibpy.cpp b/gklearn/gedlib/gedlibpy.cpp index 3766a46..58aa1fd 100644 --- a/gklearn/gedlib/gedlibpy.cpp +++ b/gklearn/gedlib/gedlibpy.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.15 */ +/* Generated by Cython 0.29.16 */ /* BEGIN: Cython Metadata { @@ -52,8 +52,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_15" -#define CYTHON_HEX_VERSION 0x001D0FF0 +#define CYTHON_ABI "0_29_16" +#define CYTHON_HEX_VERSION 0x001D10F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -543,8 +543,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif +#endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) @@ -906,7 +908,7 @@ static const char *__pyx_f[] = { "complex.pxd", }; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -915,7 +917,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -924,7 +926,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -933,7 +935,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -942,7 +944,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -951,7 +953,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -960,7 +962,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -969,7 +971,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -978,7 +980,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -987,7 +989,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -996,7 +998,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1005,7 +1007,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1014,7 +1016,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1023,7 +1025,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1032,7 +1034,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1041,7 +1043,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1050,7 +1052,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1059,7 +1061,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1068,7 +1070,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1077,7 +1079,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1086,7 +1088,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1097,8 +1099,8 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /* "gedlibpy.pyx":39 * #Long unsigned int equivalent - * cimport numpy as np - * ctypedef np.npy_uint32 UINT32_t # <<<<<<<<<<<<<< + * cimport numpy as cnp + * ctypedef cnp.npy_uint32 UINT32_t # <<<<<<<<<<<<<< * from cpython cimport array * */ @@ -1135,7 +1137,7 @@ typedef struct arrayobject arrayobject; #endif struct __pyx_obj_8gedlibpy_GEDEnv; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1144,7 +1146,7 @@ struct __pyx_obj_8gedlibpy_GEDEnv; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1153,7 +1155,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1162,7 +1164,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1171,7 +1173,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "gedlibpy.pyx":178 +/* "gedlibpy.pyx":180 * * * cdef class GEDEnv: # <<<<<<<<<<<<<< @@ -1540,6 +1542,14 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) @@ -1626,6 +1636,9 @@ static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); @@ -1666,6 +1679,7 @@ typedef struct { PyObject *func_classobj; void *defaults; int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2167,13 +2181,16 @@ static std::vector > __pyx_convert_vector_from_py_std_3a__3 static PyObject *__pyx_convert_vector_to_py_double(const std::vector &); /*proto*/ static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector > &); /*proto*/ static std::vector > __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(PyObject *); /*proto*/ +static std::pair __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *); /*proto*/ +static std::vector > __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "gedlibpy" extern int __pyx_module_is_main_gedlibpy; int __pyx_module_is_main_gedlibpy = 0; /* Implementation of 'gedlibpy' */ -static PyObject *__pyx_builtin_print; static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_print; +static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; @@ -2185,10 +2202,12 @@ static const char __pyx_k_h[] = "h"; static const char __pyx_k_g1[] = "g1"; static const char __pyx_k_g2[] = "g2"; static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; static const char __pyx_k_nx[] = "nx"; static const char __pyx_k_os[] = "os"; static const char __pyx_k__20[] = "*"; static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_inf[] = "inf"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_res[] = "res"; static const char __pyx_k_cdll[] = "cdll"; @@ -2215,6 +2234,7 @@ static const char __pyx_k_items[] = "items"; static const char __pyx_k_map_b[] = "map_b"; static const char __pyx_k_map_u[] = "map_u"; static const char __pyx_k_nodes[] = "nodes"; +static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_print[] = "print"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_utf_8[] = "utf-8"; @@ -2231,6 +2251,7 @@ static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_option[] = "option"; static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_NodeMap[] = "NodeMap"; static const char __pyx_k_classes[] = "classes"; static const char __pyx_k_dataset[] = "dataset"; static const char __pyx_k_dirname[] = "dirname"; @@ -2244,6 +2265,7 @@ static const char __pyx_k_gedlibpy[] = "gedlibpy"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_graph_id[] = "graph_id"; static const char __pyx_k_networkx[] = "networkx"; +static const char __pyx_k_node_map[] = "node_map"; static const char __pyx_k_nx_graph[] = "nx_graph"; static const char __pyx_k_path_XML[] = "path_XML"; static const char __pyx_k_qualname[] = "__qualname__"; @@ -2256,6 +2278,7 @@ static const char __pyx_k_adj_lists[] = "adj_lists"; static const char __pyx_k_edge_list[] = "edge_list"; static const char __pyx_k_edge_type[] = "edge_type"; static const char __pyx_k_edit_cost[] = "edit_cost"; +static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_graph_ids[] = "graph_ids"; static const char __pyx_k_iteritems[] = "iteritems"; static const char __pyx_k_map_edges[] = "map_edges"; @@ -2274,6 +2297,7 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_LoadLibrary[] = "LoadLibrary"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_MethodError[] = "MethodError"; +static const char __pyx_k_as_relation[] = "as_relation"; static const char __pyx_k_clear_graph[] = "clear_graph"; static const char __pyx_k_graph_class[] = "graph_class"; static const char __pyx_k_init_method[] = "init_method"; @@ -2296,18 +2320,21 @@ static const char __pyx_k_list_of_edges[] = "list_of_edges"; static const char __pyx_k_list_of_nodes[] = "list_of_nodes"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_set_edit_cost[] = "set_edit_cost"; +static const char __pyx_k_add_assignment[] = "add_assignment"; static const char __pyx_k_get_dummy_node[] = "get_dummy_node"; static const char __pyx_k_is_initialized[] = "is_initialized"; static const char __pyx_k_decode_your_map[] = "decode_your_map"; static const char __pyx_k_encode_your_map[] = "encode_your_map"; static const char __pyx_k_get_graph_edges[] = "get_graph_edges"; static const char __pyx_k_get_upper_bound[] = "get_upper_bound"; +static const char __pyx_k_gklearn_ged_env[] = "gklearn.ged.env"; static const char __pyx_k_load_GXL_graphs[] = "load_GXL_graphs"; static const char __pyx_k_print_to_stdout[] = "print_to_stdout"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_InitError___init[] = "InitError.__init__"; static const char __pyx_k_Number_of_graphs[] = "Number of graphs = "; static const char __pyx_k_get_init_options[] = "get_init_options"; +static const char __pyx_k_set_induced_cost[] = "set_induced_cost"; static const char __pyx_k_ignore_duplicates[] = "ignore_duplicates"; static const char __pyx_k_original_node_ids[] = "original_node_ids"; static const char __pyx_k_MethodError___init[] = "MethodError.__init__"; @@ -2380,6 +2407,7 @@ static PyObject *__pyx_kp_u_Loading_graphs_in_progress; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_s_MethodError; static PyObject *__pyx_n_s_MethodError___init; +static PyObject *__pyx_n_s_NodeMap; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_kp_u_Number_of_graphs; static PyObject *__pyx_kp_u_Please_don_t_restart_the_environ; @@ -2390,12 +2418,14 @@ static PyObject *__pyx_kp_u_This_method_doesn_t_exist_please; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s__20; +static PyObject *__pyx_n_s_add_assignment; static PyObject *__pyx_n_s_add_edge; static PyObject *__pyx_n_s_add_graph; static PyObject *__pyx_n_s_add_node; static PyObject *__pyx_n_s_add_nx_graph; static PyObject *__pyx_n_s_adj_lists; static PyObject *__pyx_n_s_adj_matrix; +static PyObject *__pyx_n_s_as_relation; static PyObject *__pyx_n_s_cdll; static PyObject *__pyx_n_s_classe; static PyObject *__pyx_n_s_classes; @@ -2419,6 +2449,7 @@ static PyObject *__pyx_n_s_edit_cost; static PyObject *__pyx_n_s_edit_cost_constant; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_encode_your_map; +static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_g1; @@ -2438,6 +2469,7 @@ static PyObject *__pyx_n_s_get_node_map; static PyObject *__pyx_n_s_get_original_node_ids; static PyObject *__pyx_n_s_get_upper_bound; static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_n_s_gklearn_ged_env; static PyObject *__pyx_n_s_graph; static PyObject *__pyx_n_s_graph_class; static PyObject *__pyx_n_s_graph_id; @@ -2449,6 +2481,7 @@ static PyObject *__pyx_n_s_head; static PyObject *__pyx_n_u_id; static PyObject *__pyx_n_s_ignore_duplicates; static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_inf; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_init_method; @@ -2490,8 +2523,11 @@ static PyObject *__pyx_n_s_node_id; static PyObject *__pyx_n_s_node_label; static PyObject *__pyx_n_s_node_label_1; static PyObject *__pyx_n_s_node_label_2; +static PyObject *__pyx_n_s_node_map; static PyObject *__pyx_n_s_node_type; static PyObject *__pyx_n_s_nodes; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_nx; @@ -2517,6 +2553,7 @@ static PyObject *__pyx_n_s_restart_env; static PyObject *__pyx_n_s_run_method; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_edit_cost; +static PyObject *__pyx_n_s_set_induced_cost; static PyObject *__pyx_n_s_set_method; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; @@ -2593,7 +2630,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, CYTHON_UNUSED PyObject *__pyx_v_adj_matrix, CYTHON_UNUSED PyObject *__pyx_v_adj_lists, CYTHON_UNUSED PyObject *__pyx_v_edge_list); /* proto */ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_nx_graph, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_graph_name, PyObject *__pyx_v_graph_class); /* proto */ -static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id); /* proto */ +static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id, PyObject *__pyx_v_node_map); /* proto */ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ @@ -2608,6 +2645,7 @@ static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_se static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; static PyObject *__pyx_k__2; static PyObject *__pyx_k__3; static PyObject *__pyx_tuple__4; @@ -2647,7 +2685,7 @@ static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; /* Late includes */ -/* "gedlibpy.pyx":126 +/* "gedlibpy.pyx":128 * * * def get_edit_cost_options() : # <<<<<<<<<<<<<< @@ -2682,7 +2720,7 @@ static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_edit_cost_options", 0); - /* "gedlibpy.pyx":137 + /* "gedlibpy.pyx":139 * """ * * return [option.decode('utf-8') for option in getEditCostStringOptions()] # <<<<<<<<<<<<<< @@ -2691,13 +2729,13 @@ static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); try { __pyx_t_2 = pyged::getEditCostStringOptions(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 137, __pyx_L1_error) + __PYX_ERR(0, 139, __pyx_L1_error) } __pyx_t_4 = &__pyx_t_2; __pyx_t_3 = __pyx_t_4->begin(); @@ -2706,9 +2744,9 @@ static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject __pyx_t_5 = *__pyx_t_3; ++__pyx_t_3; __pyx_7genexpr__pyx_v_option = __pyx_t_5; - __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_7genexpr__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_7genexpr__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ @@ -2716,7 +2754,7 @@ static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":126 + /* "gedlibpy.pyx":128 * * * def get_edit_cost_options() : # <<<<<<<<<<<<<< @@ -2736,7 +2774,7 @@ static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject return __pyx_r; } -/* "gedlibpy.pyx":140 +/* "gedlibpy.pyx":142 * * * def get_method_options() : # <<<<<<<<<<<<<< @@ -2771,7 +2809,7 @@ static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject * PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_method_options", 0); - /* "gedlibpy.pyx":150 + /* "gedlibpy.pyx":152 * .. note:: Prefer the list_of_method_options attribute of this module. * """ * return [option.decode('utf-8') for option in getMethodStringOptions()] # <<<<<<<<<<<<<< @@ -2780,13 +2818,13 @@ static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); try { __pyx_t_2 = pyged::getMethodStringOptions(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 150, __pyx_L1_error) + __PYX_ERR(0, 152, __pyx_L1_error) } __pyx_t_4 = &__pyx_t_2; __pyx_t_3 = __pyx_t_4->begin(); @@ -2795,9 +2833,9 @@ static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject * __pyx_t_5 = *__pyx_t_3; ++__pyx_t_3; __pyx_8genexpr1__pyx_v_option = __pyx_t_5; - __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr1__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr1__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ @@ -2805,7 +2843,7 @@ static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":140 + /* "gedlibpy.pyx":142 * * * def get_method_options() : # <<<<<<<<<<<<<< @@ -2825,7 +2863,7 @@ static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "gedlibpy.pyx":153 +/* "gedlibpy.pyx":155 * * * def get_init_options() : # <<<<<<<<<<<<<< @@ -2860,7 +2898,7 @@ static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_init_options", 0); - /* "gedlibpy.pyx":163 + /* "gedlibpy.pyx":165 * .. note:: Prefer the list_of_init_options attribute of this module. * """ * return [option.decode('utf-8') for option in getInitStringOptions()] # <<<<<<<<<<<<<< @@ -2869,13 +2907,13 @@ static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__ */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); try { __pyx_t_2 = pyged::getInitStringOptions(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 163, __pyx_L1_error) + __PYX_ERR(0, 165, __pyx_L1_error) } __pyx_t_4 = &__pyx_t_2; __pyx_t_3 = __pyx_t_4->begin(); @@ -2884,9 +2922,9 @@ static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__ __pyx_t_5 = *__pyx_t_3; ++__pyx_t_3; __pyx_8genexpr2__pyx_v_option = __pyx_t_5; - __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr2__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr2__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ @@ -2894,7 +2932,7 @@ static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":153 + /* "gedlibpy.pyx":155 * * * def get_init_options() : # <<<<<<<<<<<<<< @@ -2914,7 +2952,7 @@ static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "gedlibpy.pyx":166 +/* "gedlibpy.pyx":168 * * * def get_dummy_node() : # <<<<<<<<<<<<<< @@ -2944,7 +2982,7 @@ static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__py PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_dummy_node", 0); - /* "gedlibpy.pyx":175 + /* "gedlibpy.pyx":177 * .. note:: A dummy node is used when a node isn't associated to an other node. * """ * return getDummyNode() # <<<<<<<<<<<<<< @@ -2956,15 +2994,15 @@ static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__py __pyx_t_1 = pyged::getDummyNode(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 175, __pyx_L1_error) + __PYX_ERR(0, 177, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":166 + /* "gedlibpy.pyx":168 * * * def get_dummy_node() : # <<<<<<<<<<<<<< @@ -2983,7 +3021,7 @@ static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "gedlibpy.pyx":185 +/* "gedlibpy.pyx":187 * * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -3013,7 +3051,7 @@ static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEn pyged::PyGEDEnv *__pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "gedlibpy.pyx":186 + /* "gedlibpy.pyx":188 * * def __cinit__(self): * self.c_env = new PyGEDEnv() # <<<<<<<<<<<<<< @@ -3024,11 +3062,11 @@ static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEn __pyx_t_1 = new pyged::PyGEDEnv(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 186, __pyx_L1_error) + __PYX_ERR(0, 188, __pyx_L1_error) } __pyx_v_self->c_env = __pyx_t_1; - /* "gedlibpy.pyx":185 + /* "gedlibpy.pyx":187 * * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -3047,7 +3085,7 @@ static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEn return __pyx_r; } -/* "gedlibpy.pyx":189 +/* "gedlibpy.pyx":191 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3070,7 +3108,7 @@ static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_G __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "gedlibpy.pyx":190 + /* "gedlibpy.pyx":192 * * def __dealloc__(self): * del self.c_env # <<<<<<<<<<<<<< @@ -3079,7 +3117,7 @@ static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_G */ delete __pyx_v_self->c_env; - /* "gedlibpy.pyx":189 + /* "gedlibpy.pyx":191 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3091,7 +3129,7 @@ static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_G __Pyx_RefNannyFinishContext(); } -/* "gedlibpy.pyx":193 +/* "gedlibpy.pyx":195 * * * def is_initialized(self) : # <<<<<<<<<<<<<< @@ -3120,7 +3158,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8ge PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("is_initialized", 0); - /* "gedlibpy.pyx":202 + /* "gedlibpy.pyx":204 * .. note:: This function exists for internals verifications but you can use it for your code. * """ * return self.c_env.isInitialized() # <<<<<<<<<<<<<< @@ -3132,15 +3170,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8ge __pyx_t_1 = __pyx_v_self->c_env->isInitialized(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 202, __pyx_L1_error) + __PYX_ERR(0, 204, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":193 + /* "gedlibpy.pyx":195 * * * def is_initialized(self) : # <<<<<<<<<<<<<< @@ -3159,7 +3197,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8ge return __pyx_r; } -/* "gedlibpy.pyx":205 +/* "gedlibpy.pyx":207 * * * def restart_env(self) : # <<<<<<<<<<<<<< @@ -3186,7 +3224,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedli __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restart_env", 0); - /* "gedlibpy.pyx":212 + /* "gedlibpy.pyx":214 * .. note:: You can now delete and add somes graphs after initialization so you can avoid this function. * """ * self.c_env.restartEnv() # <<<<<<<<<<<<<< @@ -3197,10 +3235,10 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedli __pyx_v_self->c_env->restartEnv(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 212, __pyx_L1_error) + __PYX_ERR(0, 214, __pyx_L1_error) } - /* "gedlibpy.pyx":205 + /* "gedlibpy.pyx":207 * * * def restart_env(self) : # <<<<<<<<<<<<<< @@ -3220,7 +3258,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedli return __pyx_r; } -/* "gedlibpy.pyx":215 +/* "gedlibpy.pyx":217 * * * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<< @@ -3266,23 +3304,23 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 217, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 217, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 217, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 217, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3299,7 +3337,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3324,14 +3362,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8g bool __pyx_t_7; __Pyx_RefNannySetupContext("load_GXL_graphs", 0); - /* "gedlibpy.pyx":231 + /* "gedlibpy.pyx":233 * .. note:: You can call this function multiple times if you want, but not after an init call. * """ * self.c_env.loadGXLGraph(path_folder.encode('utf-8'), path_XML.encode('utf-8'), node_type, edge_type) # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_folder, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_folder, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3345,12 +3383,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8g } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_XML, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_XML, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3364,21 +3402,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8g } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_node_type); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_edge_type); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_node_type); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_edge_type); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error) try { __pyx_v_self->c_env->loadGXLGraph(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) } - /* "gedlibpy.pyx":215 + /* "gedlibpy.pyx":217 * * * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<< @@ -3401,7 +3439,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":234 +/* "gedlibpy.pyx":236 * * * def graph_ids(self) : # <<<<<<<<<<<<<< @@ -3430,7 +3468,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlib PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("graph_ids", 0); - /* "gedlibpy.pyx":243 + /* "gedlibpy.pyx":245 * .. note:: Prefer this function if you have huges structures with lots of graphs. * """ * return self.c_env.getGraphIds() # <<<<<<<<<<<<<< @@ -3442,15 +3480,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlib __pyx_t_1 = __pyx_v_self->c_env->getGraphIds(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 245, __pyx_L1_error) } - __pyx_t_2 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_2 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":234 + /* "gedlibpy.pyx":236 * * * def graph_ids(self) : # <<<<<<<<<<<<<< @@ -3469,7 +3507,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlib return __pyx_r; } -/* "gedlibpy.pyx":246 +/* "gedlibpy.pyx":248 * * * def get_all_graph_ids(self) : # <<<<<<<<<<<<<< @@ -3498,7 +3536,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_all_graph_ids", 0); - /* "gedlibpy.pyx":255 + /* "gedlibpy.pyx":257 * .. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order. * """ * return self.c_env.getAllGraphIds() # <<<<<<<<<<<<<< @@ -3510,15 +3548,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj __pyx_t_1 = __pyx_v_self->c_env->getAllGraphIds(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 255, __pyx_L1_error) + __PYX_ERR(0, 257, __pyx_L1_error) } - __pyx_t_2 = __pyx_convert_vector_to_py_size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_2 = __pyx_convert_vector_to_py_size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":246 + /* "gedlibpy.pyx":248 * * * def get_all_graph_ids(self) : # <<<<<<<<<<<<<< @@ -3537,7 +3575,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj return __pyx_r; } -/* "gedlibpy.pyx":258 +/* "gedlibpy.pyx":260 * * * def get_graph_class(self, id) : # <<<<<<<<<<<<<< @@ -3567,7 +3605,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_class", 0); - /* "gedlibpy.pyx":270 + /* "gedlibpy.pyx":272 * .. note:: An empty string can be a class. * """ * return self.c_env.getGraphClass(id) # <<<<<<<<<<<<<< @@ -3575,20 +3613,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphClass(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 270, __pyx_L1_error) + __PYX_ERR(0, 272, __pyx_L1_error) } - __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":258 + /* "gedlibpy.pyx":260 * * * def get_graph_class(self, id) : # <<<<<<<<<<<<<< @@ -3607,7 +3645,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":273 +/* "gedlibpy.pyx":275 * * * def get_graph_name(self, id) : # <<<<<<<<<<<<<< @@ -3637,7 +3675,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8g PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_name", 0); - /* "gedlibpy.pyx":285 + /* "gedlibpy.pyx":287 * .. note:: An empty string can be a name. * """ * return self.c_env.getGraphName(id).decode('utf-8') # <<<<<<<<<<<<<< @@ -3645,20 +3683,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8g * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphName(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 285, __pyx_L1_error) + __PYX_ERR(0, 287, __pyx_L1_error) } - __pyx_t_3 = __Pyx_decode_cpp_string(__pyx_t_2, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_cpp_string(__pyx_t_2, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":273 + /* "gedlibpy.pyx":275 * * * def get_graph_name(self, id) : # <<<<<<<<<<<<<< @@ -3677,7 +3715,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":288 +/* "gedlibpy.pyx":290 * * * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<< @@ -3725,7 +3763,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 288, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3742,7 +3780,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3766,7 +3804,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlib size_t __pyx_t_6; __Pyx_RefNannySetupContext("add_graph", 0); - /* "gedlibpy.pyx":302 + /* "gedlibpy.pyx":304 * .. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications. * """ * return self.c_env.addGraph(name.encode('utf-8'), classe.encode('utf-8')) # <<<<<<<<<<<<<< @@ -3774,7 +3812,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlib * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3788,12 +3826,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlib } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_classe, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_classe, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3807,24 +3845,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlib } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_6 = __pyx_v_self->c_env->addGraph(__pyx_t_4, __pyx_t_5); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 304, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":288 + /* "gedlibpy.pyx":290 * * * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<< @@ -3845,7 +3883,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlib return __pyx_r; } -/* "gedlibpy.pyx":305 +/* "gedlibpy.pyx":307 * * * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<< @@ -3888,17 +3926,17 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 305, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 307, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 305, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 307, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 305, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 307, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3913,7 +3951,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 305, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3937,15 +3975,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibp std::map __pyx_t_6; __Pyx_RefNannySetupContext("add_node", 0); - /* "gedlibpy.pyx":319 + /* "gedlibpy.pyx":321 * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. * """ * self.c_env.addNode(graph_id, node_id.encode('utf-8'), encode_your_map(node_label)) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -3959,12 +3997,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3978,19 +4016,19 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_node_label); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { __pyx_v_self->c_env->addNode(__pyx_t_1, __pyx_t_5, __pyx_t_6); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 321, __pyx_L1_error) } - /* "gedlibpy.pyx":305 + /* "gedlibpy.pyx":307 * * * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<< @@ -4013,7 +4051,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibp return __pyx_r; } -/* "gedlibpy.pyx":322 +/* "gedlibpy.pyx":324 * * * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -4063,19 +4101,19 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -4085,7 +4123,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 322, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 324, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4107,7 +4145,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4133,15 +4171,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibp bool __pyx_t_8; __Pyx_RefNannySetupContext("add_edge", 0); - /* "gedlibpy.pyx":340 + /* "gedlibpy.pyx":342 * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. * """ * self.c_env.addEdge(graph_id, tail.encode('utf-8'), head.encode('utf-8'), encode_your_map(edge_label), ignore_duplicates) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -4155,12 +4193,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -4174,12 +4212,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -4193,20 +4231,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_edge_label); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_duplicates); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_duplicates); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) try { __pyx_v_self->c_env->addEdge(__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 340, __pyx_L1_error) + __PYX_ERR(0, 342, __pyx_L1_error) } - /* "gedlibpy.pyx":322 + /* "gedlibpy.pyx":324 * * * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -4229,7 +4267,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibp return __pyx_r; } -/* "gedlibpy.pyx":343 +/* "gedlibpy.pyx":345 * * * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<< @@ -4275,23 +4313,23 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 343, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 345, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 343, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 345, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 343, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 345, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 345, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4308,7 +4346,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4336,14 +4374,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_ std::map __pyx_t_7; __Pyx_RefNannySetupContext("add_symmetrical_edge", 0); - /* "gedlibpy.pyx":359 + /* "gedlibpy.pyx":361 * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. * """ * tailB = tail.encode('utf-8') # <<<<<<<<<<<<<< * headB = head.encode('utf-8') * edgeLabelB = encode_your_map(edge_label) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4357,20 +4395,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tailB = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":360 + /* "gedlibpy.pyx":362 * """ * tailB = tail.encode('utf-8') * headB = head.encode('utf-8') # <<<<<<<<<<<<<< * edgeLabelB = encode_your_map(edge_label) * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4384,20 +4422,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_headB = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":361 + /* "gedlibpy.pyx":363 * tailB = tail.encode('utf-8') * headB = head.encode('utf-8') * edgeLabelB = encode_your_map(edge_label) # <<<<<<<<<<<<<< * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -4411,49 +4449,49 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_edgeLabelB = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":362 + /* "gedlibpy.pyx":364 * headB = head.encode('utf-8') * edgeLabelB = encode_your_map(edge_label) * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) # <<<<<<<<<<<<<< * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) * */ - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error) - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error) - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error) - __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) try { __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, 1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 362, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } - /* "gedlibpy.pyx":363 + /* "gedlibpy.pyx":365 * edgeLabelB = encode_your_map(edge_label) * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) - __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) try { __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_t_7, 1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 363, __pyx_L1_error) + __PYX_ERR(0, 365, __pyx_L1_error) } - /* "gedlibpy.pyx":343 + /* "gedlibpy.pyx":345 * * * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<< @@ -4479,7 +4517,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_ return __pyx_r; } -/* "gedlibpy.pyx":366 +/* "gedlibpy.pyx":368 * * * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<< @@ -4507,22 +4545,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedl size_t __pyx_t_1; __Pyx_RefNannySetupContext("clear_graph", 0); - /* "gedlibpy.pyx":375 + /* "gedlibpy.pyx":377 * .. note:: Call init() after you're finished your modifications. * """ * self.c_env.clearGraph(graph_id) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) try { __pyx_v_self->c_env->clearGraph(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 375, __pyx_L1_error) + __PYX_ERR(0, 377, __pyx_L1_error) } - /* "gedlibpy.pyx":366 + /* "gedlibpy.pyx":368 * * * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<< @@ -4542,7 +4580,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedl return __pyx_r; } -/* "gedlibpy.pyx":378 +/* "gedlibpy.pyx":380 * * * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<< @@ -4572,7 +4610,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_internal_id", 0); - /* "gedlibpy.pyx":390 + /* "gedlibpy.pyx":392 * .. note:: These functions allow to collect all the graph's informations. * """ * return self.c_env.getGraphInternalId(graph_id) # <<<<<<<<<<<<<< @@ -4580,20 +4618,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphInternalId(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 390, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":378 + /* "gedlibpy.pyx":380 * * * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<< @@ -4612,7 +4650,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx return __pyx_r; } -/* "gedlibpy.pyx":393 +/* "gedlibpy.pyx":395 * * * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<< @@ -4642,7 +4680,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_o PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_num_nodes", 0); - /* "gedlibpy.pyx":405 + /* "gedlibpy.pyx":407 * .. note:: These functions allow to collect all the graph's informations. * """ * return self.c_env.getGraphNumNodes(graph_id) # <<<<<<<<<<<<<< @@ -4650,20 +4688,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_o * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphNumNodes(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 407, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":393 + /* "gedlibpy.pyx":395 * * * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<< @@ -4682,7 +4720,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_o return __pyx_r; } -/* "gedlibpy.pyx":408 +/* "gedlibpy.pyx":410 * * * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<< @@ -4712,7 +4750,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_o PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_num_edges", 0); - /* "gedlibpy.pyx":420 + /* "gedlibpy.pyx":422 * .. note:: These functions allow to collect all the graph's informations. * """ * return self.c_env.getGraphNumEdges(graph_id) # <<<<<<<<<<<<<< @@ -4720,20 +4758,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_o * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphNumEdges(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 420, __pyx_L1_error) + __PYX_ERR(0, 422, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":408 + /* "gedlibpy.pyx":410 * * * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<< @@ -4752,7 +4790,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_o return __pyx_r; } -/* "gedlibpy.pyx":423 +/* "gedlibpy.pyx":425 * * * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<< @@ -4787,7 +4825,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("get_original_node_ids", 0); - /* "gedlibpy.pyx":435 + /* "gedlibpy.pyx":437 * .. note:: These functions allow to collect all the graph's informations. * """ * return [gid.decode('utf-8') for gid in self.c_env.getGraphOriginalNodeIds(graph_id)] # <<<<<<<<<<<<<< @@ -4796,14 +4834,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getGraphOriginalNodeIds(__pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 435, __pyx_L1_error) + __PYX_ERR(0, 437, __pyx_L1_error) } __pyx_t_5 = &__pyx_t_3; __pyx_t_4 = __pyx_t_5->begin(); @@ -4812,9 +4850,9 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx __pyx_t_6 = *__pyx_t_4; ++__pyx_t_4; __pyx_8genexpr3__pyx_v_gid = __pyx_t_6; - __pyx_t_7 = __Pyx_decode_cpp_string(__pyx_8genexpr3__pyx_v_gid, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = __Pyx_decode_cpp_string(__pyx_8genexpr3__pyx_v_gid, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } /* exit inner scope */ @@ -4822,7 +4860,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":423 + /* "gedlibpy.pyx":425 * * * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<< @@ -4842,7 +4880,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx return __pyx_r; } -/* "gedlibpy.pyx":438 +/* "gedlibpy.pyx":440 * * * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<< @@ -4880,7 +4918,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("get_graph_node_labels", 0); - /* "gedlibpy.pyx":450 + /* "gedlibpy.pyx":452 * .. note:: These functions allow to collect all the graph's informations. * """ * return [decode_your_map(node_label) for node_label in self.c_env.getGraphNodeLabels(graph_id)] # <<<<<<<<<<<<<< @@ -4889,14 +4927,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getGraphNodeLabels(__pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 450, __pyx_L1_error) + __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_5 = &__pyx_t_3; __pyx_t_4 = __pyx_t_5->begin(); @@ -4905,9 +4943,9 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx __pyx_t_6 = *__pyx_t_4; ++__pyx_t_4; __pyx_8genexpr4__pyx_v_node_label = __pyx_t_6; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_8genexpr4__pyx_v_node_label); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_9 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_8genexpr4__pyx_v_node_label); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -4922,10 +4960,10 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } /* exit inner scope */ @@ -4933,7 +4971,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":438 + /* "gedlibpy.pyx":440 * * * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<< @@ -4956,7 +4994,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx return __pyx_r; } -/* "gedlibpy.pyx":453 +/* "gedlibpy.pyx":455 * * * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<< @@ -4989,7 +5027,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8 PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_graph_edges", 0); - /* "gedlibpy.pyx":465 + /* "gedlibpy.pyx":467 * .. note:: These functions allow to collect all the graph's informations. * """ * return decode_graph_edges(self.c_env.getGraphEdges(graph_id)) # <<<<<<<<<<<<<< @@ -4997,16 +5035,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error) try { __pyx_t_4 = __pyx_v_self->c_env->getGraphEdges(__pyx_t_3); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 465, __pyx_L1_error) + __PYX_ERR(0, 467, __pyx_L1_error) } - __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -5021,14 +5059,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":453 + /* "gedlibpy.pyx":455 * * * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<< @@ -5050,7 +5088,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":468 +/* "gedlibpy.pyx":470 * * * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<< @@ -5080,7 +5118,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_graph_adjacence_matrix", 0); - /* "gedlibpy.pyx":480 + /* "gedlibpy.pyx":482 * .. note:: These functions allow to collect all the graph's informations. * """ * return self.c_env.getGraphAdjacenceMatrix(graph_id) # <<<<<<<<<<<<<< @@ -5088,20 +5126,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->getGraphAdjacenceMatrix(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 480, __pyx_L1_error) + __PYX_ERR(0, 482, __pyx_L1_error) } - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":468 + /* "gedlibpy.pyx":470 * * * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<< @@ -5120,7 +5158,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct return __pyx_r; } -/* "gedlibpy.pyx":483 +/* "gedlibpy.pyx":485 * * * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<< @@ -5165,7 +5203,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 483, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5181,7 +5219,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 483, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5207,28 +5245,28 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge std::vector __pyx_t_7; __Pyx_RefNannySetupContext("set_edit_cost", 0); - /* "gedlibpy.pyx":495 + /* "gedlibpy.pyx":497 * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise. * """ * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<< * edit_cost_b = edit_cost.encode('utf-8') * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_edit_cost, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_edit_cost, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (likely(__pyx_t_3)) { - /* "gedlibpy.pyx":496 + /* "gedlibpy.pyx":498 * """ * if edit_cost in list_of_edit_cost_options: * edit_cost_b = edit_cost.encode('utf-8') # <<<<<<<<<<<<<< * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edit_cost, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edit_cost, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5242,29 +5280,29 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_edit_cost_b = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":497 + /* "gedlibpy.pyx":499 * if edit_cost in list_of_edit_cost_options: * edit_cost_b = edit_cost.encode('utf-8') * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) # <<<<<<<<<<<<<< * else: * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") */ - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_edit_cost_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error) - __pyx_t_7 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_edit_cost_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error) try { __pyx_v_self->c_env->setEditCost(__pyx_t_6, __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 497, __pyx_L1_error) + __PYX_ERR(0, 499, __pyx_L1_error) } - /* "gedlibpy.pyx":495 + /* "gedlibpy.pyx":497 * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise. * """ * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<< @@ -5274,7 +5312,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge goto __pyx_L3; } - /* "gedlibpy.pyx":499 + /* "gedlibpy.pyx":501 * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) * else: * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") # <<<<<<<<<<<<<< @@ -5282,7 +5320,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -5296,16 +5334,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_edit_cost_function_doesn_t) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_edit_cost_function_doesn_t); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 499, __pyx_L1_error) + __PYX_ERR(0, 501, __pyx_L1_error) } __pyx_L3:; - /* "gedlibpy.pyx":483 + /* "gedlibpy.pyx":485 * * * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<< @@ -5329,7 +5367,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8ge return __pyx_r; } -/* "gedlibpy.pyx":502 +/* "gedlibpy.pyx":504 * * * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<< @@ -5367,7 +5405,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 502, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 504, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5381,7 +5419,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 504, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5400,22 +5438,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __py std::vector __pyx_t_1; __Pyx_RefNannySetupContext("set_personal_edit_cost", 0); - /* "gedlibpy.pyx":512 + /* "gedlibpy.pyx":514 * .. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function. * """ * self.c_env.setPersonalEditCost(edit_cost_constant) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) try { __pyx_v_self->c_env->setPersonalEditCost(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - /* "gedlibpy.pyx":502 + /* "gedlibpy.pyx":504 * * * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<< @@ -5435,7 +5473,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __py return __pyx_r; } -/* "gedlibpy.pyx":515 +/* "gedlibpy.pyx":517 * * * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<< @@ -5483,7 +5521,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 515, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 517, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5500,7 +5538,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 517, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5526,28 +5564,28 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE bool __pyx_t_7; __Pyx_RefNannySetupContext("init", 0); - /* "gedlibpy.pyx":526 + /* "gedlibpy.pyx":528 * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise. * """ * if init_option in list_of_init_options: # <<<<<<<<<<<<<< * init_option_b = init_option.encode('utf-8') * self.c_env.initEnv(init_option_b, print_to_stdout) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_init_option, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_init_option, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (likely(__pyx_t_3)) { - /* "gedlibpy.pyx":527 + /* "gedlibpy.pyx":529 * """ * if init_option in list_of_init_options: * init_option_b = init_option.encode('utf-8') # <<<<<<<<<<<<<< * self.c_env.initEnv(init_option_b, print_to_stdout) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_init_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_init_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5561,29 +5599,29 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_init_option_b = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":528 + /* "gedlibpy.pyx":530 * if init_option in list_of_init_options: * init_option_b = init_option.encode('utf-8') * self.c_env.initEnv(init_option_b, print_to_stdout) # <<<<<<<<<<<<<< * else: * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") */ - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_init_option_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_print_to_stdout); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_init_option_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_print_to_stdout); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error) try { __pyx_v_self->c_env->initEnv(__pyx_t_6, __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 528, __pyx_L1_error) + __PYX_ERR(0, 530, __pyx_L1_error) } - /* "gedlibpy.pyx":526 + /* "gedlibpy.pyx":528 * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise. * """ * if init_option in list_of_init_options: # <<<<<<<<<<<<<< @@ -5593,7 +5631,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE goto __pyx_L3; } - /* "gedlibpy.pyx":530 + /* "gedlibpy.pyx":532 * self.c_env.initEnv(init_option_b, print_to_stdout) * else: * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") # <<<<<<<<<<<<<< @@ -5601,7 +5639,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -5615,16 +5653,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_init_option_doesn_t_exist_p) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_init_option_doesn_t_exist_p); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 530, __pyx_L1_error) + __PYX_ERR(0, 532, __pyx_L1_error) } __pyx_L3:; - /* "gedlibpy.pyx":515 + /* "gedlibpy.pyx":517 * * * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<< @@ -5648,7 +5686,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GE return __pyx_r; } -/* "gedlibpy.pyx":533 +/* "gedlibpy.pyx":535 * * * def set_method(self, method, options="") : # <<<<<<<<<<<<<< @@ -5693,7 +5731,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 533, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 535, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5709,7 +5747,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 533, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5735,28 +5773,28 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli std::string __pyx_t_7; __Pyx_RefNannySetupContext("set_method", 0); - /* "gedlibpy.pyx":545 + /* "gedlibpy.pyx":547 * .. note:: Try to make sure the edit cost function exists with list_of_method_options, raise an error otherwise. Call init_method() after your set. * """ * if method in list_of_method_options: # <<<<<<<<<<<<<< * method_b = method.encode('utf-8') * self.c_env.setMethod(method_b, options.encode('utf-8')) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (likely(__pyx_t_3)) { - /* "gedlibpy.pyx":546 + /* "gedlibpy.pyx":548 * """ * if method in list_of_method_options: * method_b = method.encode('utf-8') # <<<<<<<<<<<<<< * self.c_env.setMethod(method_b, options.encode('utf-8')) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5770,21 +5808,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_method_b = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":547 + /* "gedlibpy.pyx":549 * if method in list_of_method_options: * method_b = method.encode('utf-8') * self.c_env.setMethod(method_b, options.encode('utf-8')) # <<<<<<<<<<<<<< * else: * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") */ - __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_method_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_method_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5798,19 +5836,19 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_v_self->c_env->setMethod(__pyx_t_6, __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 547, __pyx_L1_error) + __PYX_ERR(0, 549, __pyx_L1_error) } - /* "gedlibpy.pyx":545 + /* "gedlibpy.pyx":547 * .. note:: Try to make sure the edit cost function exists with list_of_method_options, raise an error otherwise. Call init_method() after your set. * """ * if method in list_of_method_options: # <<<<<<<<<<<<<< @@ -5820,7 +5858,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli goto __pyx_L3; } - /* "gedlibpy.pyx":549 + /* "gedlibpy.pyx":551 * self.c_env.setMethod(method_b, options.encode('utf-8')) * else: * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") # <<<<<<<<<<<<<< @@ -5828,7 +5866,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -5842,16 +5880,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_method_doesn_t_exist_please) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_method_doesn_t_exist_please); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 549, __pyx_L1_error) + __PYX_ERR(0, 551, __pyx_L1_error) } __pyx_L3:; - /* "gedlibpy.pyx":533 + /* "gedlibpy.pyx":535 * * * def set_method(self, method, options="") : # <<<<<<<<<<<<<< @@ -5875,7 +5913,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedli return __pyx_r; } -/* "gedlibpy.pyx":552 +/* "gedlibpy.pyx":554 * * * def init_method(self) : # <<<<<<<<<<<<<< @@ -5902,7 +5940,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedl __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_method", 0); - /* "gedlibpy.pyx":559 + /* "gedlibpy.pyx":561 * .. note:: Call this function after set the method. You can't launch computation or change the method after that. * """ * self.c_env.initMethod() # <<<<<<<<<<<<<< @@ -5913,10 +5951,10 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedl __pyx_v_self->c_env->initMethod(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 559, __pyx_L1_error) + __PYX_ERR(0, 561, __pyx_L1_error) } - /* "gedlibpy.pyx":552 + /* "gedlibpy.pyx":554 * * * def init_method(self) : # <<<<<<<<<<<<<< @@ -5936,7 +5974,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedl return __pyx_r; } -/* "gedlibpy.pyx":562 +/* "gedlibpy.pyx":564 * * * def get_init_time(self) : # <<<<<<<<<<<<<< @@ -5965,7 +6003,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8ge PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_init_time", 0); - /* "gedlibpy.pyx":569 + /* "gedlibpy.pyx":571 * :rtype: double * """ * return self.c_env.getInitime() # <<<<<<<<<<<<<< @@ -5977,15 +6015,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8ge __pyx_t_1 = __pyx_v_self->c_env->getInitime(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 569, __pyx_L1_error) + __PYX_ERR(0, 571, __pyx_L1_error) } - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":562 + /* "gedlibpy.pyx":564 * * * def get_init_time(self) : # <<<<<<<<<<<<<< @@ -6004,7 +6042,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8ge return __pyx_r; } -/* "gedlibpy.pyx":572 +/* "gedlibpy.pyx":574 * * * def run_method(self, g, h) : # <<<<<<<<<<<<<< @@ -6044,11 +6082,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 572, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 574, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 572, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 574, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6061,7 +6099,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 572, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6081,23 +6119,23 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedli size_t __pyx_t_2; __Pyx_RefNannySetupContext("run_method", 0); - /* "gedlibpy.pyx":584 + /* "gedlibpy.pyx":586 * .. note:: This function only compute the distance between two graphs, without returning a result. Use the differents function to see the result between the two graphs. * """ * self.c_env.runMethod(g, h) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error) try { __pyx_v_self->c_env->runMethod(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 584, __pyx_L1_error) + __PYX_ERR(0, 586, __pyx_L1_error) } - /* "gedlibpy.pyx":572 + /* "gedlibpy.pyx":574 * * * def run_method(self, g, h) : # <<<<<<<<<<<<<< @@ -6117,7 +6155,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedli return __pyx_r; } -/* "gedlibpy.pyx":587 +/* "gedlibpy.pyx":589 * * * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<< @@ -6157,11 +6195,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 587, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 589, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 587, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 589, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6174,7 +6212,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 587, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 589, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6196,7 +6234,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(struct __pyx_obj_8 PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_upper_bound", 0); - /* "gedlibpy.pyx":602 + /* "gedlibpy.pyx":604 * .. note:: The upper bound is equivalent to the result of the pessimist edit distance cost. Methods are heuristics so the library can't compute the real perfect result because it's NP-Hard problem. * """ * return self.c_env.getUpperBound(g, h) # <<<<<<<<<<<<<< @@ -6204,21 +6242,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getUpperBound(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 604, __pyx_L1_error) } - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":587 + /* "gedlibpy.pyx":589 * * * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<< @@ -6237,7 +6275,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":605 +/* "gedlibpy.pyx":607 * * * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<< @@ -6277,11 +6315,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 605, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 607, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 605, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 607, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6294,7 +6332,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 605, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 607, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6316,7 +6354,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(struct __pyx_obj_8 PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_lower_bound", 0); - /* "gedlibpy.pyx":620 + /* "gedlibpy.pyx":622 * .. note:: This function can be ignored, because lower bound doesn't have a crucial utility. * """ * return self.c_env.getLowerBound(g, h) # <<<<<<<<<<<<<< @@ -6324,21 +6362,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getLowerBound(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 620, __pyx_L1_error) + __PYX_ERR(0, 622, __pyx_L1_error) } - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":605 + /* "gedlibpy.pyx":607 * * * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<< @@ -6357,7 +6395,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":623 +/* "gedlibpy.pyx":625 * * * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<< @@ -6397,11 +6435,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 623, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 625, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 623, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 625, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6414,7 +6452,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 623, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 625, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6436,7 +6474,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(struct __pyx_obj_8 PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_forward_map", 0); - /* "gedlibpy.pyx":638 + /* "gedlibpy.pyx":640 * .. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! * """ * return self.c_env.getForwardMap(g, h) # <<<<<<<<<<<<<< @@ -6444,21 +6482,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getForwardMap(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 640, __pyx_L1_error) } - __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":623 + /* "gedlibpy.pyx":625 * * * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<< @@ -6477,7 +6515,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":641 +/* "gedlibpy.pyx":643 * * * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<< @@ -6517,11 +6555,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 641, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 643, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 641, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 643, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6534,7 +6572,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 641, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6556,7 +6594,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(struct __pyx_obj_ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_backward_map", 0); - /* "gedlibpy.pyx":656 + /* "gedlibpy.pyx":658 * .. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! * """ * return self.c_env.getBackwardMap(g, h) # <<<<<<<<<<<<<< @@ -6564,21 +6602,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(struct __pyx_obj_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getBackwardMap(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 656, __pyx_L1_error) + __PYX_ERR(0, 658, __pyx_L1_error) } - __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":641 + /* "gedlibpy.pyx":643 * * * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<< @@ -6597,7 +6635,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(struct __pyx_obj_ return __pyx_r; } -/* "gedlibpy.pyx":659 +/* "gedlibpy.pyx":661 * * * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<< @@ -6640,17 +6678,17 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 659, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 659, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 659, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6665,7 +6703,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 659, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6688,7 +6726,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(struct __pyx_obj_8g PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_node_image", 0); - /* "gedlibpy.pyx":677 + /* "gedlibpy.pyx":679 * * """ * return self.c_env.getNodeImage(g, h, node_id) # <<<<<<<<<<<<<< @@ -6696,22 +6734,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(struct __pyx_obj_8g * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error) try { __pyx_t_4 = __pyx_v_self->c_env->getNodeImage(__pyx_t_1, __pyx_t_2, __pyx_t_3); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 677, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":659 + /* "gedlibpy.pyx":661 * * * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<< @@ -6730,7 +6768,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":680 +/* "gedlibpy.pyx":682 * * * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<< @@ -6773,17 +6811,17 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 682, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 682, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 680, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 682, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6798,7 +6836,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 682, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6821,7 +6859,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(struct __pyx_ob PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_node_pre_image", 0); - /* "gedlibpy.pyx":698 + /* "gedlibpy.pyx":700 * * """ * return self.c_env.getNodePreImage(g, h, node_id) # <<<<<<<<<<<<<< @@ -6829,22 +6867,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error) try { __pyx_t_4 = __pyx_v_self->c_env->getNodePreImage(__pyx_t_1, __pyx_t_2, __pyx_t_3); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 698, __pyx_L1_error) + __PYX_ERR(0, 700, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":680 + /* "gedlibpy.pyx":682 * * * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<< @@ -6863,7 +6901,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":701 +/* "gedlibpy.pyx":703 * * * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<< @@ -6903,11 +6941,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 701, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 703, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 701, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 703, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6920,7 +6958,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 701, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 703, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6942,7 +6980,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_induced_cost", 0); - /* "gedlibpy.pyx":717 + /* "gedlibpy.pyx":719 * * """ * return self.c_env.getInducedCost(g, h) # <<<<<<<<<<<<<< @@ -6950,21 +6988,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 719, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getInducedCost(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 717, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) } - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":701 + /* "gedlibpy.pyx":703 * * * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<< @@ -6983,7 +7021,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_ return __pyx_r; } -/* "gedlibpy.pyx":720 +/* "gedlibpy.pyx":722 * * * def get_node_map(self, g, h) : # <<<<<<<<<<<<<< @@ -6993,7 +7031,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_ /* Python wrapper */ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map[] = "\n\t\t\tReturns the Node Map, like C++ NodeMap. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The Node Map between the two selected graph. \n\t\t\t:rtype: list[tuple(size_t, size_t)]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_pre_image(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.\t \n\t\t"; +static char __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map[] = "\n\t\t\tReturns the Node Map, like C++ NodeMap. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The Node Map between the two selected graph. \n\t\t\t:rtype: gklearn.ged.env.NodeMap.\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_pre_image(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.\t \n\t\t"; static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_g = 0; PyObject *__pyx_v_h = 0; @@ -7023,11 +7061,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_sel case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 720, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 722, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 720, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 722, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7040,7 +7078,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 722, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7054,37 +7092,431 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_sel } static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) { + std::vector > __pyx_v_map_as_relation; + double __pyx_v_induced_cost; + PyObject *__pyx_v_source_map = NULL; + PyObject *__pyx_v_target_map = NULL; + Py_ssize_t __pyx_v_num_node_source; + Py_ssize_t __pyx_v_num_node_target; + PyObject *__pyx_v_node_map = NULL; + Py_ssize_t __pyx_v_i; + std::pair __pyx_8genexpr5__pyx_v_item; + std::pair __pyx_8genexpr6__pyx_v_item; + PyObject *__pyx_8genexpr7__pyx_v_item = NULL; + PyObject *__pyx_8genexpr8__pyx_v_item = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations size_t __pyx_t_1; size_t __pyx_t_2; std::vector > __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + std::vector > ::iterator __pyx_t_6; + std::pair __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; __Pyx_RefNannySetupContext("get_node_map", 0); - /* "gedlibpy.pyx":735 + /* "gedlibpy.pyx":737 * .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example. * """ - * return self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<< - * - * + * map_as_relation = self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<< + * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. + * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getNodeMap(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 735, __pyx_L1_error) + __PYX_ERR(0, 737, __pyx_L1_error) } - __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_map_as_relation = __pyx_t_3; + + /* "gedlibpy.pyx":738 + * """ + * map_as_relation = self.c_env.getNodeMap(g, h) + * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. # <<<<<<<<<<<<<< + * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. + * # print(source_map) + */ + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error) + try { + __pyx_t_4 = __pyx_v_self->c_env->getInducedCost(__pyx_t_2, __pyx_t_1); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 738, __pyx_L1_error) + } + __pyx_v_induced_cost = __pyx_t_4; + + /* "gedlibpy.pyx":739 + * map_as_relation = self.c_env.getNodeMap(g, h) + * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. + * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. # <<<<<<<<<<<<<< + * # print(source_map) + * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] + */ + { /* enter inner scope */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __pyx_v_map_as_relation.begin(); + for (;;) { + if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break; + __pyx_t_7 = *__pyx_t_6; + ++__pyx_t_6; + __pyx_8genexpr5__pyx_v_item = __pyx_t_7; + __pyx_t_9 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_map_as_relation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (((__pyx_8genexpr5__pyx_v_item.first < __pyx_t_10) != 0)) { + __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr5__pyx_v_item.first); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = __pyx_t_11; + __pyx_t_11 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } /* exit inner scope */ + __pyx_v_source_map = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "gedlibpy.pyx":741 + * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. + * # print(source_map) + * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] # <<<<<<<<<<<<<< + * # print(target_map) + * num_node_source = len([item for item in source_map if item != np.inf]) + */ + { /* enter inner scope */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __pyx_v_map_as_relation.begin(); + for (;;) { + if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break; + __pyx_t_7 = *__pyx_t_6; + ++__pyx_t_6; + __pyx_8genexpr6__pyx_v_item = __pyx_t_7; + __pyx_t_11 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_map_as_relation); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (((__pyx_8genexpr6__pyx_v_item.second < __pyx_t_10) != 0)) { + __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr6__pyx_v_item.second); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __pyx_t_11; + __pyx_t_11 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_inf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } /* exit inner scope */ + __pyx_v_target_map = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "gedlibpy.pyx":743 + * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] + * # print(target_map) + * num_node_source = len([item for item in source_map if item != np.inf]) # <<<<<<<<<<<<<< + * # print(num_node_source) + * num_node_target = len([item for item in target_map if item != np.inf]) + */ + { /* enter inner scope */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __pyx_v_source_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; + for (;;) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 743, __pyx_L9_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_item, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_8genexpr7__pyx_v_item, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 743, __pyx_L9_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_12) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr7__pyx_v_item))) __PYX_ERR(0, 743, __pyx_L9_error) + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0; + goto __pyx_L13_exit_scope; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_num_node_source = __pyx_t_10; + + /* "gedlibpy.pyx":745 + * num_node_source = len([item for item in source_map if item != np.inf]) + * # print(num_node_source) + * num_node_target = len([item for item in target_map if item != np.inf]) # <<<<<<<<<<<<<< + * # print(num_node_target) + * + */ + { /* enter inner scope */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __pyx_v_target_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; + for (;;) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 745, __pyx_L16_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_item, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_8genexpr8__pyx_v_item, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 745, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_12) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr8__pyx_v_item))) __PYX_ERR(0, 745, __pyx_L16_error) + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0; + goto __pyx_L20_exit_scope; + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0; + goto __pyx_L1_error; + __pyx_L20_exit_scope:; + } /* exit inner scope */ + __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_num_node_target = __pyx_t_10; + + /* "gedlibpy.pyx":748 + * # print(num_node_target) + * + * node_map = NodeMap(num_node_source, num_node_target) # <<<<<<<<<<<<<< + * # print(node_map.get_forward_map(), node_map.get_backward_map()) + * for i in range(len(source_map)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_num_node_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_num_node_target); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = NULL; + __pyx_t_14 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_14 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + if (__pyx_t_13) { + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_node_map = __pyx_t_5; + __pyx_t_5 = 0; + + /* "gedlibpy.pyx":750 + * node_map = NodeMap(num_node_source, num_node_target) + * # print(node_map.get_forward_map(), node_map.get_backward_map()) + * for i in range(len(source_map)): # <<<<<<<<<<<<<< + * node_map.add_assignment(source_map[i], target_map[i]) + * node_map.set_induced_cost(induced_cost) + */ + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_source_map); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_16 = __pyx_t_10; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_i = __pyx_t_17; + + /* "gedlibpy.pyx":751 + * # print(node_map.get_forward_map(), node_map.get_backward_map()) + * for i in range(len(source_map)): + * node_map.add_assignment(source_map[i], target_map[i]) # <<<<<<<<<<<<<< + * node_map.set_induced_cost(induced_cost) + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_add_assignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_source_map, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_target_map, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = NULL; + __pyx_t_14 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_14 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_13 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_14, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_14, __pyx_t_11); + __pyx_t_15 = 0; + __pyx_t_11 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "gedlibpy.pyx":752 + * for i in range(len(source_map)): + * node_map.add_assignment(source_map[i], target_map[i]) + * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<< + * + * return node_map + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "gedlibpy.pyx":754 + * node_map.set_induced_cost(induced_cost) + * + * return node_map # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_node_map); + __pyx_r = __pyx_v_node_map; goto __pyx_L0; - /* "gedlibpy.pyx":720 + /* "gedlibpy.pyx":722 * * * def get_node_map(self, g, h) : # <<<<<<<<<<<<<< @@ -7094,16 +7526,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(struct __pyx_obj_8ged /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_source_map); + __Pyx_XDECREF(__pyx_v_target_map); + __Pyx_XDECREF(__pyx_v_node_map); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "gedlibpy.pyx":738 +/* "gedlibpy.pyx":757 * * * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<< @@ -7143,11 +7585,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 738, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 757, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 738, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 757, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7160,7 +7602,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 738, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 757, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7182,7 +7624,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(struct __pyx PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_assignment_matrix", 0); - /* "gedlibpy.pyx":753 + /* "gedlibpy.pyx":772 * .. note:: This function creates datas so use it if necessary. * """ * return self.c_env.getAssignmentMatrix(g, h) # <<<<<<<<<<<<<< @@ -7190,21 +7632,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(struct __pyx * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getAssignmentMatrix(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 753, __pyx_L1_error) + __PYX_ERR(0, 772, __pyx_L1_error) } - __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":738 + /* "gedlibpy.pyx":757 * * * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<< @@ -7223,7 +7665,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(struct __pyx return __pyx_r; } -/* "gedlibpy.pyx":756 +/* "gedlibpy.pyx":775 * * * def get_all_map(self, g, h) : # <<<<<<<<<<<<<< @@ -7263,11 +7705,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 756, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 756, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 775, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7280,7 +7722,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 756, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 775, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7302,7 +7744,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(struct __pyx_obj_8gedl PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_all_map", 0); - /* "gedlibpy.pyx":771 + /* "gedlibpy.pyx":790 * .. note:: This function duplicates data so please don't use it. I also don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! * """ * return self.c_env.getAllMap(g, h) # <<<<<<<<<<<<<< @@ -7310,21 +7752,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(struct __pyx_obj_8gedl * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getAllMap(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 771, __pyx_L1_error) + __PYX_ERR(0, 790, __pyx_L1_error) } - __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":756 + /* "gedlibpy.pyx":775 * * * def get_all_map(self, g, h) : # <<<<<<<<<<<<<< @@ -7343,7 +7785,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(struct __pyx_obj_8gedl return __pyx_r; } -/* "gedlibpy.pyx":774 +/* "gedlibpy.pyx":793 * * * def get_runtime(self, g, h) : # <<<<<<<<<<<<<< @@ -7383,11 +7825,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 774, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 793, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 774, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 793, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7400,7 +7842,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 774, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 793, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7422,7 +7864,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedl PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_runtime", 0); - /* "gedlibpy.pyx":789 + /* "gedlibpy.pyx":808 * .. note:: Python is a bit longer than C++ due to the functions's encapsulate. * """ * return self.c_env.getRuntime(g,h) # <<<<<<<<<<<<<< @@ -7430,21 +7872,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedl * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error) try { __pyx_t_3 = __pyx_v_self->c_env->getRuntime(__pyx_t_1, __pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 789, __pyx_L1_error) + __PYX_ERR(0, 808, __pyx_L1_error) } - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":774 + /* "gedlibpy.pyx":793 * * * def get_runtime(self, g, h) : # <<<<<<<<<<<<<< @@ -7463,7 +7905,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedl return __pyx_r; } -/* "gedlibpy.pyx":792 +/* "gedlibpy.pyx":811 * * * def quasimetric_cost(self) : # <<<<<<<<<<<<<< @@ -7492,7 +7934,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("quasimetric_cost", 0); - /* "gedlibpy.pyx":806 + /* "gedlibpy.pyx":825 * .. warning:: run_method() between the same two graph must be called before this function. * """ * return self.c_env.quasimetricCosts() # <<<<<<<<<<<<<< @@ -7504,15 +7946,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->c_env->quasimetricCosts(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 806, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":792 + /* "gedlibpy.pyx":811 * * * def quasimetric_cost(self) : # <<<<<<<<<<<<<< @@ -7531,7 +7973,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_ return __pyx_r; } -/* "gedlibpy.pyx":809 +/* "gedlibpy.pyx":828 * * * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<< @@ -7561,7 +8003,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8g PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("hungarian_LSAP", 0); - /* "gedlibpy.pyx":820 + /* "gedlibpy.pyx":839 * .. seealso:: hungarian_LSAPE() * """ * return self.c_env.hungarianLSAP(matrix_cost) # <<<<<<<<<<<<<< @@ -7569,20 +8011,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8g * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAP(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 839, __pyx_L1_error) } - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":809 + /* "gedlibpy.pyx":828 * * * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<< @@ -7601,7 +8043,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":823 +/* "gedlibpy.pyx":842 * * * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<< @@ -7631,7 +8073,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("hungarian_LSAPE", 0); - /* "gedlibpy.pyx":834 + /* "gedlibpy.pyx":853 * .. seealso:: hungarian_LSAP() * """ * return self.c_env.hungarianLSAPE(matrix_cost) # <<<<<<<<<<<<<< @@ -7639,20 +8081,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error) try { __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAPE(__pyx_t_1); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 834, __pyx_L1_error) + __PYX_ERR(0, 853, __pyx_L1_error) } - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":823 + /* "gedlibpy.pyx":842 * * * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<< @@ -7671,7 +8113,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":837 +/* "gedlibpy.pyx":856 * * * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -7721,19 +8163,19 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 856, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 856, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 856, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -7743,7 +8185,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 837, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 856, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7765,7 +8207,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 856, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7797,14 +8239,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("add_random_graph", 0); - /* "gedlibpy.pyx":857 + /* "gedlibpy.pyx":876 * * """ * id = self.add_graph(name, classe) # <<<<<<<<<<<<<< * for node in list_of_nodes: * self.add_node(id, node[0], node[1]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -7821,7 +8263,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -7829,13 +8271,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -7846,7 +8288,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __Pyx_INCREF(__pyx_v_classe); __Pyx_GIVEREF(__pyx_v_classe); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_classe); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -7854,7 +8296,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __pyx_v_id = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":858 + /* "gedlibpy.pyx":877 * """ * id = self.add_graph(name, classe) * for node in list_of_nodes: # <<<<<<<<<<<<<< @@ -7865,26 +8307,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __pyx_t_1 = __pyx_v_list_of_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 877, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 877, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -7894,7 +8336,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 858, __pyx_L1_error) + else __PYX_ERR(0, 877, __pyx_L1_error) } break; } @@ -7903,18 +8345,18 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":859 + /* "gedlibpy.pyx":878 * id = self.add_graph(name, classe) * for node in list_of_nodes: * self.add_node(id, node[0], node[1]) # <<<<<<<<<<<<<< * for edge in list_of_edges: * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_node, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_node, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_node, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_node, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -7931,7 +8373,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7941,7 +8383,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7949,7 +8391,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ } else #endif { - __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -7963,14 +8405,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":858 + /* "gedlibpy.pyx":877 * """ * id = self.add_graph(name, classe) * for node in list_of_nodes: # <<<<<<<<<<<<<< @@ -7980,7 +8422,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":860 + /* "gedlibpy.pyx":879 * for node in list_of_nodes: * self.add_node(id, node[0], node[1]) * for edge in list_of_edges: # <<<<<<<<<<<<<< @@ -7991,26 +8433,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __pyx_t_1 = __pyx_v_list_of_edges; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 879, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 879, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -8020,7 +8462,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 860, __pyx_L1_error) + else __PYX_ERR(0, 879, __pyx_L1_error) } break; } @@ -8029,20 +8471,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":861 + /* "gedlibpy.pyx":880 * self.add_node(id, node[0], node[1]) * for edge in list_of_edges: * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) # <<<<<<<<<<<<<< * return id * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_edge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_edge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -8059,7 +8501,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -8070,7 +8512,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -8079,7 +8521,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ } else #endif { - __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -8099,14 +8541,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __pyx_t_10 = 0; __pyx_t_8 = 0; __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":860 + /* "gedlibpy.pyx":879 * for node in list_of_nodes: * self.add_node(id, node[0], node[1]) * for edge in list_of_edges: # <<<<<<<<<<<<<< @@ -8116,7 +8558,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":862 + /* "gedlibpy.pyx":881 * for edge in list_of_edges: * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) * return id # <<<<<<<<<<<<<< @@ -8128,7 +8570,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ __pyx_r = __pyx_v_id; goto __pyx_L0; - /* "gedlibpy.pyx":837 + /* "gedlibpy.pyx":856 * * * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -8157,7 +8599,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_ return __pyx_r; } -/* "gedlibpy.pyx":865 +/* "gedlibpy.pyx":884 * * * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -8201,7 +8643,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_sel case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 865, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 884, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -8211,7 +8653,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 865, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 884, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -8229,7 +8671,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 865, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8264,16 +8706,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("add_nx_graph", 0); - /* "gedlibpy.pyx":879 + /* "gedlibpy.pyx":898 * * """ * id = self.add_graph(g.name, classe) # <<<<<<<<<<<<<< * for node in g.nodes: * self.add_node(id, str(node), g.nodes[node]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -8290,7 +8732,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8299,14 +8741,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -8317,7 +8759,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __Pyx_GIVEREF(__pyx_v_classe); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_classe); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -8325,22 +8767,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __pyx_v_id = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":880 + /* "gedlibpy.pyx":899 * """ * id = self.add_graph(g.name, classe) * for node in g.nodes: # <<<<<<<<<<<<<< * self.add_node(id, str(node), g.nodes[node]) * for edge in g.edges: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8348,17 +8790,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -8368,7 +8810,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 880, __pyx_L1_error) + else __PYX_ERR(0, 899, __pyx_L1_error) } break; } @@ -8377,20 +8819,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":881 + /* "gedlibpy.pyx":900 * id = self.add_graph(g.name, classe) * for node in g.nodes: * self.add_node(id, str(node), g.nodes[node]) # <<<<<<<<<<<<<< * for edge in g.edges: * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -8408,7 +8850,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8418,7 +8860,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8426,7 +8868,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged } else #endif { - __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -8440,14 +8882,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_9); __pyx_t_3 = 0; __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":880 + /* "gedlibpy.pyx":899 * """ * id = self.add_graph(g.name, classe) * for node in g.nodes: # <<<<<<<<<<<<<< @@ -8457,22 +8899,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":882 + /* "gedlibpy.pyx":901 * for node in g.nodes: * self.add_node(id, str(node), g.nodes[node]) * for edge in g.edges: # <<<<<<<<<<<<<< * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) * return id */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8480,17 +8922,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -8500,7 +8942,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 882, __pyx_L1_error) + else __PYX_ERR(0, 901, __pyx_L1_error) } break; } @@ -8509,30 +8951,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":883 + /* "gedlibpy.pyx":902 * self.add_node(id, str(node), g.nodes[node]) * for edge in g.edges: * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) # <<<<<<<<<<<<<< * return id * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_5 = 0; @@ -8549,7 +8991,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12}; - __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -8559,7 +9001,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12}; - __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -8567,7 +9009,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged } else #endif { - __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; @@ -8578,7 +9020,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_12); __pyx_t_11 = 0; __pyx_t_12 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } @@ -8598,7 +9040,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -8609,7 +9051,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -8618,7 +9060,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged } else #endif { - __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -8638,14 +9080,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __pyx_t_9 = 0; __pyx_t_3 = 0; __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":882 + /* "gedlibpy.pyx":901 * for node in g.nodes: * self.add_node(id, str(node), g.nodes[node]) * for edge in g.edges: # <<<<<<<<<<<<<< @@ -8655,7 +9097,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":884 + /* "gedlibpy.pyx":903 * for edge in g.edges: * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) * return id # <<<<<<<<<<<<<< @@ -8667,7 +9109,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged __pyx_r = __pyx_v_id; goto __pyx_L0; - /* "gedlibpy.pyx":865 + /* "gedlibpy.pyx":884 * * * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<< @@ -8699,7 +9141,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8ged return __pyx_r; } -/* "gedlibpy.pyx":887 +/* "gedlibpy.pyx":906 * * * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -8752,25 +9194,25 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 906, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 906, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 906, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 906, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -8780,7 +9222,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ged_on_two_graphs") < 0)) __PYX_ERR(0, 887, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ged_on_two_graphs") < 0)) __PYX_ERR(0, 906, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -8804,7 +9246,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8832,14 +9274,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("compute_ged_on_two_graphs", 0); - /* "gedlibpy.pyx":910 + /* "gedlibpy.pyx":929 * * """ * if self.is_initialized() : # <<<<<<<<<<<<<< * self.restart_env() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -8853,21 +9295,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "gedlibpy.pyx":911 + /* "gedlibpy.pyx":930 * """ * if self.is_initialized() : * self.restart_env() # <<<<<<<<<<<<<< * * g = self.add_nx_graph(g1, "") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -8881,12 +9323,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":910 + /* "gedlibpy.pyx":929 * * """ * if self.is_initialized() : # <<<<<<<<<<<<<< @@ -8895,14 +9337,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ */ } - /* "gedlibpy.pyx":913 + /* "gedlibpy.pyx":932 * self.restart_env() * * g = self.add_nx_graph(g1, "") # <<<<<<<<<<<<<< * h = self.add_nx_graph(g2, "") * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -8919,7 +9361,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -8927,13 +9369,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -8944,7 +9386,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_kp_u_); __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_u_); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -8952,14 +9394,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":914 + /* "gedlibpy.pyx":933 * * g = self.add_nx_graph(g1, "") * h = self.add_nx_graph(g2, "") # <<<<<<<<<<<<<< * * self.set_edit_cost(edit_cost) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -8976,7 +9418,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -8984,13 +9426,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9001,7 +9443,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_kp_u_); __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -9009,14 +9451,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __pyx_v_h = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":916 + /* "gedlibpy.pyx":935 * h = self.add_nx_graph(g2, "") * * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<< * self.init(init_option) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9030,19 +9472,19 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edit_cost); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":917 + /* "gedlibpy.pyx":936 * * self.set_edit_cost(edit_cost) * self.init(init_option) # <<<<<<<<<<<<<< * * self.set_method(method, options) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9056,19 +9498,19 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_init_option); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":919 + /* "gedlibpy.pyx":938 * self.init(init_option) * * self.set_method(method, options) # <<<<<<<<<<<<<< * self.init_method() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -9085,7 +9527,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -9093,13 +9535,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -9110,21 +9552,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_v_options); __Pyx_GIVEREF(__pyx_v_options); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_options); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":920 + /* "gedlibpy.pyx":939 * * self.set_method(method, options) * self.init_method() # <<<<<<<<<<<<<< * * resDistance = 0 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9138,12 +9580,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":922 + /* "gedlibpy.pyx":941 * self.init_method() * * resDistance = 0 # <<<<<<<<<<<<<< @@ -9153,26 +9595,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_int_0); __pyx_v_resDistance = __pyx_int_0; - /* "gedlibpy.pyx":923 + /* "gedlibpy.pyx":942 * * resDistance = 0 * resMapping = [] # <<<<<<<<<<<<<< * self.run_method(g, h) * resDistance = self.get_upper_bound(g, h) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_resMapping = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":924 + /* "gedlibpy.pyx":943 * resDistance = 0 * resMapping = [] * self.run_method(g, h) # <<<<<<<<<<<<<< * resDistance = self.get_upper_bound(g, h) * resMapping = self.get_node_map(g, h) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -9189,7 +9631,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -9197,13 +9639,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9214,21 +9656,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":925 + /* "gedlibpy.pyx":944 * resMapping = [] * self.run_method(g, h) * resDistance = self.get_upper_bound(g, h) # <<<<<<<<<<<<<< * resMapping = self.get_node_map(g, h) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -9245,7 +9687,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -9253,13 +9695,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -9270,7 +9712,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -9278,14 +9720,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_DECREF_SET(__pyx_v_resDistance, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":926 + /* "gedlibpy.pyx":945 * self.run_method(g, h) * resDistance = self.get_upper_bound(g, h) * resMapping = self.get_node_map(g, h) # <<<<<<<<<<<<<< * * return resDistance, resMapping */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -9302,7 +9744,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -9310,13 +9752,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9327,7 +9769,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -9335,7 +9777,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __Pyx_DECREF_SET(__pyx_v_resMapping, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":928 + /* "gedlibpy.pyx":947 * resMapping = self.get_node_map(g, h) * * return resDistance, resMapping # <<<<<<<<<<<<<< @@ -9343,7 +9785,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_resDistance); __Pyx_GIVEREF(__pyx_v_resDistance); @@ -9355,7 +9797,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":887 + /* "gedlibpy.pyx":906 * * * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -9381,7 +9823,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct _ return __pyx_r; } -/* "gedlibpy.pyx":931 +/* "gedlibpy.pyx":950 * * * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -9434,25 +9876,25 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 950, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 950, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 950, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 950, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -9462,7 +9904,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_nx_graphs") < 0)) __PYX_ERR(0, 931, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_nx_graphs") < 0)) __PYX_ERR(0, 950, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -9486,7 +9928,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 950, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9522,14 +9964,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs", 0); - /* "gedlibpy.pyx":955 + /* "gedlibpy.pyx":974 * * """ * if self.is_initialized() : # <<<<<<<<<<<<<< * self.restart_env() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9543,21 +9985,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "gedlibpy.pyx":956 + /* "gedlibpy.pyx":975 * """ * if self.is_initialized() : * self.restart_env() # <<<<<<<<<<<<<< * * print("Loading graphs in progress...") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9571,12 +10013,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":955 + /* "gedlibpy.pyx":974 * * """ * if self.is_initialized() : # <<<<<<<<<<<<<< @@ -9585,18 +10027,18 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs */ } - /* "gedlibpy.pyx":958 + /* "gedlibpy.pyx":977 * self.restart_env() * * print("Loading graphs in progress...") # <<<<<<<<<<<<<< * for graph in dataset : * self.add_nx_graph(graph, classes) */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":959 + /* "gedlibpy.pyx":978 * * print("Loading graphs in progress...") * for graph in dataset : # <<<<<<<<<<<<<< @@ -9607,26 +10049,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __pyx_t_1 = __pyx_v_dataset; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 978, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 978, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -9636,7 +10078,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 959, __pyx_L1_error) + else __PYX_ERR(0, 978, __pyx_L1_error) } break; } @@ -9645,14 +10087,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_XDECREF_SET(__pyx_v_graph, __pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":960 + /* "gedlibpy.pyx":979 * print("Loading graphs in progress...") * for graph in dataset : * self.add_nx_graph(graph, classes) # <<<<<<<<<<<<<< * listID = self.graph_ids() * print("Graphs loaded ! ") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -9669,7 +10111,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -9677,13 +10119,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -9694,14 +10136,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_INCREF(__pyx_v_classes); __Pyx_GIVEREF(__pyx_v_classes); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_classes); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":959 + /* "gedlibpy.pyx":978 * * print("Loading graphs in progress...") * for graph in dataset : # <<<<<<<<<<<<<< @@ -9711,14 +10153,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":961 + /* "gedlibpy.pyx":980 * for graph in dataset : * self.add_nx_graph(graph, classes) * listID = self.graph_ids() # <<<<<<<<<<<<<< * print("Graphs loaded ! ") * print("Number of graphs = " + str(listID[1])) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9732,51 +10174,51 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_listID = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":962 + /* "gedlibpy.pyx":981 * self.add_nx_graph(graph, classes) * listID = self.graph_ids() * print("Graphs loaded ! ") # <<<<<<<<<<<<<< * print("Number of graphs = " + str(listID[1])) * */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":963 + /* "gedlibpy.pyx":982 * listID = self.graph_ids() * print("Graphs loaded ! ") * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<< * * self.set_edit_cost(edit_cost) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":965 + /* "gedlibpy.pyx":984 * print("Number of graphs = " + str(listID[1])) * * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<< * print("Initialization in progress...") * self.init(init_option) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -9790,30 +10232,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_edit_cost); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":966 + /* "gedlibpy.pyx":985 * * self.set_edit_cost(edit_cost) * print("Initialization in progress...") # <<<<<<<<<<<<<< * self.init(init_option) * print("Initialization terminated !") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":967 + /* "gedlibpy.pyx":986 * self.set_edit_cost(edit_cost) * print("Initialization in progress...") * self.init(init_option) # <<<<<<<<<<<<<< * print("Initialization terminated !") * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -9827,30 +10269,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_init_option); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":968 + /* "gedlibpy.pyx":987 * print("Initialization in progress...") * self.init(init_option) * print("Initialization terminated !") # <<<<<<<<<<<<<< * * self.set_method(method, options) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":970 + /* "gedlibpy.pyx":989 * print("Initialization terminated !") * * self.set_method(method, options) # <<<<<<<<<<<<<< * self.init_method() * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_8 = 0; @@ -9867,7 +10309,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -9875,13 +10317,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -9892,21 +10334,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_INCREF(__pyx_v_options); __Pyx_GIVEREF(__pyx_v_options); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_options); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":971 + /* "gedlibpy.pyx":990 * * self.set_method(method, options) * self.init_method() # <<<<<<<<<<<<<< * * resDistance = [[]] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -9920,21 +10362,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":973 + /* "gedlibpy.pyx":992 * self.init_method() * * resDistance = [[]] # <<<<<<<<<<<<<< * resMapping = [[]] * for g in range(listID[0], listID[1]) : */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -9942,16 +10384,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __pyx_v_resDistance = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":974 + /* "gedlibpy.pyx":993 * * resDistance = [[]] * resMapping = [[]] # <<<<<<<<<<<<<< * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -9959,18 +10401,18 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __pyx_v_resMapping = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":975 + /* "gedlibpy.pyx":994 * resDistance = [[]] * resMapping = [[]] * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); @@ -9978,16 +10420,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 994, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -9995,17 +10437,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 994, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 994, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -10015,7 +10457,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 975, __pyx_L1_error) + else __PYX_ERR(0, 994, __pyx_L1_error) } break; } @@ -10024,38 +10466,38 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":976 + /* "gedlibpy.pyx":995 * resMapping = [[]] * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<< * for h in range(listID[0], listID[1]) : * #print("Computation between graph " + str(g) + " and graph " + str(h)) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":977 + /* "gedlibpy.pyx":996 * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< * #print("Computation between graph " + str(g) + " and graph " + str(h)) * self.run_method(g, h) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -10063,16 +10505,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 996, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10080,17 +10522,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 996, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 996, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -10100,7 +10542,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 977, __pyx_L1_error) + else __PYX_ERR(0, 996, __pyx_L1_error) } break; } @@ -10109,14 +10551,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":979 + /* "gedlibpy.pyx":998 * for h in range(listID[0], listID[1]) : * #print("Computation between graph " + str(g) + " and graph " + str(h)) * self.run_method(g, h) # <<<<<<<<<<<<<< * resDistance[g][h] = self.get_upper_bound(g, h) * resMapping[g][h] = self.get_node_map(g, h) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -10133,7 +10575,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -10141,13 +10583,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -10158,21 +10600,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":980 + /* "gedlibpy.pyx":999 * #print("Computation between graph " + str(g) + " and graph " + str(h)) * self.run_method(g, h) * resDistance[g][h] = self.get_upper_bound(g, h) # <<<<<<<<<<<<<< * resMapping[g][h] = self.get_node_map(g, h) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = NULL; __pyx_t_8 = 0; @@ -10189,7 +10631,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -10197,13 +10639,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL; @@ -10214,25 +10656,25 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 980, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":981 + /* "gedlibpy.pyx":1000 * self.run_method(g, h) * resDistance[g][h] = self.get_upper_bound(g, h) * resMapping[g][h] = self.get_node_map(g, h) # <<<<<<<<<<<<<< * * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -10249,7 +10691,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -10257,13 +10699,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -10274,18 +10716,18 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 981, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":977 + /* "gedlibpy.pyx":996 * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< @@ -10295,7 +10737,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":975 + /* "gedlibpy.pyx":994 * resDistance = [[]] * resMapping = [[]] * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< @@ -10305,18 +10747,18 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "gedlibpy.pyx":983 + /* "gedlibpy.pyx":1002 * resMapping[g][h] = self.get_node_map(g, h) * * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<< * return resDistance, resMapping * */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "gedlibpy.pyx":984 + /* "gedlibpy.pyx":1003 * * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") * return resDistance, resMapping # <<<<<<<<<<<<<< @@ -10324,7 +10766,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_resDistance); __Pyx_GIVEREF(__pyx_v_resDistance); @@ -10336,7 +10778,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs __pyx_t_9 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":931 + /* "gedlibpy.pyx":950 * * * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -10366,7 +10808,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs return __pyx_r; } -/* "gedlibpy.pyx":987 +/* "gedlibpy.pyx":1006 * * * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -10420,19 +10862,19 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graph case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 987, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 1006, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 987, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 1006, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 987, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 1006, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -10448,7 +10890,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graph } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_GXl_graphs") < 0)) __PYX_ERR(0, 987, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_GXl_graphs") < 0)) __PYX_ERR(0, 1006, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -10473,7 +10915,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graph } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 987, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1006, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10506,14 +10948,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs", 0); - /* "gedlibpy.pyx":1011 + /* "gedlibpy.pyx":1030 * """ * * if self.is_initialized() : # <<<<<<<<<<<<<< * self.restart_env() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -10527,21 +10969,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "gedlibpy.pyx":1012 + /* "gedlibpy.pyx":1031 * * if self.is_initialized() : * self.restart_env() # <<<<<<<<<<<<<< * * print("Loading graphs in progress...") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -10555,12 +10997,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1011 + /* "gedlibpy.pyx":1030 * """ * * if self.is_initialized() : # <<<<<<<<<<<<<< @@ -10569,25 +11011,25 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph */ } - /* "gedlibpy.pyx":1014 + /* "gedlibpy.pyx":1033 * self.restart_env() * * print("Loading graphs in progress...") # <<<<<<<<<<<<<< * self.load_GXL_graphs(path_folder, path_XML) * listID = self.graph_ids() */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1015 + /* "gedlibpy.pyx":1034 * * print("Loading graphs in progress...") * self.load_GXL_graphs(path_folder, path_XML) # <<<<<<<<<<<<<< * listID = self.graph_ids() * print("Graphs loaded ! ") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_GXL_graphs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_GXL_graphs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -10604,7 +11046,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -10612,13 +11054,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -10629,21 +11071,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __Pyx_INCREF(__pyx_v_path_XML); __Pyx_GIVEREF(__pyx_v_path_XML); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_path_XML); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1016 + /* "gedlibpy.pyx":1035 * print("Loading graphs in progress...") * self.load_GXL_graphs(path_folder, path_XML) * listID = self.graph_ids() # <<<<<<<<<<<<<< * print("Graphs loaded ! ") * print("Number of graphs = " + str(listID[1])) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -10657,51 +11099,51 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_listID = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1017 + /* "gedlibpy.pyx":1036 * self.load_GXL_graphs(path_folder, path_XML) * listID = self.graph_ids() * print("Graphs loaded ! ") # <<<<<<<<<<<<<< * print("Number of graphs = " + str(listID[1])) * */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1018 + /* "gedlibpy.pyx":1037 * listID = self.graph_ids() * print("Graphs loaded ! ") * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<< * * self.set_edit_cost(edit_cost) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1020 + /* "gedlibpy.pyx":1039 * print("Number of graphs = " + str(listID[1])) * * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<< * print("Initialization in progress...") * self.init(init_option) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -10715,30 +11157,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_edit_cost); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1021 + /* "gedlibpy.pyx":1040 * * self.set_edit_cost(edit_cost) * print("Initialization in progress...") # <<<<<<<<<<<<<< * self.init(init_option) * print("Initialization terminated !") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1022 + /* "gedlibpy.pyx":1041 * self.set_edit_cost(edit_cost) * print("Initialization in progress...") * self.init(init_option) # <<<<<<<<<<<<<< * print("Initialization terminated !") * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -10752,30 +11194,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_init_option); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1023 + /* "gedlibpy.pyx":1042 * print("Initialization in progress...") * self.init(init_option) * print("Initialization terminated !") # <<<<<<<<<<<<<< * * self.set_method(method, options) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1025 + /* "gedlibpy.pyx":1044 * print("Initialization terminated !") * * self.set_method(method, options) # <<<<<<<<<<<<<< * self.init_method() * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -10792,7 +11234,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -10800,13 +11242,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -10817,21 +11259,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __Pyx_INCREF(__pyx_v_options); __Pyx_GIVEREF(__pyx_v_options); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_options); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1026 + /* "gedlibpy.pyx":1045 * * self.set_method(method, options) * self.init_method() # <<<<<<<<<<<<<< * * #res = [] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -10845,23 +11287,23 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1029 + /* "gedlibpy.pyx":1048 * * #res = [] * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -10869,16 +11311,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10886,17 +11328,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1048, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1048, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -10906,7 +11348,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1029, __pyx_L1_error) + else __PYX_ERR(0, 1048, __pyx_L1_error) } break; } @@ -10915,38 +11357,38 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1030 + /* "gedlibpy.pyx":1049 * #res = [] * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<< * for h in range(listID[0], listID[1]) : * #print("Computation between graph " + str(g) + " and graph " + str(h)) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":1031 + /* "gedlibpy.pyx":1050 * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< * #print("Computation between graph " + str(g) + " and graph " + str(h)) * self.run_method(g,h) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -10954,16 +11396,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1050, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10971,17 +11413,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1050, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1050, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -10991,7 +11433,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1031, __pyx_L1_error) + else __PYX_ERR(0, 1050, __pyx_L1_error) } break; } @@ -11000,14 +11442,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1033 + /* "gedlibpy.pyx":1052 * for h in range(listID[0], listID[1]) : * #print("Computation between graph " + str(g) + " and graph " + str(h)) * self.run_method(g,h) # <<<<<<<<<<<<<< * #res.append((get_upper_bound(g,h), get_node_map(g,h), get_runtime(g,h))) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; __pyx_t_5 = 0; @@ -11024,7 +11466,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -11032,13 +11474,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; @@ -11049,14 +11491,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_h); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1031 + /* "gedlibpy.pyx":1050 * for g in range(listID[0], listID[1]) : * print("Computation between graph " + str(g) + " with all the others including himself.") * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< @@ -11066,7 +11508,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "gedlibpy.pyx":1029 + /* "gedlibpy.pyx":1048 * * #res = [] * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<< @@ -11076,29 +11518,29 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1038 + /* "gedlibpy.pyx":1057 * #return res * * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<< * print ("Please don't restart the environment or recall this function, you will lose your results !") * return listID */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1039 + /* "gedlibpy.pyx":1058 * * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<< * return listID * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1040 + /* "gedlibpy.pyx":1059 * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") * print ("Please don't restart the environment or recall this function, you will lose your results !") * return listID # <<<<<<<<<<<<<< @@ -11110,7 +11552,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph __pyx_r = __pyx_v_listID; goto __pyx_L0; - /* "gedlibpy.pyx":987 + /* "gedlibpy.pyx":1006 * * * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<< @@ -11137,7 +11579,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graph return __pyx_r; } -/* "gedlibpy.pyx":1043 +/* "gedlibpy.pyx":1062 * * * def get_num_node_labels(self): # <<<<<<<<<<<<<< @@ -11166,7 +11608,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_o PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_num_node_labels", 0); - /* "gedlibpy.pyx":1052 + /* "gedlibpy.pyx":1071 * .. note:: If 1 is returned, the nodes are unlabeled. * """ * return self.c_env.getNumNodeLabels() # <<<<<<<<<<<<<< @@ -11178,15 +11620,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_o __pyx_t_1 = __pyx_v_self->c_env->getNumNodeLabels(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1052, __pyx_L1_error) + __PYX_ERR(0, 1071, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1043 + /* "gedlibpy.pyx":1062 * * * def get_num_node_labels(self): # <<<<<<<<<<<<<< @@ -11205,7 +11647,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_o return __pyx_r; } -/* "gedlibpy.pyx":1055 +/* "gedlibpy.pyx":1074 * * * def get_node_label(self, label_id): # <<<<<<<<<<<<<< @@ -11238,7 +11680,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8g PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_node_label", 0); - /* "gedlibpy.pyx":1064 + /* "gedlibpy.pyx":1083 * :rtype: dict{string : string} * """ * return decode_your_map(self.c_env.getNodeLabel(label_id)) # <<<<<<<<<<<<<< @@ -11246,16 +11688,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8g * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) try { __pyx_t_4 = __pyx_v_self->c_env->getNodeLabel(__pyx_t_3); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1083, __pyx_L1_error) } - __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11270,14 +11712,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8g __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1055 + /* "gedlibpy.pyx":1074 * * * def get_node_label(self, label_id): # <<<<<<<<<<<<<< @@ -11299,7 +11741,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":1067 +/* "gedlibpy.pyx":1086 * * * def get_num_edge_labels(self): # <<<<<<<<<<<<<< @@ -11328,7 +11770,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_o PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_num_edge_labels", 0); - /* "gedlibpy.pyx":1076 + /* "gedlibpy.pyx":1095 * .. note:: If 1 is returned, the edges are unlabeled. * """ * return self.c_env.getNumEdgeLabels() # <<<<<<<<<<<<<< @@ -11340,15 +11782,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_o __pyx_t_1 = __pyx_v_self->c_env->getNumEdgeLabels(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1076, __pyx_L1_error) + __PYX_ERR(0, 1095, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1067 + /* "gedlibpy.pyx":1086 * * * def get_num_edge_labels(self): # <<<<<<<<<<<<<< @@ -11367,7 +11809,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_o return __pyx_r; } -/* "gedlibpy.pyx":1079 +/* "gedlibpy.pyx":1098 * * * def get_edge_label(self, label_id): # <<<<<<<<<<<<<< @@ -11400,7 +11842,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8 PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_edge_label", 0); - /* "gedlibpy.pyx":1088 + /* "gedlibpy.pyx":1107 * :rtype: dict{string : string} * """ * return decode_your_map(self.c_env.getEdgeLabel(label_id)) # <<<<<<<<<<<<<< @@ -11408,16 +11850,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8 * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1107, __pyx_L1_error) try { __pyx_t_4 = __pyx_v_self->c_env->getEdgeLabel(__pyx_t_3); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1088, __pyx_L1_error) + __PYX_ERR(0, 1107, __pyx_L1_error) } - __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11432,14 +11874,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1079 + /* "gedlibpy.pyx":1098 * * * def get_edge_label(self, label_id): # <<<<<<<<<<<<<< @@ -11461,7 +11903,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8 return __pyx_r; } -/* "gedlibpy.pyx":1102 +/* "gedlibpy.pyx":1121 * # return self.c_env.getNumNodes(graph_id) * * def get_avg_num_nodes(self): # <<<<<<<<<<<<<< @@ -11490,7 +11932,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_avg_num_nodes", 0); - /* "gedlibpy.pyx":1109 + /* "gedlibpy.pyx":1128 * :rtype: double * """ * return self.c_env.getAvgNumNodes() # <<<<<<<<<<<<<< @@ -11502,15 +11944,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_ob __pyx_t_1 = __pyx_v_self->c_env->getAvgNumNodes(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1109, __pyx_L1_error) + __PYX_ERR(0, 1128, __pyx_L1_error) } - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1102 + /* "gedlibpy.pyx":1121 * # return self.c_env.getNumNodes(graph_id) * * def get_avg_num_nodes(self): # <<<<<<<<<<<<<< @@ -11529,7 +11971,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1111 +/* "gedlibpy.pyx":1130 * return self.c_env.getAvgNumNodes() * * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<< @@ -11569,11 +12011,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1111, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1111, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -11586,7 +12028,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1111, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11610,7 +12052,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_ob double __pyx_t_6; __Pyx_RefNannySetupContext("get_node_rel_cost", 0); - /* "gedlibpy.pyx":1122 + /* "gedlibpy.pyx":1141 * :rtype: double * """ * return self.c_env.getNodeRelCost(encode_your_map(node_label_1), encode_your_map(node_label_2)) # <<<<<<<<<<<<<< @@ -11618,7 +12060,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11632,12 +12074,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11651,24 +12093,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_6 = __pyx_v_self->c_env->getNodeRelCost(__pyx_t_4, __pyx_t_5); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1122, __pyx_L1_error) + __PYX_ERR(0, 1141, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1111 + /* "gedlibpy.pyx":1130 * return self.c_env.getAvgNumNodes() * * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<< @@ -11689,7 +12131,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1125 +/* "gedlibpy.pyx":1144 * * * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<< @@ -11721,7 +12163,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_ob double __pyx_t_5; __Pyx_RefNannySetupContext("get_node_del_cost", 0); - /* "gedlibpy.pyx":1134 + /* "gedlibpy.pyx":1153 * :rtype: double * """ * return self.c_env.getNodeDelCost(encode_your_map(node_label)) # <<<<<<<<<<<<<< @@ -11729,7 +12171,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11743,24 +12185,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_5 = __pyx_v_self->c_env->getNodeDelCost(__pyx_t_4); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1134, __pyx_L1_error) + __PYX_ERR(0, 1153, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1125 + /* "gedlibpy.pyx":1144 * * * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<< @@ -11781,7 +12223,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1137 +/* "gedlibpy.pyx":1156 * * * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<< @@ -11813,7 +12255,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_ob double __pyx_t_5; __Pyx_RefNannySetupContext("get_node_ins_cost", 0); - /* "gedlibpy.pyx":1146 + /* "gedlibpy.pyx":1165 * :rtype: double * """ * return self.c_env.getNodeInsCost(encode_your_map(node_label)) # <<<<<<<<<<<<<< @@ -11821,7 +12263,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -11835,24 +12277,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_5 = __pyx_v_self->c_env->getNodeInsCost(__pyx_t_4); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1146, __pyx_L1_error) + __PYX_ERR(0, 1165, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1137 + /* "gedlibpy.pyx":1156 * * * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<< @@ -11873,7 +12315,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1149 +/* "gedlibpy.pyx":1168 * * * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<< @@ -11897,7 +12339,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *_ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels) { PyObject *__pyx_v_node_labels_b = NULL; - PyObject *__pyx_8genexpr5__pyx_v_node_label = NULL; + PyObject *__pyx_8genexpr9__pyx_v_node_label = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -11911,7 +12353,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py std::map __pyx_t_9; __Pyx_RefNannySetupContext("get_median_node_label", 0); - /* "gedlibpy.pyx":1158 + /* "gedlibpy.pyx":1177 * :rtype: dict{string : string} * """ * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] # <<<<<<<<<<<<<< @@ -11919,32 +12361,32 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py * */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_node_labels)) || PyTuple_CheckExact(__pyx_v_node_labels)) { __pyx_t_2 = __pyx_v_node_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_node_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_node_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1177, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1177, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -11954,15 +12396,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1158, __pyx_L5_error) + else __PYX_ERR(0, 1177, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_node_label, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_node_label, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L5_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -11974,26 +12416,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr5__pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr5__pyx_v_node_label); + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr9__pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr9__pyx_v_node_label); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1158, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1177, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label); __pyx_8genexpr5__pyx_v_node_label = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label); __pyx_8genexpr5__pyx_v_node_label = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_v_node_labels_b = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1159 + /* "gedlibpy.pyx":1178 * """ * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b)) # <<<<<<<<<<<<<< @@ -12001,16 +12443,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_v_node_labels_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_v_node_labels_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error) try { __pyx_t_9 = __pyx_v_self->c_env->getMedianNodeLabel(__pyx_t_8); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1159, __pyx_L1_error) + __PYX_ERR(0, 1178, __pyx_L1_error) } - __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12025,14 +12467,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1149 + /* "gedlibpy.pyx":1168 * * * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<< @@ -12051,13 +12493,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __py __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_node_labels_b); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "gedlibpy.pyx":1162 +/* "gedlibpy.pyx":1181 * * * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<< @@ -12097,11 +12539,11 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1162, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1181, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1181, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -12114,7 +12556,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1162, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12138,7 +12580,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_ob double __pyx_t_6; __Pyx_RefNannySetupContext("get_edge_rel_cost", 0); - /* "gedlibpy.pyx":1173 + /* "gedlibpy.pyx":1192 * :rtype: double * """ * return self.c_env.getEdgeRelCost(encode_your_map(edge_label_1), encode_your_map(edge_label_2)) # <<<<<<<<<<<<<< @@ -12146,7 +12588,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12160,12 +12602,12 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12179,24 +12621,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_6 = __pyx_v_self->c_env->getEdgeRelCost(__pyx_t_4, __pyx_t_5); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1173, __pyx_L1_error) + __PYX_ERR(0, 1192, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1162 + /* "gedlibpy.pyx":1181 * * * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<< @@ -12217,7 +12659,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1176 +/* "gedlibpy.pyx":1195 * * * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<< @@ -12249,7 +12691,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_ob double __pyx_t_5; __Pyx_RefNannySetupContext("get_edge_del_cost", 0); - /* "gedlibpy.pyx":1185 + /* "gedlibpy.pyx":1204 * :rtype: double * """ * return self.c_env.getEdgeDelCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<< @@ -12257,7 +12699,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12271,24 +12713,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_5 = __pyx_v_self->c_env->getEdgeDelCost(__pyx_t_4); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1185, __pyx_L1_error) + __PYX_ERR(0, 1204, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1176 + /* "gedlibpy.pyx":1195 * * * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<< @@ -12309,7 +12751,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1188 +/* "gedlibpy.pyx":1207 * * * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<< @@ -12341,7 +12783,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_ob double __pyx_t_5; __Pyx_RefNannySetupContext("get_edge_ins_cost", 0); - /* "gedlibpy.pyx":1197 + /* "gedlibpy.pyx":1216 * :rtype: double * """ * return self.c_env.getEdgeInsCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<< @@ -12349,7 +12791,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_ob * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12363,24 +12805,24 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_ob } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { __pyx_t_5 = __pyx_v_self->c_env->getEdgeInsCost(__pyx_t_4); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1197, __pyx_L1_error) + __PYX_ERR(0, 1216, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1188 + /* "gedlibpy.pyx":1207 * * * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<< @@ -12401,7 +12843,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_ob return __pyx_r; } -/* "gedlibpy.pyx":1200 +/* "gedlibpy.pyx":1219 * * * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<< @@ -12425,7 +12867,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *_ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels) { CYTHON_UNUSED PyObject *__pyx_v_edge_labels_b = NULL; - PyObject *__pyx_8genexpr6__pyx_v_edge_label = NULL; + PyObject *__pyx_9genexpr10__pyx_v_edge_label = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -12439,7 +12881,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py std::map __pyx_t_9; __Pyx_RefNannySetupContext("get_median_edge_label", 0); - /* "gedlibpy.pyx":1209 + /* "gedlibpy.pyx":1228 * :rtype: dict{string : string} * """ * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] # <<<<<<<<<<<<<< @@ -12447,32 +12889,32 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py * */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_edge_labels)) || PyTuple_CheckExact(__pyx_v_edge_labels)) { __pyx_t_2 = __pyx_v_edge_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_edge_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_edge_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1228, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1228, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -12482,15 +12924,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1209, __pyx_L5_error) + else __PYX_ERR(0, 1228, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_edge_label, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_edge_label, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1209, __pyx_L5_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -12502,26 +12944,26 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr6__pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr6__pyx_v_edge_label); + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr10__pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr10__pyx_v_edge_label); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1209, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1228, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label); __pyx_8genexpr6__pyx_v_edge_label = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label); __pyx_8genexpr6__pyx_v_edge_label = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_v_edge_labels_b = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1210 + /* "gedlibpy.pyx":1229 * """ * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b)) # <<<<<<<<<<<<<< @@ -12529,19 +12971,19 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; try { __pyx_t_9 = __pyx_v_self->c_env->getMedianEdgeLabel(__pyx_t_8); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1229, __pyx_L1_error) } - __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -12556,14 +12998,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1200 + /* "gedlibpy.pyx":1219 * * * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<< @@ -12582,13 +13024,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __py __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_edge_labels_b); - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label); + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "gedlibpy.pyx":1213 +/* "gedlibpy.pyx":1232 * * * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<< @@ -12653,7 +13095,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1213, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1232, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -12675,7 +13117,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1232, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12714,16 +13156,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge PyObject *(*__pyx_t_12)(PyObject *); __Pyx_RefNannySetupContext("get_nx_graph", 0); - /* "gedlibpy.pyx":1236 + /* "gedlibpy.pyx":1255 * The obtained graph. * """ * graph = nx.Graph() # <<<<<<<<<<<<<< * graph.graph['id'] = graph_id * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12738,32 +13180,32 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_graph = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1237 + /* "gedlibpy.pyx":1256 * """ * graph = nx.Graph() * graph.graph['id'] = graph_id # <<<<<<<<<<<<<< * * nb_nodes = self.get_graph_num_nodes(graph_id) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1237, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1239 + /* "gedlibpy.pyx":1258 * graph.graph['id'] = graph_id * * nb_nodes = self.get_graph_num_nodes(graph_id) # <<<<<<<<<<<<<< * original_node_ids = self.get_original_node_ids(graph_id) * node_labels = self.get_graph_node_labels(graph_id) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_num_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_num_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -12777,20 +13219,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_nb_nodes = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1240 + /* "gedlibpy.pyx":1259 * * nb_nodes = self.get_graph_num_nodes(graph_id) * original_node_ids = self.get_original_node_ids(graph_id) # <<<<<<<<<<<<<< * node_labels = self.get_graph_node_labels(graph_id) * # print(original_node_ids) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_original_node_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_original_node_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -12804,20 +13246,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_original_node_ids = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1241 + /* "gedlibpy.pyx":1260 * nb_nodes = self.get_graph_num_nodes(graph_id) * original_node_ids = self.get_original_node_ids(graph_id) * node_labels = self.get_graph_node_labels(graph_id) # <<<<<<<<<<<<<< * # print(original_node_ids) * # print(node_labels) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_node_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_node_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -12831,32 +13273,32 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_node_labels = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1244 + /* "gedlibpy.pyx":1263 * # print(original_node_ids) * # print(node_labels) * graph.graph['original_node_ids'] = original_node_ids # <<<<<<<<<<<<<< * * for node_id in range(0, nb_nodes): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_original_node_ids, __pyx_v_original_node_ids) < 0)) __PYX_ERR(0, 1244, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_original_node_ids, __pyx_v_original_node_ids) < 0)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1246 + /* "gedlibpy.pyx":1265 * graph.graph['original_node_ids'] = original_node_ids * * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<< * graph.add_node(node_id, **node_labels[node_id]) * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id] */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); @@ -12864,16 +13306,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_INCREF(__pyx_v_nb_nodes); __Pyx_GIVEREF(__pyx_v_nb_nodes); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nb_nodes); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12881,17 +13323,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -12901,7 +13343,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1246, __pyx_L1_error) + else __PYX_ERR(0, 1265, __pyx_L1_error) } break; } @@ -12910,43 +13352,43 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_XDECREF_SET(__pyx_v_node_id, __pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1247 + /* "gedlibpy.pyx":1266 * * for node_id in range(0, nb_nodes): * graph.add_node(node_id, **node_labels[node_id]) # <<<<<<<<<<<<<< * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id] * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_node_id); __Pyx_GIVEREF(__pyx_v_node_id); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node_id); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_node_labels, __pyx_v_node_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_node_labels, __pyx_v_node_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_t_7 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1247, __pyx_L1_error) + __PYX_ERR(0, 1266, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_7))) { - __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { - __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "gedlibpy.pyx":1246 + /* "gedlibpy.pyx":1265 * graph.graph['original_node_ids'] = original_node_ids * * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<< @@ -12956,14 +13398,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1250 + /* "gedlibpy.pyx":1269 * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id] * * edges = self.get_graph_edges(graph_id) # <<<<<<<<<<<<<< * for (head, tail), labels in edges.items(): * graph.add_edge(head, tail, **labels) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -12977,13 +13419,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_graph_id); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_edges = __pyx_t_1; __pyx_t_1 = 0; - /* "gedlibpy.pyx":1251 + /* "gedlibpy.pyx":1270 * * edges = self.get_graph_edges(graph_id) * for (head, tail), labels in edges.items(): # <<<<<<<<<<<<<< @@ -12993,9 +13435,9 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __pyx_t_4 = 0; if (unlikely(__pyx_v_edges == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1251, __pyx_L1_error) + __PYX_ERR(0, 1270, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_edges, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_edges, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; @@ -13003,7 +13445,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_4, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_6); if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { @@ -13012,7 +13454,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1251, __pyx_L1_error) + __PYX_ERR(0, 1270, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13025,15 +13467,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; @@ -13041,7 +13483,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1270, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L8_unpacking_done; @@ -13049,7 +13491,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1251, __pyx_L1_error) + __PYX_ERR(0, 1270, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2); @@ -13059,16 +13501,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_6); __pyx_t_6 = 0; - /* "gedlibpy.pyx":1252 + /* "gedlibpy.pyx":1271 * edges = self.get_graph_edges(graph_id) * for (head, tail), labels in edges.items(): * graph.add_edge(head, tail, **labels) # <<<<<<<<<<<<<< * # print(edges) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_head); __Pyx_GIVEREF(__pyx_v_head); @@ -13078,16 +13520,16 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_tail); if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1252, __pyx_L1_error) + __PYX_ERR(0, 1271, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_labels))) { - __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { - __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -13096,7 +13538,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1255 + /* "gedlibpy.pyx":1274 * # print(edges) * * return graph # <<<<<<<<<<<<<< @@ -13108,7 +13550,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge __pyx_r = __pyx_v_graph; goto __pyx_L0; - /* "gedlibpy.pyx":1213 + /* "gedlibpy.pyx":1232 * * * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<< @@ -13141,7 +13583,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8ge return __pyx_r; } -/* "gedlibpy.pyx":1258 +/* "gedlibpy.pyx":1277 * * * def get_init_type(self): # <<<<<<<<<<<<<< @@ -13170,7 +13612,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8g PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_init_type", 0); - /* "gedlibpy.pyx":1267 + /* "gedlibpy.pyx":1286 * Initialization type in string. * """ * return self.c_env.getInitType().decode('utf-8') # <<<<<<<<<<<<<< @@ -13182,15 +13624,15 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8g __pyx_t_1 = __pyx_v_self->c_env->getInitType(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1267, __pyx_L1_error) + __PYX_ERR(0, 1286, __pyx_L1_error) } - __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "gedlibpy.pyx":1258 + /* "gedlibpy.pyx":1277 * * * def get_init_type(self): # <<<<<<<<<<<<<< @@ -13209,7 +13651,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":1289 +/* "gedlibpy.pyx":1308 * * * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<< @@ -13257,7 +13699,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1308, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -13273,7 +13715,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1289, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1308, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -13294,7 +13736,7 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1308, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13331,7 +13773,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __Pyx_RefNannySetupContext("load_nx_graph", 0); __Pyx_INCREF(__pyx_v_graph_id); - /* "gedlibpy.pyx":1312 + /* "gedlibpy.pyx":1331 * The ID of the newly loaded graph. * """ * if graph_id is None: # <<<<<<<<<<<<<< @@ -13342,14 +13784,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "gedlibpy.pyx":1313 + /* "gedlibpy.pyx":1332 * """ * if graph_id is None: * graph_id = self.add_graph(graph_name, graph_class) # <<<<<<<<<<<<<< * else: * self.clear_graph(graph_id) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -13366,7 +13808,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -13374,13 +13816,13 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -13391,7 +13833,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __Pyx_INCREF(__pyx_v_graph_class); __Pyx_GIVEREF(__pyx_v_graph_class); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graph_class); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -13399,7 +13841,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __Pyx_DECREF_SET(__pyx_v_graph_id, __pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1312 + /* "gedlibpy.pyx":1331 * The ID of the newly loaded graph. * """ * if graph_id is None: # <<<<<<<<<<<<<< @@ -13409,7 +13851,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g goto __pyx_L3; } - /* "gedlibpy.pyx":1315 + /* "gedlibpy.pyx":1334 * graph_id = self.add_graph(graph_name, graph_class) * else: * self.clear_graph(graph_id) # <<<<<<<<<<<<<< @@ -13417,7 +13859,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g * self.add_node(graph_id, str(node), nx_graph.nodes[node]) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -13431,29 +13873,29 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_graph_id); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "gedlibpy.pyx":1316 + /* "gedlibpy.pyx":1335 * else: * self.clear_graph(graph_id) * for node in nx_graph.nodes: # <<<<<<<<<<<<<< * self.add_node(graph_id, str(node), nx_graph.nodes[node]) * for edge in nx_graph.edges: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -13461,17 +13903,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1335, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1335, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -13481,7 +13923,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1316, __pyx_L1_error) + else __PYX_ERR(0, 1335, __pyx_L1_error) } break; } @@ -13490,20 +13932,20 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1317 + /* "gedlibpy.pyx":1336 * self.clear_graph(graph_id) * for node in nx_graph.nodes: * self.add_node(graph_id, str(node), nx_graph.nodes[node]) # <<<<<<<<<<<<<< * for edge in nx_graph.edges: * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -13521,7 +13963,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -13531,7 +13973,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -13539,7 +13981,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } else #endif { - __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -13553,14 +13995,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_6, __pyx_t_11); __pyx_t_5 = 0; __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1316 + /* "gedlibpy.pyx":1335 * else: * self.clear_graph(graph_id) * for node in nx_graph.nodes: # <<<<<<<<<<<<<< @@ -13570,22 +14012,22 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1318 + /* "gedlibpy.pyx":1337 * for node in nx_graph.nodes: * self.add_node(graph_id, str(node), nx_graph.nodes[node]) * for edge in nx_graph.edges: # <<<<<<<<<<<<<< * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) * return graph_id */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -13593,17 +14035,17 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -13613,7 +14055,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1318, __pyx_L1_error) + else __PYX_ERR(0, 1337, __pyx_L1_error) } break; } @@ -13622,30 +14064,30 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1319 + /* "gedlibpy.pyx":1338 * self.add_node(graph_id, str(node), nx_graph.nodes[node]) * for edge in nx_graph.edges: * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) # <<<<<<<<<<<<<< * return graph_id * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -13662,7 +14104,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14}; - __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -13672,7 +14114,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14}; - __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -13680,7 +14122,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } else #endif { - __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; @@ -13691,7 +14133,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_14); __pyx_t_13 = 0; __pyx_t_14 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } @@ -13711,7 +14153,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -13722,7 +14164,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -13731,7 +14173,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } else #endif { - __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -13748,14 +14190,14 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __pyx_t_11 = 0; __pyx_t_5 = 0; __pyx_t_12 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1318 + /* "gedlibpy.pyx":1337 * for node in nx_graph.nodes: * self.add_node(graph_id, str(node), nx_graph.nodes[node]) * for edge in nx_graph.edges: # <<<<<<<<<<<<<< @@ -13765,7 +14207,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "gedlibpy.pyx":1320 + /* "gedlibpy.pyx":1339 * for edge in nx_graph.edges: * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) * return graph_id # <<<<<<<<<<<<<< @@ -13777,7 +14219,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g __pyx_r = __pyx_v_graph_id; goto __pyx_L0; - /* "gedlibpy.pyx":1289 + /* "gedlibpy.pyx":1308 * * * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<< @@ -13809,30 +14251,33 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8g return __pyx_r; } -/* "gedlibpy.pyx":1323 +/* "gedlibpy.pyx":1342 * * - * def compute_induced_cost(self, g_id, h_id): # <<<<<<<<<<<<<< + * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<< * """ * Computes the edit cost between two graphs induced by a node map. */ /* Python wrapper */ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost[] = "\n\t\tComputes the edit cost between two graphs induced by a node map.\n\n\t\tParameters\n\t\t----------\n\t\tg_id : int\n\t\t\tID of input graph.\n\t\th_id : int\n\t\t\tID of input graph.\n\n\t\tReturns\n\t\t-------\n\t\tNone.\n\t\t\n\t\tNotes\n\t\t-----\n\t\tThe induced edit cost of the node map between `g_id` and `h_id` is implictly computed and stored in `GEDEnv::node_maps_`.\n\n\t\t"; +static char __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost[] = "\n\t\tComputes the edit cost between two graphs induced by a node map.\n\n\t\tParameters\n\t\t----------\n\t\tg_id : int\n\t\t\tID of input graph.\n\t\th_id : int\n\t\t\tID of input graph.\n\t\tnode_map: gklearn.ged.env.NodeMap.\n\t\t\tThe NodeMap instance whose reduced cost will be computed and re-assigned.\n\n\t\tReturns\n\t\t-------\n\t\tNone.\t\t\n\t\t"; static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_g_id = 0; PyObject *__pyx_v_h_id = 0; + PyObject *__pyx_v_node_map = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compute_induced_cost (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,0}; - PyObject* values[2] = {0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,&__pyx_n_s_node_map,0}; + PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -13849,73 +14294,303 @@ static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 1323, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 1); __PYX_ERR(0, 1342, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_map)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 2); __PYX_ERR(0, 1342, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1323, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1342, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_g_id = values[0]; __pyx_v_h_id = values[1]; + __pyx_v_node_map = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1323, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1342, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g_id, __pyx_v_h_id); + __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g_id, __pyx_v_h_id, __pyx_v_node_map); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id) { - CYTHON_UNUSED double __pyx_v_cost; +static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id, PyObject *__pyx_v_node_map) { + PyObject *__pyx_v_relation = NULL; + PyObject *__pyx_v_dummy_node = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_v_val1 = NULL; + PyObject *__pyx_v_val2 = NULL; + double __pyx_v_induced_cost; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - size_t __pyx_t_1; - size_t __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + std::vector > __pyx_t_11; + double __pyx_t_12; __Pyx_RefNannySetupContext("compute_induced_cost", 0); - /* "gedlibpy.pyx":1344 + /* "gedlibpy.pyx":1359 + * None. * """ - * - * cost = 0.0 # <<<<<<<<<<<<<< - * self.c_env.computeInducedCost(g_id, h_id) - * + * relation = [] # <<<<<<<<<<<<<< + * node_map.as_relation(relation) + * # print(relation) */ - __pyx_v_cost = 0.0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_relation = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "gedlibpy.pyx":1345 - * - * cost = 0.0 - * self.c_env.computeInducedCost(g_id, h_id) # <<<<<<<<<<<<<< - * - * + /* "gedlibpy.pyx":1360 + * """ + * relation = [] + * node_map.as_relation(relation) # <<<<<<<<<<<<<< + * # print(relation) + * dummy_node = get_dummy_node() */ - __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1345, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1345, __pyx_L1_error) - try { - __pyx_v_self->c_env->computeInducedCost(__pyx_t_1, __pyx_t_2); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_as_relation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_relation) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_relation); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gedlibpy.pyx":1362 + * node_map.as_relation(relation) + * # print(relation) + * dummy_node = get_dummy_node() # <<<<<<<<<<<<<< + * # print(dummy_node) + * for i, val in enumerate(relation): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_dummy_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dummy_node = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gedlibpy.pyx":1364 + * dummy_node = get_dummy_node() + * # print(dummy_node) + * for i, val in enumerate(relation): # <<<<<<<<<<<<<< + * val1 = dummy_node if val[0] == np.inf else val[0] + * val2 = dummy_node if val[1] == np.inf else val[1] + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __pyx_v_relation; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1364, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gedlibpy.pyx":1365 + * # print(dummy_node) + * for i, val in enumerate(relation): + * val1 = dummy_node if val[0] == np.inf else val[0] # <<<<<<<<<<<<<< + * val2 = dummy_node if val[1] == np.inf else val[1] + * relation[i] = tuple((val1, val2)) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + __Pyx_INCREF(__pyx_v_dummy_node); + __pyx_t_3 = __pyx_v_dummy_node; + } else { + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __pyx_t_6; + __pyx_t_6 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_val1, __pyx_t_3); + __pyx_t_3 = 0; + + /* "gedlibpy.pyx":1366 + * for i, val in enumerate(relation): + * val1 = dummy_node if val[0] == np.inf else val[0] + * val2 = dummy_node if val[1] == np.inf else val[1] # <<<<<<<<<<<<<< + * relation[i] = tuple((val1, val2)) + * # print(relation) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_INCREF(__pyx_v_dummy_node); + __pyx_t_3 = __pyx_v_dummy_node; + } else { + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_val2, __pyx_t_3); + __pyx_t_3 = 0; + + /* "gedlibpy.pyx":1367 + * val1 = dummy_node if val[0] == np.inf else val[0] + * val2 = dummy_node if val[1] == np.inf else val[1] + * relation[i] = tuple((val1, val2)) # <<<<<<<<<<<<<< + * # print(relation) + * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val1); + __Pyx_GIVEREF(__pyx_v_val1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val1); + __Pyx_INCREF(__pyx_v_val2); + __Pyx_GIVEREF(__pyx_v_val2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_val2); + if (unlikely(PyObject_SetItem(__pyx_v_relation, __pyx_v_i, __pyx_t_3) < 0)) __PYX_ERR(0, 1367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gedlibpy.pyx":1364 + * dummy_node = get_dummy_node() + * # print(dummy_node) + * for i, val in enumerate(relation): # <<<<<<<<<<<<<< + * val1 = dummy_node if val[0] == np.inf else val[0] + * val2 = dummy_node if val[1] == np.inf else val[1] + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gedlibpy.pyx":1369 + * relation[i] = tuple((val1, val2)) + * # print(relation) + * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) # <<<<<<<<<<<<<< + * node_map.set_induced_cost(induced_cost) + * + */ + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_g_id); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_h_id); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_11 = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_relation); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L1_error) + try { + __pyx_t_12 = __pyx_v_self->c_env->computeInducedCost(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1369, __pyx_L1_error) + } + __pyx_v_induced_cost = __pyx_t_12; + + /* "gedlibpy.pyx":1370 + * # print(relation) + * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) + * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1323 + /* "gedlibpy.pyx":1342 * * - * def compute_induced_cost(self, g_id, h_id): # <<<<<<<<<<<<<< + * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<< * """ * Computes the edit cost between two graphs induced by a node map. */ @@ -13924,9 +14599,21 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_relation); + __Pyx_XDECREF(__pyx_v_dummy_node); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_val1); + __Pyx_XDECREF(__pyx_v_val2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -14039,7 +14726,7 @@ static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(CYTHON_UNUSED return __pyx_r; } -/* "gedlibpy.pyx":1375 +/* "gedlibpy.pyx":1400 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14080,11 +14767,11 @@ static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1400, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1375, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1400, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14097,7 +14784,7 @@ static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1400, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14115,16 +14802,16 @@ static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "gedlibpy.pyx":1382 + /* "gedlibpy.pyx":1407 * :type message: string * """ * self.message = message # <<<<<<<<<<<<<< * * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1382, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1407, __pyx_L1_error) - /* "gedlibpy.pyx":1375 + /* "gedlibpy.pyx":1400 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14144,7 +14831,7 @@ static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "gedlibpy.pyx":1392 +/* "gedlibpy.pyx":1417 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14185,11 +14872,11 @@ static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1392, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1417, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1392, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1417, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14202,7 +14889,7 @@ static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1392, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1417, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14220,16 +14907,16 @@ static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "gedlibpy.pyx":1399 + /* "gedlibpy.pyx":1424 * :type message: string * """ * self.message = message # <<<<<<<<<<<<<< * * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1399, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1424, __pyx_L1_error) - /* "gedlibpy.pyx":1392 + /* "gedlibpy.pyx":1417 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14249,7 +14936,7 @@ static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "gedlibpy.pyx":1409 +/* "gedlibpy.pyx":1434 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14290,11 +14977,11 @@ static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1409, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1434, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1409, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1434, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14307,7 +14994,7 @@ static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1409, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1434, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14325,16 +15012,16 @@ static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "gedlibpy.pyx":1416 + /* "gedlibpy.pyx":1441 * :type message: string * """ * self.message = message # <<<<<<<<<<<<<< * * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1416, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1441, __pyx_L1_error) - /* "gedlibpy.pyx":1409 + /* "gedlibpy.pyx":1434 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< @@ -14354,7 +15041,7 @@ static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "gedlibpy.pyx":1423 +/* "gedlibpy.pyx":1448 * ######################################### * * def encode_your_map(map_u): # <<<<<<<<<<<<<< @@ -14394,19 +15081,19 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("encode_your_map", 0); - /* "gedlibpy.pyx":1435 + /* "gedlibpy.pyx":1460 * * """ * res = {} # <<<<<<<<<<<<<< * for key, value in map_u.items(): * res[key.encode('utf-8')] = value.encode('utf-8') */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1436 + /* "gedlibpy.pyx":1461 * """ * res = {} * for key, value in map_u.items(): # <<<<<<<<<<<<<< @@ -14416,9 +15103,9 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; if (unlikely(__pyx_v_map_u == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1436, __pyx_L1_error) + __PYX_ERR(0, 1461, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_u, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_u, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -14426,7 +15113,7 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1436, __pyx_L1_error) + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); @@ -14434,14 +15121,14 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); __pyx_t_6 = 0; - /* "gedlibpy.pyx":1437 + /* "gedlibpy.pyx":1462 * res = {} * for key, value in map_u.items(): * res[key.encode('utf-8')] = value.encode('utf-8') # <<<<<<<<<<<<<< * return res * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -14455,10 +15142,10 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1437, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1437, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -14472,16 +15159,16 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p } __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1437, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1438 + /* "gedlibpy.pyx":1463 * for key, value in map_u.items(): * res[key.encode('utf-8')] = value.encode('utf-8') * return res # <<<<<<<<<<<<<< @@ -14493,7 +15180,7 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "gedlibpy.pyx":1423 + /* "gedlibpy.pyx":1448 * ######################################### * * def encode_your_map(map_u): # <<<<<<<<<<<<<< @@ -14519,7 +15206,7 @@ static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "gedlibpy.pyx":1441 +/* "gedlibpy.pyx":1466 * * * def decode_your_map(map_b): # <<<<<<<<<<<<<< @@ -14559,19 +15246,19 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("decode_your_map", 0); - /* "gedlibpy.pyx":1453 + /* "gedlibpy.pyx":1478 * * """ * res = {} # <<<<<<<<<<<<<< * for key, value in map_b.items(): * res[key.decode('utf-8')] = value.decode('utf-8') */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1454 + /* "gedlibpy.pyx":1479 * """ * res = {} * for key, value in map_b.items(): # <<<<<<<<<<<<<< @@ -14581,9 +15268,9 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = 0; if (unlikely(__pyx_v_map_b == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1454, __pyx_L1_error) + __PYX_ERR(0, 1479, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -14591,7 +15278,7 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1454, __pyx_L1_error) + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); @@ -14599,14 +15286,14 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); __pyx_t_6 = 0; - /* "gedlibpy.pyx":1455 + /* "gedlibpy.pyx":1480 * res = {} * for key, value in map_b.items(): * res[key.decode('utf-8')] = value.decode('utf-8') # <<<<<<<<<<<<<< * return res * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -14620,10 +15307,10 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1455, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -14637,16 +15324,16 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ } __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_u_utf_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1455, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1456 + /* "gedlibpy.pyx":1481 * for key, value in map_b.items(): * res[key.decode('utf-8')] = value.decode('utf-8') * return res # <<<<<<<<<<<<<< @@ -14658,7 +15345,7 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "gedlibpy.pyx":1441 + /* "gedlibpy.pyx":1466 * * * def decode_your_map(map_b): # <<<<<<<<<<<<<< @@ -14684,7 +15371,7 @@ static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "gedlibpy.pyx":1459 +/* "gedlibpy.pyx":1484 * * * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<< @@ -14723,19 +15410,19 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("decode_graph_edges", 0); - /* "gedlibpy.pyx":1477 + /* "gedlibpy.pyx":1502 * This is a helper function for function `GEDEnv.get_graph_edges()`. * """ * map_edges = {} # <<<<<<<<<<<<<< * for key, value in map_edge_b.items(): * map_edges[key] = decode_your_map(value) */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_map_edges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1478 + /* "gedlibpy.pyx":1503 * """ * map_edges = {} * for key, value in map_edge_b.items(): # <<<<<<<<<<<<<< @@ -14745,9 +15432,9 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject __pyx_t_2 = 0; if (unlikely(__pyx_v_map_edge_b == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1478, __pyx_L1_error) + __PYX_ERR(0, 1503, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_edge_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1478, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_edge_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -14755,7 +15442,7 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1478, __pyx_L1_error) + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); @@ -14763,14 +15450,14 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); __pyx_t_6 = 0; - /* "gedlibpy.pyx":1479 + /* "gedlibpy.pyx":1504 * map_edges = {} * for key, value in map_edge_b.items(): * map_edges[key] = decode_your_map(value) # <<<<<<<<<<<<<< * return map_edges * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1479, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -14784,15 +15471,15 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1479, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1479, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1480 + /* "gedlibpy.pyx":1505 * for key, value in map_edge_b.items(): * map_edges[key] = decode_your_map(value) * return map_edges # <<<<<<<<<<<<<< @@ -14804,7 +15491,7 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_map_edges; goto __pyx_L0; - /* "gedlibpy.pyx":1459 + /* "gedlibpy.pyx":1484 * * * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<< @@ -14829,7 +15516,7 @@ static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -14878,7 +15565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -14887,7 +15574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -14896,7 +15583,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -14905,7 +15592,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -14919,7 +15606,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -14930,7 +15617,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -14939,7 +15626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -14952,7 +15639,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 272, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -14961,7 +15648,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -14975,7 +15662,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -14986,7 +15673,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -14995,7 +15682,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -15008,7 +15695,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 276, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -15017,7 +15704,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -15026,7 +15713,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -15035,7 +15722,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -15045,7 +15732,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -15054,7 +15741,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -15063,7 +15750,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -15075,7 +15762,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -15084,7 +15771,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -15094,7 +15781,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -15104,7 +15791,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -15114,7 +15801,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -15125,7 +15812,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -15134,7 +15821,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -15143,7 +15830,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -15152,7 +15839,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -15161,7 +15848,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * cdef int t * cdef char* f = NULL * cdef dtype descr = PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -15174,7 +15861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -15187,7 +15874,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -15197,7 +15884,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -15207,7 +15894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -15227,7 +15914,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -15244,7 +15931,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -15253,7 +15940,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -15266,7 +15953,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 306, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -15275,7 +15962,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -15288,7 +15975,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UBYTE: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -15299,7 +15986,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_SHORT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -15310,7 +15997,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_USHORT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -15321,7 +16008,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_INT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -15332,7 +16019,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UINT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -15343,7 +16030,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONG: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -15354,7 +16041,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONG: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -15365,7 +16052,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGLONG: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -15376,7 +16063,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONGLONG: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -15387,7 +16074,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_FLOAT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -15398,7 +16085,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_DOUBLE: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -15409,7 +16096,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGDOUBLE: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -15420,7 +16107,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CFLOAT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -15431,7 +16118,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CDOUBLE: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -15442,7 +16129,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CLONGDOUBLE: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -15453,7 +16140,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_OBJECT: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -15464,7 +16151,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -15485,7 +16172,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -15494,7 +16181,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -15504,7 +16191,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -15513,7 +16200,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -15523,7 +16210,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -15532,7 +16219,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -15541,7 +16228,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -15551,7 +16238,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error) __pyx_v_f = __pyx_t_9; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -15561,7 +16248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -15593,7 +16280,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -15617,7 +16304,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -15627,7 +16314,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -15636,7 +16323,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -15645,7 +16332,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -15655,7 +16342,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -15664,7 +16351,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -15673,7 +16360,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -15685,7 +16372,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -15699,7 +16386,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -15713,7 +16400,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -15732,7 +16419,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -15746,7 +16433,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -15760,7 +16447,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -15779,7 +16466,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -15793,7 +16480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -15807,7 +16494,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -15826,7 +16513,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -15840,7 +16527,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -15854,7 +16541,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -15873,7 +16560,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -15887,7 +16574,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -15901,7 +16588,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -15920,7 +16607,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -15934,7 +16621,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -15944,7 +16631,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -15956,7 +16643,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -15965,7 +16652,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -15979,7 +16666,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -15994,7 +16681,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -16023,7 +16710,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -16032,7 +16719,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -16041,7 +16728,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -16064,7 +16751,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -16081,7 +16768,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -16116,7 +16803,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -16133,7 +16820,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -16146,7 +16833,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 856, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -16155,7 +16842,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -16175,7 +16862,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -16192,7 +16879,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -16201,7 +16888,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -16214,7 +16901,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 860, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -16223,7 +16910,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -16239,7 +16926,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -16248,7 +16935,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -16257,7 +16944,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -16268,7 +16955,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -16278,7 +16965,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -16288,7 +16975,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -16300,7 +16987,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -16310,7 +16997,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -16323,7 +17010,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 880, __pyx_L1_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -16332,7 +17019,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -16350,7 +17037,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -16368,7 +17055,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -16386,7 +17073,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -16404,7 +17091,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -16422,7 +17109,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -16440,7 +17127,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -16458,7 +17145,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -16476,7 +17163,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -16494,7 +17181,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -16512,7 +17199,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -16530,7 +17217,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -16548,7 +17235,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -16566,7 +17253,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -16586,7 +17273,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -16606,7 +17293,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -16626,7 +17313,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -16644,7 +17331,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -16663,7 +17350,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -16672,7 +17359,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -16682,7 +17369,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -16695,7 +17382,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -16705,7 +17392,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -16715,7 +17402,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -16740,7 +17427,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -16752,7 +17439,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -16761,7 +17448,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -16770,7 +17457,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -16782,7 +17469,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -16797,7 +17484,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -16806,7 +17493,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -16816,7 +17503,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -16827,7 +17514,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -16836,7 +17523,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -16848,7 +17535,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -16863,7 +17550,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -16884,7 +17571,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -16900,7 +17587,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -16909,7 +17596,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -16923,7 +17610,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -16938,7 +17625,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -16954,7 +17641,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -16969,7 +17656,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -16992,7 +17679,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -17013,7 +17700,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -17029,7 +17716,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -17038,7 +17725,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -17052,7 +17739,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -17067,7 +17754,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -17083,7 +17770,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -17098,7 +17785,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -17121,7 +17808,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 +/* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -17142,7 +17829,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -17158,7 +17845,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -17167,7 +17854,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error) - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -17181,7 +17868,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -17195,7 +17882,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -17209,7 +17896,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -17224,7 +17911,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -19679,50 +20366,280 @@ static std::vector > __pyx_convert_vector_fro return __pyx_r; } -static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); +/* "pair.from_py":145 + * + * @cname("__pyx_convert_pair_from_py_size_t__and_size_t") + * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<< + * x, y = o + * return pair[X,Y](x, y) + */ + +static std::pair __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *__pyx_v_o) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + std::pair __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + size_t __pyx_t_5; + size_t __pyx_t_6; + __Pyx_RefNannySetupContext("__pyx_convert_pair_from_py_size_t__and_size_t", 0); + + /* "pair.from_py":146 + * @cname("__pyx_convert_pair_from_py_size_t__and_size_t") + * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: + * x, y = o # <<<<<<<<<<<<<< + * return pair[X,Y](x, y) + * + */ + if ((likely(PyTuple_CheckExact(__pyx_v_o))) || (PyList_CheckExact(__pyx_v_o))) { + PyObject* sequence = __pyx_v_o; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 146, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + Py_ssize_t index = -1; + __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_t_4 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_L4_unpacking_done:; } - if (unlikely(!o)) return 0; - if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; + __pyx_v_x = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_y = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pair.from_py":147 + * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: + * x, y = o + * return pair[X,Y](x, y) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_y); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error) + __pyx_r = std::pair (((size_t)__pyx_t_5), ((size_t)__pyx_t_6)); + goto __pyx_L0; + + /* "pair.from_py":145 + * + * @cname("__pyx_convert_pair_from_py_size_t__and_size_t") + * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<< + * x, y = o + * return pair[X,Y](x, y) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pair.from_py.__pyx_convert_pair_from_py_size_t__and_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +/* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___") + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + +static std::vector > __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(PyObject *__pyx_v_o) { + std::vector > __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector > __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + std::pair __pyx_t_5; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) } - (*Py_TYPE(o)->tp_free)(o); -} + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; -static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = { - {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized}, - {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env}, - {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs}, - {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids}, - {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids}, - {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class}, - {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name}, - {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph}, - {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node}, - {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge}, - {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge}, + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __pyx_convert_pair_from_py_size_t__and_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((std::pair )__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___") + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = { + {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized}, + {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env}, + {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs}, + {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids}, + {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids}, + {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class}, + {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name}, + {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph}, + {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node}, + {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge}, + {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge}, {"clear_graph", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph}, {"get_graph_internal_id", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id}, {"get_graph_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes}, @@ -19859,8 +20776,14 @@ static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { "UINT32_t", "X", "Y", - "__pyx_ctuple_dbc1b__c5621__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc", - "__pyx_ctuple_dbc1b__c5621__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc_struct", + "__pyx_ctuple_Py_ssize_t", + "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t", + "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t_struct", + "__pyx_ctuple_Py_ssize_t_struct", + "__pyx_ctuple_bfa21__6a9b6__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc", + "__pyx_ctuple_bfa21__6a9b6__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc_struct", + "__pyx_ctuple_double", + "__pyx_ctuple_double_struct", "__pyx_ctuple_size_t", "__pyx_ctuple_size_t__space___const___and_size_t__space___const_", "__pyx_ctuple_size_t__space___const___and_size_t__space___const__struct", @@ -20067,6 +20990,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_MethodError, __pyx_k_MethodError, sizeof(__pyx_k_MethodError), 0, 0, 1, 1}, {&__pyx_n_s_MethodError___init, __pyx_k_MethodError___init, sizeof(__pyx_k_MethodError___init), 0, 0, 1, 1}, + {&__pyx_n_s_NodeMap, __pyx_k_NodeMap, sizeof(__pyx_k_NodeMap), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_kp_u_Number_of_graphs, __pyx_k_Number_of_graphs, sizeof(__pyx_k_Number_of_graphs), 0, 1, 0, 0}, {&__pyx_kp_u_Please_don_t_restart_the_environ, __pyx_k_Please_don_t_restart_the_environ, sizeof(__pyx_k_Please_don_t_restart_the_environ), 0, 1, 0, 0}, @@ -20077,12 +21001,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1}, + {&__pyx_n_s_add_assignment, __pyx_k_add_assignment, sizeof(__pyx_k_add_assignment), 0, 0, 1, 1}, {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1}, {&__pyx_n_s_add_graph, __pyx_k_add_graph, sizeof(__pyx_k_add_graph), 0, 0, 1, 1}, {&__pyx_n_s_add_node, __pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 0, 1, 1}, {&__pyx_n_s_add_nx_graph, __pyx_k_add_nx_graph, sizeof(__pyx_k_add_nx_graph), 0, 0, 1, 1}, {&__pyx_n_s_adj_lists, __pyx_k_adj_lists, sizeof(__pyx_k_adj_lists), 0, 0, 1, 1}, {&__pyx_n_s_adj_matrix, __pyx_k_adj_matrix, sizeof(__pyx_k_adj_matrix), 0, 0, 1, 1}, + {&__pyx_n_s_as_relation, __pyx_k_as_relation, sizeof(__pyx_k_as_relation), 0, 0, 1, 1}, {&__pyx_n_s_cdll, __pyx_k_cdll, sizeof(__pyx_k_cdll), 0, 0, 1, 1}, {&__pyx_n_s_classe, __pyx_k_classe, sizeof(__pyx_k_classe), 0, 0, 1, 1}, {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1}, @@ -20106,6 +21032,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_edit_cost_constant, __pyx_k_edit_cost_constant, sizeof(__pyx_k_edit_cost_constant), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_encode_your_map, __pyx_k_encode_your_map, sizeof(__pyx_k_encode_your_map), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1}, @@ -20125,6 +21052,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_get_original_node_ids, __pyx_k_get_original_node_ids, sizeof(__pyx_k_get_original_node_ids), 0, 0, 1, 1}, {&__pyx_n_s_get_upper_bound, __pyx_k_get_upper_bound, sizeof(__pyx_k_get_upper_bound), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_gklearn_ged_env, __pyx_k_gklearn_ged_env, sizeof(__pyx_k_gklearn_ged_env), 0, 0, 1, 1}, {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1}, {&__pyx_n_s_graph_class, __pyx_k_graph_class, sizeof(__pyx_k_graph_class), 0, 0, 1, 1}, {&__pyx_n_s_graph_id, __pyx_k_graph_id, sizeof(__pyx_k_graph_id), 0, 0, 1, 1}, @@ -20136,6 +21064,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1}, {&__pyx_n_s_ignore_duplicates, __pyx_k_ignore_duplicates, sizeof(__pyx_k_ignore_duplicates), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_method, __pyx_k_init_method, sizeof(__pyx_k_init_method), 0, 0, 1, 1}, @@ -20177,8 +21106,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_node_label, __pyx_k_node_label, sizeof(__pyx_k_node_label), 0, 0, 1, 1}, {&__pyx_n_s_node_label_1, __pyx_k_node_label_1, sizeof(__pyx_k_node_label_1), 0, 0, 1, 1}, {&__pyx_n_s_node_label_2, __pyx_k_node_label_2, sizeof(__pyx_k_node_label_2), 0, 0, 1, 1}, + {&__pyx_n_s_node_map, __pyx_k_node_map, sizeof(__pyx_k_node_map), 0, 0, 1, 1}, {&__pyx_n_s_node_type, __pyx_k_node_type, sizeof(__pyx_k_node_type), 0, 0, 1, 1}, {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1}, @@ -20204,6 +21136,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_run_method, __pyx_k_run_method, sizeof(__pyx_k_run_method), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_edit_cost, __pyx_k_set_edit_cost, sizeof(__pyx_k_set_edit_cost), 0, 0, 1, 1}, + {&__pyx_n_s_set_induced_cost, __pyx_k_set_induced_cost, sizeof(__pyx_k_set_induced_cost), 0, 0, 1, 1}, {&__pyx_n_s_set_method, __pyx_k_set_method, sizeof(__pyx_k_set_method), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, @@ -20216,8 +21149,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 958, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1364, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error) @@ -20232,80 +21166,80 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "gedlibpy.pyx":958 + /* "gedlibpy.pyx":977 * self.restart_env() * * print("Loading graphs in progress...") # <<<<<<<<<<<<<< * for graph in dataset : * self.add_nx_graph(graph, classes) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Loading_graphs_in_progress); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Loading_graphs_in_progress); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "gedlibpy.pyx":962 + /* "gedlibpy.pyx":981 * self.add_nx_graph(graph, classes) * listID = self.graph_ids() * print("Graphs loaded ! ") # <<<<<<<<<<<<<< * print("Number of graphs = " + str(listID[1])) * */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "gedlibpy.pyx":966 + /* "gedlibpy.pyx":985 * * self.set_edit_cost(edit_cost) * print("Initialization in progress...") # <<<<<<<<<<<<<< * self.init(init_option) * print("Initialization terminated !") */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "gedlibpy.pyx":968 + /* "gedlibpy.pyx":987 * print("Initialization in progress...") * self.init(init_option) * print("Initialization terminated !") # <<<<<<<<<<<<<< * * self.set_method(method, options) */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "gedlibpy.pyx":983 + /* "gedlibpy.pyx":1002 * resMapping[g][h] = self.get_node_map(g, h) * * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<< * return resDistance, resMapping * */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Finish_The_return_contains_edit); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Finish_The_return_contains_edit); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "gedlibpy.pyx":1038 + /* "gedlibpy.pyx":1057 * #return res * * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<< * print ("Please don't restart the environment or recall this function, you will lose your results !") * return listID */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Finish_You_can_check_the_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Finish_You_can_check_the_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "gedlibpy.pyx":1039 + /* "gedlibpy.pyx":1058 * * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<< * return listID * */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Please_don_t_restart_the_environ); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Please_don_t_restart_the_environ); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -20328,7 +21262,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -20339,7 +21273,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -20350,7 +21284,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -20361,7 +21295,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -20372,7 +21306,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -20383,7 +21317,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -20394,7 +21328,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -20405,122 +21339,122 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "gedlibpy.pyx":126 + /* "gedlibpy.pyx":128 * * * def get_edit_cost_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents edit cost functions and returns the result. */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_edit_cost_options, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_edit_cost_options, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error) - /* "gedlibpy.pyx":140 + /* "gedlibpy.pyx":142 * * * def get_method_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents method for edit distance computation between graphs and returns the result. */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_method_options, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_method_options, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 142, __pyx_L1_error) - /* "gedlibpy.pyx":153 + /* "gedlibpy.pyx":155 * * * def get_init_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents initialization parameters for the environment computation for graphs and returns the result. */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_init_options, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_init_options, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 155, __pyx_L1_error) - /* "gedlibpy.pyx":166 + /* "gedlibpy.pyx":168 * * * def get_dummy_node() : # <<<<<<<<<<<<<< * """ * Returns the ID of a dummy node. */ - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_dummy_node, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_dummy_node, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 168, __pyx_L1_error) - /* "gedlibpy.pyx":1375 + /* "gedlibpy.pyx":1400 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1400, __pyx_L1_error) - /* "gedlibpy.pyx":1392 + /* "gedlibpy.pyx":1417 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1392, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1392, __pyx_L1_error) + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1417, __pyx_L1_error) - /* "gedlibpy.pyx":1409 + /* "gedlibpy.pyx":1434 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1434, __pyx_L1_error) - /* "gedlibpy.pyx":1423 + /* "gedlibpy.pyx":1448 * ######################################### * * def encode_your_map(map_u): # <<<<<<<<<<<<<< * """ * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions. */ - __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_map_u, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_map_u, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_encode_your_map, 1423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_encode_your_map, 1448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1448, __pyx_L1_error) - /* "gedlibpy.pyx":1441 + /* "gedlibpy.pyx":1466 * * * def decode_your_map(map_b): # <<<<<<<<<<<<<< * """ * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings. */ - __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_map_b, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_map_b, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1466, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_your_map, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_your_map, 1466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1466, __pyx_L1_error) - /* "gedlibpy.pyx":1459 + /* "gedlibpy.pyx":1484 * * * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<< * """ * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings. */ - __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_map_edge_b, __pyx_n_s_map_edges, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1459, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_map_edge_b, __pyx_n_s_map_edges, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_graph_edges, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1459, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_graph_edges, 1484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20531,6 +21465,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -20572,15 +21507,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8gedlibpy_GEDEnv.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8gedlibpy_GEDEnv.tp_dictoffset && __pyx_type_8gedlibpy_GEDEnv.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8gedlibpy_GEDEnv.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_ptype_8gedlibpy_GEDEnv = &__pyx_type_8gedlibpy_GEDEnv; __Pyx_RefNannyFinishContext(); return 0; @@ -20861,568 +21796,601 @@ if (!__Pyx_RefNanny) { /* "gedlibpy.pyx":115 * ############################# * + * import numpy as np # <<<<<<<<<<<<<< + * import networkx as nx + * from gklearn.ged.env import NodeMap + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gedlibpy.pyx":116 + * + * import numpy as np * import networkx as nx # <<<<<<<<<<<<<< + * from gklearn.ged.env import NodeMap + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gedlibpy.pyx":117 + * import numpy as np + * import networkx as nx + * from gklearn.ged.env import NodeMap # <<<<<<<<<<<<<< * * # import librariesImport */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_INCREF(__pyx_n_s_NodeMap); + __Pyx_GIVEREF(__pyx_n_s_NodeMap); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NodeMap); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gklearn_ged_env, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NodeMap, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "gedlibpy.pyx":118 + /* "gedlibpy.pyx":120 * * # import librariesImport * from ctypes import * # <<<<<<<<<<<<<< * import os * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s__20); __Pyx_GIVEREF(__pyx_n_s__20); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__20); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__20); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_import_star(__pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":119 + /* "gedlibpy.pyx":121 * # import librariesImport * from ctypes import * * import os # <<<<<<<<<<<<<< * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":120 + /* "gedlibpy.pyx":122 * from ctypes import * * import os * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') # <<<<<<<<<<<<<< * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cdll); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_fann_libdoublefann_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_fann_libdoublefann_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":121 + /* "gedlibpy.pyx":123 * import os * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') # <<<<<<<<<<<<<< * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_realpath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_lib_libsvm_3_22_libsvm_so); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_lib_libsvm_3_22_libsvm_so); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_2) < 0) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_1) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":122 + /* "gedlibpy.pyx":124 * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') # <<<<<<<<<<<<<< * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cdll); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_nomad_libnomad_so); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_nomad_libnomad_so); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":123 + /* "gedlibpy.pyx":125 * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_lib_nomad_libsgtelib_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_lib_nomad_libsgtelib_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":126 + /* "gedlibpy.pyx":128 * * * def get_edit_cost_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents edit cost functions and returns the result. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_1get_edit_cost_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_1get_edit_cost_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":140 + /* "gedlibpy.pyx":142 * * * def get_method_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents method for edit distance computation between graphs and returns the result. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_3get_method_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_3get_method_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":153 + /* "gedlibpy.pyx":155 * * * def get_init_options() : # <<<<<<<<<<<<<< * """ * Searchs the differents initialization parameters for the environment computation for graphs and returns the result. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_5get_init_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_5get_init_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_1) < 0) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":166 + /* "gedlibpy.pyx":168 * * * def get_dummy_node() : # <<<<<<<<<<<<<< * """ * Returns the ID of a dummy node. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_7get_dummy_node, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_7get_dummy_node, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_1) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":483 + /* "gedlibpy.pyx":485 * * * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<< * """ * Sets an edit cost function to the environment, if it exists. */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_k__2 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "gedlibpy.pyx":502 + /* "gedlibpy.pyx":504 * * * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<< * """ * Sets an personal edit cost function to the environment. */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_k__3 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "gedlibpy.pyx":1352 + /* "gedlibpy.pyx":1377 * ##################################################################### * * list_of_edit_cost_options = get_edit_cost_options() # <<<<<<<<<<<<<< * list_of_method_options = get_method_options() * list_of_init_options = get_init_options() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "gedlibpy.pyx":1353 + /* "gedlibpy.pyx":1378 * * list_of_edit_cost_options = get_edit_cost_options() * list_of_method_options = get_method_options() # <<<<<<<<<<<<<< * list_of_init_options = get_init_options() * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_2) < 0) __PYX_ERR(0, 1353, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1354 + /* "gedlibpy.pyx":1379 * list_of_edit_cost_options = get_edit_cost_options() * list_of_method_options = get_method_options() * list_of_init_options = get_init_options() # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "gedlibpy.pyx":1361 + /* "gedlibpy.pyx":1386 * ##################### * * class Error(Exception): # <<<<<<<<<<<<<< * """ * Class for error's management. This one is general. */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_5, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_error_s_management_Th); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Error, __pyx_t_5, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_error_s_management_Th); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_t_5, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "gedlibpy.pyx":1368 + /* "gedlibpy.pyx":1393 * * * class EditCostError(Error) : # <<<<<<<<<<<<<< * """ * Class for Edit Cost Error. Raise an error if an edit cost function doesn't exist in the library (not in list_of_edit_cost_options). */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_EditCostError, __pyx_n_s_EditCostError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Edit_Cost_Error_Raise); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __pyx_n_s_EditCostError, __pyx_n_s_EditCostError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Edit_Cost_Error_Raise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "gedlibpy.pyx":1375 + /* "gedlibpy.pyx":1400 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_13EditCostError_1__init__, 0, __pyx_n_s_EditCostError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_13EditCostError_1__init__, 0, __pyx_n_s_EditCostError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1368 + /* "gedlibpy.pyx":1393 * * * class EditCostError(Error) : # <<<<<<<<<<<<<< * """ * Class for Edit Cost Error. Raise an error if an edit cost function doesn't exist in the library (not in list_of_edit_cost_options). */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_EditCostError, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_EditCostError, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1385 + /* "gedlibpy.pyx":1410 * * * class MethodError(Error) : # <<<<<<<<<<<<<< * """ * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options). */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_5, __pyx_n_s_MethodError, __pyx_n_s_MethodError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Method_Error_Raise_an); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_MethodError, __pyx_n_s_MethodError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Method_Error_Raise_an); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "gedlibpy.pyx":1392 + /* "gedlibpy.pyx":1417 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_11MethodError_1__init__, 0, __pyx_n_s_MethodError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_11MethodError_1__init__, 0, __pyx_n_s_MethodError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1392, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1385 + /* "gedlibpy.pyx":1410 * * * class MethodError(Error) : # <<<<<<<<<<<<<< * """ * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options). */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MethodError, __pyx_t_5, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MethodError, __pyx_t_5, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1385, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "gedlibpy.pyx":1402 + /* "gedlibpy.pyx":1427 * * * class InitError(Error) : # <<<<<<<<<<<<<< * """ * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options). */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_InitError, __pyx_n_s_InitError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Init_Error_Raise_an_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __pyx_n_s_InitError, __pyx_n_s_InitError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Init_Error_Raise_an_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "gedlibpy.pyx":1409 + /* "gedlibpy.pyx":1434 * :type message: string * """ * def __init__(self, message): # <<<<<<<<<<<<<< * """ * Inits the error with its message. */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_9InitError_1__init__, 0, __pyx_n_s_InitError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_9InitError_1__init__, 0, __pyx_n_s_InitError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "gedlibpy.pyx":1402 + /* "gedlibpy.pyx":1427 * * * class InitError(Error) : # <<<<<<<<<<<<<< * """ * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options). */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InitError, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InitError, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1402, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1423 + /* "gedlibpy.pyx":1448 * ######################################### * * def encode_your_map(map_u): # <<<<<<<<<<<<<< * """ * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_2) < 0) __PYX_ERR(0, 1423, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1441 + /* "gedlibpy.pyx":1466 * * * def decode_your_map(map_b): # <<<<<<<<<<<<<< * """ * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_2) < 0) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1466, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "gedlibpy.pyx":1459 + /* "gedlibpy.pyx":1484 * * * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<< * """ * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_2) < 0) __PYX_ERR(0, 1459, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_1) < 0) __PYX_ERR(0, 1484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "gedlibpy.pyx":1 * # distutils: language = c++ # <<<<<<<<<<<<<< * * """ */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "vector.from_py":45 * - * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___") - * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *: # <<<<<<<<<<<<<< + * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___") + * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<< * cdef vector[X] v * for item in o: */ @@ -22696,6 +23664,130 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { + (void)inplace; + (void)zerodivision_check; + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { @@ -23154,6 +24246,20 @@ bad: return module; } +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); @@ -23630,6 +24736,7 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; + op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -23883,6 +24990,7 @@ static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; + m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -23903,7 +25011,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -24007,7 +25115,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } diff --git a/gklearn/gedlib/gedlibpy.cpython-36m-x86_64-linux-gnu.so b/gklearn/gedlib/gedlibpy.cpython-36m-x86_64-linux-gnu.so index e950062..94b9401 100644 Binary files a/gklearn/gedlib/gedlibpy.cpython-36m-x86_64-linux-gnu.so and b/gklearn/gedlib/gedlibpy.cpython-36m-x86_64-linux-gnu.so differ diff --git a/gklearn/gedlib/gedlibpy.pyx b/gklearn/gedlib/gedlibpy.pyx index 288a056..54f24b0 100644 --- a/gklearn/gedlib/gedlibpy.pyx +++ b/gklearn/gedlib/gedlibpy.pyx @@ -35,8 +35,8 @@ from libcpp.pair cimport pair from libcpp.list cimport list #Long unsigned int equivalent -cimport numpy as np -ctypedef np.npy_uint32 UINT32_t +cimport numpy as cnp +ctypedef cnp.npy_uint32 UINT32_t from cpython cimport array @@ -76,14 +76,14 @@ cdef extern from "src/GedLibBind.hpp" namespace "pyged": void runMethod(size_t g, size_t h) except + double getUpperBound(size_t g, size_t h) except + double getLowerBound(size_t g, size_t h) except + - vector[np.npy_uint64] getForwardMap(size_t g, size_t h) except + - vector[np.npy_uint64] getBackwardMap(size_t g, size_t h) except + + vector[cnp.npy_uint64] getForwardMap(size_t g, size_t h) except + + vector[cnp.npy_uint64] getBackwardMap(size_t g, size_t h) except + size_t getNodeImage(size_t g, size_t h, size_t nodeId) except + size_t getNodePreImage(size_t g, size_t h, size_t nodeId) except + double getInducedCost(size_t g, size_t h) except + vector[pair[size_t,size_t]] getNodeMap(size_t g, size_t h) except + vector[vector[int]] getAssignmentMatrix(size_t g, size_t h) except + - vector[vector[np.npy_uint64]] getAllMap(size_t g, size_t h) except + + vector[vector[cnp.npy_uint64]] getAllMap(size_t g, size_t h) except + double getRuntime(size_t g, size_t h) except + bool quasimetricCosts() except + vector[vector[size_t]] hungarianLSAP(vector[vector[size_t]] matrixCost) except + @@ -105,14 +105,16 @@ cdef extern from "src/GedLibBind.hpp" namespace "pyged": map[string, string] getMedianEdgeLabel(vector[map[string, string]] & edge_labels) except + string getInitType() except + # double getNodeCost(size_t label1, size_t label2) except + - void computeInducedCost(size_t g_id, size_t h_id) except + + double computeInducedCost(size_t g_id, size_t h_id, vector[pair[size_t,size_t]]) except + ############################# ##CYTHON WRAPPER INTERFACES## ############################# +import numpy as np import networkx as nx +from gklearn.ged.env import NodeMap # import librariesImport from ctypes import * @@ -726,13 +728,30 @@ cdef class GEDEnv: :type g: size_t :type h: size_t :return: The Node Map between the two selected graph. - :rtype: list[tuple(size_t, size_t)] + :rtype: gklearn.ged.env.NodeMap. .. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_pre_image(), get_assignment_matrix() .. warning:: run_method() between the same two graph must be called before this function. .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example. """ - return self.c_env.getNodeMap(g, h) + map_as_relation = self.c_env.getNodeMap(g, h) + induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. + source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. +# print(source_map) + target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] +# print(target_map) + num_node_source = len([item for item in source_map if item != np.inf]) +# print(num_node_source) + num_node_target = len([item for item in target_map if item != np.inf]) +# print(num_node_target) + + node_map = NodeMap(num_node_source, num_node_target) +# print(node_map.get_forward_map(), node_map.get_backward_map()) + for i in range(len(source_map)): + node_map.add_assignment(source_map[i], target_map[i]) + node_map.set_induced_cost(induced_cost) + + return node_map def get_assignment_matrix(self, g, h) : @@ -1320,7 +1339,7 @@ cdef class GEDEnv: return graph_id - def compute_induced_cost(self, g_id, h_id): + def compute_induced_cost(self, g_id, h_id, node_map): """ Computes the edit cost between two graphs induced by a node map. @@ -1330,19 +1349,25 @@ cdef class GEDEnv: ID of input graph. h_id : int ID of input graph. + node_map: gklearn.ged.env.NodeMap. + The NodeMap instance whose reduced cost will be computed and re-assigned. Returns ------- - None. - - Notes - ----- - The induced edit cost of the node map between `g_id` and `h_id` is implictly computed and stored in `GEDEnv::node_maps_`. - - """ - - cost = 0.0 - self.c_env.computeInducedCost(g_id, h_id) + None. + """ + relation = [] + node_map.as_relation(relation) +# print(relation) + dummy_node = get_dummy_node() +# print(dummy_node) + for i, val in enumerate(relation): + val1 = dummy_node if val[0] == np.inf else val[0] + val2 = dummy_node if val[1] == np.inf else val[1] + relation[i] = tuple((val1, val2)) +# print(relation) + induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) + node_map.set_induced_cost(induced_cost) ##################################################################### diff --git a/gklearn/gedlib/src/GedLibBind.hpp b/gklearn/gedlib/src/GedLibBind.hpp index f1b1e7f..63e0db3 100644 --- a/gklearn/gedlib/src/GedLibBind.hpp +++ b/gklearn/gedlib/src/GedLibBind.hpp @@ -475,8 +475,9 @@ public: * @brief Computes the edit cost between two graphs induced by a node map. * @param[in] g_id ID of input graph. * @param[in] h_id ID of input graph. + * @return Computed induced cost. */ - void computeInducedCost(std::size_t g_id, std::size_t h_id) const; + double computeInducedCost(std::size_t g_id, std::size_t h_id, std::vector> relation) const; // /*! // * @brief Returns node relabeling, insertion, or deletion cost. @@ -492,7 +493,7 @@ public: private: - ged::GEDEnv env; // environment variable + ged::GEDEnv * env_; // environment variable bool initialized; // initialization boolean (because env has one but not accessible) diff --git a/gklearn/gedlib/src/GedLibBind.ipp b/gklearn/gedlib/src/GedLibBind.ipp index 03a5408..2928e0b 100644 --- a/gklearn/gedlib/src/GedLibBind.ipp +++ b/gklearn/gedlib/src/GedLibBind.ipp @@ -277,11 +277,16 @@ std::string toStringVectorInt(std::vector vector) { PyGEDEnv::PyGEDEnv () { - this->env = ged::GEDEnv(); + env_ = new ged::GEDEnv(); this->initialized = false; } -PyGEDEnv::~PyGEDEnv () {} +PyGEDEnv::~PyGEDEnv () { + if (env_ != NULL) { + delete env_; + env_ = NULL; + } +} // bool initialized = false; //Initialization boolean (because Env has one but not accessible). @@ -290,64 +295,68 @@ bool PyGEDEnv::isInitialized() { } void PyGEDEnv::restartEnv() { - this->env = ged::GEDEnv(); + if (env_ != NULL) { + delete env_; + env_ = NULL; + } + env_ = new ged::GEDEnv(); initialized = false; } void PyGEDEnv::loadGXLGraph(const std::string & pathFolder, const std::string & pathXML, bool node_type, bool edge_type) { - std::vector tmp_graph_ids(this->env.load_gxl_graph(pathFolder, pathXML, + std::vector tmp_graph_ids(env_->load_gxl_graph(pathFolder, pathXML, (node_type ? ged::Options::GXLNodeEdgeType::LABELED : ged::Options::GXLNodeEdgeType::UNLABELED), (edge_type ? ged::Options::GXLNodeEdgeType::LABELED : ged::Options::GXLNodeEdgeType::UNLABELED), std::unordered_set(), std::unordered_set())); } std::pair PyGEDEnv::getGraphIds() const { - return this->env.graph_ids(); + return env_->graph_ids(); } std::vector PyGEDEnv::getAllGraphIds() { std::vector listID; - for (std::size_t i = this->env.graph_ids().first; i != this->env.graph_ids().second; i++) { + for (std::size_t i = env_->graph_ids().first; i != env_->graph_ids().second; i++) { listID.push_back(i); } return listID; } const std::string PyGEDEnv::getGraphClass(std::size_t id) const { - return this->env.get_graph_class(id); + return env_->get_graph_class(id); } const std::string PyGEDEnv::getGraphName(std::size_t id) const { - return this->env.get_graph_name(id); + return env_->get_graph_name(id); } std::size_t PyGEDEnv::addGraph(const std::string & graph_name, const std::string & graph_class) { - ged::GEDGraph::GraphID newId = this->env.add_graph(graph_name, graph_class); + ged::GEDGraph::GraphID newId = env_->add_graph(graph_name, graph_class); initialized = false; return std::stoi(std::to_string(newId)); } void PyGEDEnv::addNode(std::size_t graphId, const std::string & nodeId, const std::map & nodeLabel) { - this->env.add_node(graphId, nodeId, nodeLabel); + env_->add_node(graphId, nodeId, nodeLabel); initialized = false; } /*void addEdge(std::size_t graphId, ged::GXLNodeID tail, ged::GXLNodeID head, ged::GXLLabel edgeLabel) { - this->env.add_edge(graphId, tail, head, edgeLabel); + env_->add_edge(graphId, tail, head, edgeLabel); }*/ void PyGEDEnv::addEdge(std::size_t graphId, const std::string & tail, const std::string & head, const std::map & edgeLabel, bool ignoreDuplicates) { - this->env.add_edge(graphId, tail, head, edgeLabel, ignoreDuplicates); + env_->add_edge(graphId, tail, head, edgeLabel, ignoreDuplicates); initialized = false; } void PyGEDEnv::clearGraph(std::size_t graphId) { - this->env.clear_graph(graphId); + env_->clear_graph(graphId); initialized = false; } ged::ExchangeGraph PyGEDEnv::getGraph(std::size_t graphId) const { - return this->env.get_graph(graphId); + return env_->get_graph(graphId); } std::size_t PyGEDEnv::getGraphInternalId(std::size_t graphId) { @@ -379,71 +388,71 @@ std::vector> PyGEDEnv::getGraphAdjacenceMatrix(std::siz } void PyGEDEnv::setEditCost(std::string editCost, std::vector editCostConstants) { - this->env.set_edit_costs(translateEditCost(editCost), editCostConstants); + env_->set_edit_costs(translateEditCost(editCost), editCostConstants); } void PyGEDEnv::setPersonalEditCost(std::vector editCostConstants) { - //this->env.set_edit_costs(Your EditCost Class(editCostConstants)); + //env_->set_edit_costs(Your EditCost Class(editCostConstants)); } // void PyGEDEnv::initEnv() { -// this->env.init(); +// env_->init(); // initialized = true; // } void PyGEDEnv::initEnv(std::string initOption, bool print_to_stdout) { - this->env.init(translateInitOptions(initOption), print_to_stdout); + env_->init(translateInitOptions(initOption), print_to_stdout); initialized = true; } void PyGEDEnv::setMethod(std::string method, const std::string & options) { - this->env.set_method(translateMethod(method), options); + env_->set_method(translateMethod(method), options); } void PyGEDEnv::initMethod() { - this->env.init_method(); + env_->init_method(); } double PyGEDEnv::getInitime() const { - return this->env.get_init_time(); + return env_->get_init_time(); } void PyGEDEnv::runMethod(std::size_t g, std::size_t h) { - this->env.run_method(g, h); + env_->run_method(g, h); } double PyGEDEnv::getUpperBound(std::size_t g, std::size_t h) const { - return this->env.get_upper_bound(g, h); + return env_->get_upper_bound(g, h); } double PyGEDEnv::getLowerBound(std::size_t g, std::size_t h) const { - return this->env.get_lower_bound(g, h); + return env_->get_lower_bound(g, h); } std::vector PyGEDEnv::getForwardMap(std::size_t g, std::size_t h) const { - return this->env.get_node_map(g, h).get_forward_map(); + return env_->get_node_map(g, h).get_forward_map(); } std::vector PyGEDEnv::getBackwardMap(std::size_t g, std::size_t h) const { - return this->env.get_node_map(g, h).get_backward_map(); + return env_->get_node_map(g, h).get_backward_map(); } std::size_t PyGEDEnv::getNodeImage(std::size_t g, std::size_t h, std::size_t nodeId) const { - return this->env.get_node_map(g, h).image(nodeId); + return env_->get_node_map(g, h).image(nodeId); } std::size_t PyGEDEnv::getNodePreImage(std::size_t g, std::size_t h, std::size_t nodeId) const { - return this->env.get_node_map(g, h).pre_image(nodeId); + return env_->get_node_map(g, h).pre_image(nodeId); } double PyGEDEnv::getInducedCost(std::size_t g, std::size_t h) const { - return this->env.get_node_map(g, h).induced_cost(); + return env_->get_node_map(g, h).induced_cost(); } std::vector> PyGEDEnv::getNodeMap(std::size_t g, std::size_t h) { std::vector> res; std::vector relation; - this->env.get_node_map(g, h).as_relation(relation); + env_->get_node_map(g, h).as_relation(relation); for (const auto & assignment : relation) { res.push_back(std::make_pair(assignment.first, assignment.second)); } @@ -493,11 +502,11 @@ std::vector> PyGEDEnv::getAllMap(std::size_t g, s } double PyGEDEnv::getRuntime(std::size_t g, std::size_t h) const { - return this->env.get_runtime(g, h); + return env_->get_runtime(g, h); } bool PyGEDEnv::quasimetricCosts() const { - return this->env.quasimetric_costs(); + return env_->quasimetric_costs(); } std::vector> PyGEDEnv::hungarianLSAP(std::vector> matrixCost) { @@ -542,73 +551,99 @@ std::vector> PyGEDEnv::hungarianLSAPE(std::vectorenv.num_node_labels(); + return env_->num_node_labels(); } std::map PyGEDEnv::getNodeLabel(std::size_t label_id) const { - return this->env.get_node_label(label_id); + return env_->get_node_label(label_id); } std::size_t PyGEDEnv::getNumEdgeLabels() const { - return this->env.num_edge_labels(); + return env_->num_edge_labels(); } std::map PyGEDEnv::getEdgeLabel(std::size_t label_id) const { - return this->env.get_edge_label(label_id); + return env_->get_edge_label(label_id); } // std::size_t PyGEDEnv::getNumNodes(std::size_t graph_id) const { -// return this->env.get_num_nodes(graph_id); +// return env_->get_num_nodes(graph_id); // } double PyGEDEnv::getAvgNumNodes() const { - return this->env.get_avg_num_nodes(); + return env_->get_avg_num_nodes(); } double PyGEDEnv::getNodeRelCost(const std::map & node_label_1, const std::map & node_label_2) const { - return this->env.node_rel_cost(node_label_1, node_label_2); + return env_->node_rel_cost(node_label_1, node_label_2); } double PyGEDEnv::getNodeDelCost(const std::map & node_label) const { - return this->env.node_del_cost(node_label); + return env_->node_del_cost(node_label); } double PyGEDEnv::getNodeInsCost(const std::map & node_label) const { - return this->env.node_ins_cost(node_label); + return env_->node_ins_cost(node_label); } std::map PyGEDEnv::getMedianNodeLabel(const std::vector> & node_labels) const { - return this->env.median_node_label(node_labels); + return env_->median_node_label(node_labels); } double PyGEDEnv::getEdgeRelCost(const std::map & edge_label_1, const std::map & edge_label_2) const { - return this->env.edge_rel_cost(edge_label_1, edge_label_2); + return env_->edge_rel_cost(edge_label_1, edge_label_2); } double PyGEDEnv::getEdgeDelCost(const std::map & edge_label) const { - return this->env.edge_del_cost(edge_label); + return env_->edge_del_cost(edge_label); } double PyGEDEnv::getEdgeInsCost(const std::map & edge_label) const { - return this->env.edge_ins_cost(edge_label); + return env_->edge_ins_cost(edge_label); } std::map PyGEDEnv::getMedianEdgeLabel(const std::vector> & edge_labels) const { - return this->env.median_edge_label(edge_labels); + return env_->median_edge_label(edge_labels); } std::string PyGEDEnv::getInitType() const { - return initOptionsToString(this->env.get_init_type()); + return initOptionsToString(env_->get_init_type()); } -void PyGEDEnv::computeInducedCost(std::size_t g_id, std::size_t h_id) const { - ged::NodeMap node_map = this->env.get_node_map(g_id, h_id); - this->env.compute_induced_cost(g_id, h_id, node_map); +double PyGEDEnv::computeInducedCost(std::size_t g_id, std::size_t h_id, std::vector> relation) const { + ged::NodeMap node_map = ged::NodeMap(env_->get_num_nodes(g_id), env_->get_num_nodes(h_id)); + for (const auto & assignment : relation) { + node_map.add_assignment(assignment.first, assignment.second); + // std::cout << assignment.first << assignment.second << endl; + } + const std::vector forward_map = node_map.get_forward_map(); + for (std::size_t i{0}; i < node_map.num_source_nodes(); i++) { + if (forward_map.at(i) == ged::GEDGraph::undefined_node()) { + node_map.add_assignment(i, ged::GEDGraph::dummy_node()); + } + } + const std::vector backward_map = node_map.get_backward_map(); + for (std::size_t i{0}; i < node_map.num_target_nodes(); i++) { + if (backward_map.at(i) == ged::GEDGraph::undefined_node()) { + node_map.add_assignment(ged::GEDGraph::dummy_node(), i); + } + } + // for (auto & map : node_map.get_forward_map()) { + // std::cout << map << ", "; + // } + // std::cout << endl; + // for (auto & map : node_map.get_backward_map()) { + // std::cout << map << ", "; + // } + env_->compute_induced_cost(g_id, h_id, node_map); + return node_map.induced_cost(); } + + // double PyGEDEnv::getNodeCost(std::size_t label1, std::size_t label2) const { -// return this->env.ged_data_node_cost(label1, label2); +// return env_->ged_data_node_cost(label1, label2); // } @@ -630,7 +665,7 @@ void PyGEDEnv::computeInducedCost(std::size_t g_id, std::size_t h_id) const { /*loadGXLGraph(pathFolder, pathXML); std::vector graph_ids = getAllGraphIds(); - std::size_t median_id = this->env.add_graph("median", ""); + std::size_t median_id = env_->add_graph("median", ""); initEnv(initOption); @@ -640,10 +675,10 @@ void PyGEDEnv::computeInducedCost(std::size_t g_id, std::size_t h_id) const { median_estimator.set_options("--init-type RANDOM --randomness PSEUDO --seed " + seed); median_estimator.run(graph_ids, median_id); std::string gxl_file_name("../output/gen_median_Letter_HIGH_" + letter_class + ".gxl"); - this->env.save_as_gxl_graph(median_id, gxl_file_name);*/ + env_->save_as_gxl_graph(median_id, gxl_file_name);*/ /*std::string tikz_file_name("../output/gen_median_Letter_HIGH_" + letter_class + ".tex"); - save_letter_graph_as_tikz_file(this->env.get_graph(median_id), tikz_file_name);*/ + save_letter_graph_as_tikz_file(env_->get_graph(median_id), tikz_file_name);*/ //} } diff --git a/gklearn/kernels/__init__.py b/gklearn/kernels/__init__.py index 52df2b6..bcb7b06 100644 --- a/gklearn/kernels/__init__.py +++ b/gklearn/kernels/__init__.py @@ -12,4 +12,4 @@ from gklearn.kernels.structural_sp import StructuralSP from gklearn.kernels.shortest_path import ShortestPath from gklearn.kernels.path_up_to_h import PathUpToH from gklearn.kernels.treelet import Treelet -from gklearn.kernels.weisfeiler_lehman import WeisfeilerLehman +from gklearn.kernels.weisfeiler_lehman import WeisfeilerLehman, WLSubtree diff --git a/gklearn/kernels/path_up_to_h.py b/gklearn/kernels/path_up_to_h.py index b23687c..8952764 100644 --- a/gklearn/kernels/path_up_to_h.py +++ b/gklearn/kernels/path_up_to_h.py @@ -18,6 +18,7 @@ import numpy as np import networkx as nx from collections import Counter from functools import partial +from gklearn.utils import SpecialLabel from gklearn.utils.parallel import parallel_gm, parallel_me from gklearn.kernels import GraphKernel from gklearn.utils import Trie @@ -582,11 +583,11 @@ class PathUpToH(GraphKernel): # @todo: add function for k_func == None def __add_dummy_labels(self, Gn): if self.__k_func is not None: - if len(self.__node_labels) == 0: - for G in Gn: - nx.set_node_attributes(G, '0', 'dummy') - self.__node_labels.append('dummy') - if len(self.__edge_labels) == 0: - for G in Gn: - nx.set_edge_attributes(G, '0', 'dummy') - self.__edge_labels.append('dummy') \ No newline at end of file + if len(self.__node_labels) == 0 or (len(self.__node_labels) == 1 and self.__node_labels[0] == SpecialLabel.DUMMY): + for i in range(len(Gn)): + nx.set_node_attributes(Gn[i], '0', SpecialLabel.DUMMY) + self.__node_labels = [SpecialLabel.DUMMY] + if len(self.__edge_labels) == 0 or (len(self.__edge_labels) == 1 and self.__edge_labels[0] == SpecialLabel.DUMMY): + for i in range(len(Gn)): + nx.set_edge_attributes(Gn[i], '0', SpecialLabel.DUMMY) + self.__edge_labels = [SpecialLabel.DUMMY] \ No newline at end of file diff --git a/gklearn/kernels/treelet.py b/gklearn/kernels/treelet.py index 134c683..e05ee0c 100644 --- a/gklearn/kernels/treelet.py +++ b/gklearn/kernels/treelet.py @@ -18,6 +18,7 @@ import numpy as np import networkx as nx from collections import Counter from itertools import chain +from gklearn.utils import SpecialLabel from gklearn.utils.parallel import parallel_gm, parallel_me from gklearn.utils.utils import find_all_paths, get_mlti_dim_node_attrs from gklearn.kernels import GraphKernel @@ -495,11 +496,11 @@ class Treelet(GraphKernel): def __add_dummy_labels(self, Gn): - if len(self.__node_labels) == 0: - for G in Gn: - nx.set_node_attributes(G, '0', 'dummy') - self.__node_labels.append('dummy') - if len(self.__edge_labels) == 0: - for G in Gn: - nx.set_edge_attributes(G, '0', 'dummy') - self.__edge_labels.append('dummy') \ No newline at end of file + if len(self.__node_labels) == 0 or (len(self.__node_labels) == 1 and self.__node_labels[0] == SpecialLabel.DUMMY): + for i in range(len(Gn)): + nx.set_node_attributes(Gn[i], '0', SpecialLabel.DUMMY) + self.__node_labels = [SpecialLabel.DUMMY] + if len(self.__edge_labels) == 0 or (len(self.__edge_labels) == 1 and self.__edge_labels[0] == SpecialLabel.DUMMY): + for i in range(len(Gn)): + nx.set_edge_attributes(Gn[i], '0', SpecialLabel.DUMMY) + self.__edge_labels = [SpecialLabel.DUMMY] \ No newline at end of file diff --git a/gklearn/kernels/weisfeiler_lehman.py b/gklearn/kernels/weisfeiler_lehman.py index 4ecb13f..f5f4145 100644 --- a/gklearn/kernels/weisfeiler_lehman.py +++ b/gklearn/kernels/weisfeiler_lehman.py @@ -16,6 +16,7 @@ import numpy as np import networkx as nx from collections import Counter from functools import partial +from gklearn.utils import SpecialLabel from gklearn.utils.parallel import parallel_gm from gklearn.kernels import GraphKernel @@ -32,6 +33,10 @@ class WeisfeilerLehman(GraphKernel): # @todo: total parallelization and sp, edge def _compute_gm_series(self): + if self._verbose >= 2: + import warnings + warnings.warn('A part of the computation is parallelized.') + self.__add_dummy_node_labels(self._graphs) # for WL subtree kernel @@ -55,11 +60,16 @@ class WeisfeilerLehman(GraphKernel): # @todo: total parallelization and sp, edge def _compute_gm_imap_unordered(self): if self._verbose >= 2: - raise Warning('Only a part of the computation is parallelized due to the structure of this kernel.') + import warnings + warnings.warn('Only a part of the computation is parallelized due to the structure of this kernel.') return self._compute_gm_series() def _compute_kernel_list_series(self, g1, g_list): # @todo: this should be better. + if self._verbose >= 2: + import warnings + warnings.warn('A part of the computation is parallelized.') + self.__add_dummy_node_labels(g_list + [g1]) # for WL subtree kernel @@ -83,8 +93,9 @@ class WeisfeilerLehman(GraphKernel): # @todo: total parallelization and sp, edge def _compute_kernel_list_imap_unordered(self, g1, g_list): if self._verbose >= 2: - raise Warning('Only a part of the computation is parallelized due to the structure of this kernel.') - return self._compute_gm_imap_unordered() + import warnings + warnings.warn('Only a part of the computation is parallelized due to the structure of this kernel.') + return self._compute_kernel_list_series(g1, g_list) def _wrapper_kernel_list_do(self, itr): @@ -459,7 +470,14 @@ class WeisfeilerLehman(GraphKernel): # @todo: total parallelization and sp, edge def __add_dummy_node_labels(self, Gn): - if len(self.__node_labels) == 0: - for G in Gn: - nx.set_node_attributes(G, '0', 'dummy') - self.__node_labels.append('dummy') \ No newline at end of file + if len(self.__node_labels) == 0 or (len(self.__node_labels) == 1 and self.__node_labels[0] == SpecialLabel.DUMMY): + for i in range(len(Gn)): + nx.set_node_attributes(Gn[i], '0', SpecialLabel.DUMMY) + self.__node_labels = [SpecialLabel.DUMMY] + + +class WLSubtree(WeisfeilerLehman): + + def __init__(self, **kwargs): + kwargs['base_kernel'] = 'subtree' + super().__init__(**kwargs) \ No newline at end of file diff --git a/gklearn/preimage/experiments/xp_median_preimage.py b/gklearn/preimage/experiments/xp_median_preimage.py index 903faaa..303cdc8 100644 --- a/gklearn/preimage/experiments/xp_median_preimage.py +++ b/gklearn/preimage/experiments/xp_median_preimage.py @@ -7,11 +7,545 @@ Created on Tue Jan 14 15:39:29 2020 """ import multiprocessing import functools +import sys +import os from gklearn.utils.kernels import deltakernel, gaussiankernel, kernelproduct from gklearn.preimage.utils import generate_median_preimages_by_class from gklearn.utils import compute_gram_matrices_by_class +def xp_median_preimage_14_1(): + """xp 14_1: DD, PathUpToH, using CONSTANT. + """ + # set parameters. + ds_name = 'DD' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 2, 1, 1, 1], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + kernel_options = {'name': 'PathUpToH', + 'depth': 2, # + 'k_func': 'MinMax', # + 'compute_method': 'trie', + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'CONSTANT', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 0, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' + irrelevant_labels = None # + edge_required = False # + + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + +# # compute gram matrices for each class a priori. +# print('Compute gram matrices for each class a priori.') +# compute_gram_matrices_by_class(ds_name, kernel_options, save_results=save_results, dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + # print settings. + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_13_1(): + """xp 13_1: PAH, StructuralSP, using NON_SYMBOLIC. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [3, 3, 1, 3, 3, 0], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + mixkernel = functools.partial(kernelproduct, deltakernel, gaussiankernel) + sub_kernels = {'symb': deltakernel, 'nsymb': gaussiankernel, 'mix': mixkernel} + kernel_options = {'name': 'StructuralSP', + 'edge_weight': None, + 'node_kernels': sub_kernels, + 'edge_kernels': sub_kernels, + 'compute_method': 'naive', + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'NON_SYMBOLIC', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' + irrelevant_labels = None # + edge_required = False # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_13_2(): + """xp 13_2: PAH, ShortestPath, using NON_SYMBOLIC. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [3, 3, 1, 3, 3, 0], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + mixkernel = functools.partial(kernelproduct, deltakernel, gaussiankernel) + sub_kernels = {'symb': deltakernel, 'nsymb': gaussiankernel, 'mix': mixkernel} + kernel_options = {'name': 'ShortestPath', + 'edge_weight': None, + 'node_kernels': sub_kernels, + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'NON_SYMBOLIC', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' # + irrelevant_labels = None # + edge_required = True # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs'] + ['random'] * 5: # + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_12_1(): + """xp 12_1: PAH, StructuralSP, using NON_SYMBOLIC, unlabeled. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 0, 1, 1, 0], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + mixkernel = functools.partial(kernelproduct, deltakernel, gaussiankernel) + sub_kernels = {'symb': deltakernel, 'nsymb': gaussiankernel, 'mix': mixkernel} + kernel_options = {'name': 'StructuralSP', + 'edge_weight': None, + 'node_kernels': sub_kernels, + 'edge_kernels': sub_kernels, + 'compute_method': 'naive', + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'NON_SYMBOLIC', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.unlabeled/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # + edge_required = False # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_12_2(): + """xp 12_2: PAH, PathUpToH, using CONSTANT, unlabeled. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 2, 1, 1, 1], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + kernel_options = {'name': 'PathUpToH', + 'depth': 1, # + 'k_func': 'MinMax', # + 'compute_method': 'trie', + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'CONSTANT', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.unlabeled/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # + edge_required = False # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_12_3(): + """xp 12_3: PAH, Treelet, using CONSTANT, unlabeled. + """ + from gklearn.utils.kernels import gaussiankernel + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 2, 1, 1, 1], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + pkernel = functools.partial(gaussiankernel, gamma=None) # @todo + kernel_options = {'name': 'Treelet', # + 'sub_kernel': pkernel, + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'CONSTANT', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.unlabeled/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # + edge_required = False # + + # print settings. + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_12_4(): + """xp 12_4: PAH, WeisfeilerLehman, using CONSTANT, unlabeled. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 2, 1, 1, 1], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, # + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + kernel_options = {'name': 'WeisfeilerLehman', + 'height': 14, + 'base_kernel': 'subtree', + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'CONSTANT', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.unlabeled/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # + edge_required = False # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + +# # compute gram matrices for each class a priori. +# print('Compute gram matrices for each class a priori.') +# compute_gram_matrices_by_class(ds_name, kernel_options, save_results=True, dir_save=dir_save, irrelevant_labels=irrelevant_labels) + + # generate preimages. + for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + +def xp_median_preimage_12_5(): + """xp 12_5: PAH, ShortestPath, using NON_SYMBOLIC, unlabeled. + """ + # set parameters. + ds_name = 'PAH' # + mpg_options = {'fit_method': 'k-graphs', + 'init_ecc': [4, 4, 0, 1, 1, 0], # + 'ds_name': ds_name, + 'parallel': True, # False + 'time_limit_in_sec': 0, + 'max_itrs': 100, + 'max_itrs_without_update': 3, + 'epsilon_residual': 0.01, + 'epsilon_ec': 0.1, + 'verbose': 2} + mixkernel = functools.partial(kernelproduct, deltakernel, gaussiankernel) + sub_kernels = {'symb': deltakernel, 'nsymb': gaussiankernel, 'mix': mixkernel} + kernel_options = {'name': 'ShortestPath', + 'edge_weight': None, + 'node_kernels': sub_kernels, + 'parallel': 'imap_unordered', + # 'parallel': None, + 'n_jobs': multiprocessing.cpu_count(), + 'normalize': True, + 'verbose': 2} + ged_options = {'method': 'IPFP', + 'initialization_method': 'RANDOM', # 'NODE' + 'initial_solutions': 10, # 1 + 'edit_cost': 'NON_SYMBOLIC', # + 'attr_distance': 'euclidean', + 'ratio_runs_from_initial_solutions': 1, + 'threads': multiprocessing.cpu_count(), + 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} + mge_options = {'init_type': 'MEDOID', + 'random_inits': 10, + 'time_limit': 600, + 'verbose': 2, + 'update_order': False, + 'refine': False} + save_results = True + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.unlabeled/' # + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # + edge_required = True # + + # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output + print('parameters:') + print('dataset name:', ds_name) + print('mpg_options:', mpg_options) + print('kernel_options:', kernel_options) + print('ged_options:', ged_options) + print('mge_options:', mge_options) + print('save_results:', save_results) + print('irrelevant_labels:', irrelevant_labels) + print() + + # generate preimages. + for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: # + print('\n-------------------------------------') + print('fit method:', fit_method, '\n') + mpg_options['fit_method'] = fit_method + generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=save_results, save_medians=True, plot_medians=True, load_gm='auto', dir_save=dir_save, irrelevant_labels=irrelevant_labels, edge_required=edge_required) + + def xp_median_preimage_9_1(): """xp 9_1: MAO, StructuralSP, using CONSTANT, symbolic only. """ @@ -51,13 +585,16 @@ def xp_median_preimage_9_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True - dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.symb/' irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -112,13 +649,16 @@ def xp_median_preimage_9_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True - dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.symb/' irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -138,7 +678,7 @@ def xp_median_preimage_9_2(): def xp_median_preimage_9_3(): - """xp 9_3: MAO, Treelet, using CONSTANT. + """xp 9_3: MAO, Treelet, using CONSTANT, symbolic only. """ from gklearn.utils.kernels import polynomialkernel # set parameters. @@ -173,13 +713,16 @@ def xp_median_preimage_9_3(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True - dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' - irrelevant_labels = None # + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.symb/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -199,7 +742,7 @@ def xp_median_preimage_9_3(): def xp_median_preimage_9_4(): - """xp 9_4: MAO, WeisfeilerLehman, using CONSTANT. + """xp 9_4: MAO, WeisfeilerLehman, using CONSTANT, symbolic only. """ # set parameters. ds_name = 'MAO' # @@ -233,13 +776,16 @@ def xp_median_preimage_9_4(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True - dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' - irrelevant_labels = None # + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.symb/' + irrelevant_labels = {'node_attrs': ['x', 'y', 'z'], 'edge_labels': ['bond_stereo']} # edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -250,6 +796,10 @@ def xp_median_preimage_9_4(): print('irrelevant_labels:', irrelevant_labels) print() +# # compute gram matrices for each class a priori. +# print('Compute gram matrices for each class a priori.') +# compute_gram_matrices_by_class(ds_name, kernel_options, save_results=True, dir_save=dir_save, irrelevant_labels=irrelevant_labels) + # generate preimages. for fit_method in ['k-graphs', 'expert'] + ['random'] * 5: print('\n-------------------------------------') @@ -297,6 +847,7 @@ def xp_median_preimage_8_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -304,6 +855,8 @@ def xp_median_preimage_8_1(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -358,6 +911,7 @@ def xp_median_preimage_8_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -365,6 +919,8 @@ def xp_median_preimage_8_2(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -419,6 +975,7 @@ def xp_median_preimage_8_3(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -426,6 +983,8 @@ def xp_median_preimage_8_3(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -479,6 +1038,7 @@ def xp_median_preimage_8_4(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -486,6 +1046,8 @@ def xp_median_preimage_8_4(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -543,6 +1105,7 @@ def xp_median_preimage_7_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -550,6 +1113,8 @@ def xp_median_preimage_7_1(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -604,6 +1169,7 @@ def xp_median_preimage_7_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -611,6 +1177,8 @@ def xp_median_preimage_7_2(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -665,6 +1233,7 @@ def xp_median_preimage_7_3(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -672,6 +1241,8 @@ def xp_median_preimage_7_3(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -725,6 +1296,7 @@ def xp_median_preimage_7_4(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -732,6 +1304,8 @@ def xp_median_preimage_7_4(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -789,6 +1363,7 @@ def xp_median_preimage_6_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -796,6 +1371,8 @@ def xp_median_preimage_6_1(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -851,6 +1428,7 @@ def xp_median_preimage_6_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -858,6 +1436,10 @@ def xp_median_preimage_6_2(): edge_required = True # # print settings. + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -915,6 +1497,7 @@ def xp_median_preimage_5_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -922,6 +1505,8 @@ def xp_median_preimage_5_1(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -979,6 +1564,7 @@ def xp_median_preimage_4_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -986,6 +1572,8 @@ def xp_median_preimage_4_1(): edge_required = False # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1010,7 +1598,7 @@ def xp_median_preimage_3_2(): # set parameters. ds_name = 'Fingerprint' # mpg_options = {'fit_method': 'k-graphs', - 'init_ecc': [0.525, 0.525, 0.001, 0.125, 0.125], # + 'init_ecc': [0.525, 0.525, 0.01, 0.125, 0.125], # 'ds_name': ds_name, 'parallel': True, # False 'time_limit_in_sec': 0, @@ -1041,6 +1629,7 @@ def xp_median_preimage_3_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -1048,6 +1637,10 @@ def xp_median_preimage_3_2(): edge_required = True # # print settings. + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1072,7 +1665,7 @@ def xp_median_preimage_3_1(): # set parameters. ds_name = 'Fingerprint' # mpg_options = {'fit_method': 'k-graphs', - 'init_ecc': [0.525, 0.525, 0.001, 0.125, 0.125], # + 'init_ecc': [0.525, 0.525, 0.01, 0.125, 0.125], # 'ds_name': ds_name, 'parallel': True, # False 'time_limit_in_sec': 0, @@ -1105,6 +1698,7 @@ def xp_median_preimage_3_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -1112,6 +1706,10 @@ def xp_median_preimage_3_1(): edge_required = False # # print settings. + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1167,14 +1765,19 @@ def xp_median_preimage_2_1(): 'init_option': 'EAGER_WITHOUT_SHUFFLED_COPIES'} mge_options = {'init_type': 'MEDOID', 'random_inits': 10, - 'time_limit': 600, + 'time_limit': 0, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True - dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' + dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '.node_attrs/' irrelevant_labels = {'edge_labels': ['valence']} # print settings. + if not os.path.exists(dir_save): + os.makedirs(dir_save) + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1236,11 +1839,14 @@ def xp_median_preimage_1_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1294,6 +1900,7 @@ def xp_median_preimage_1_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -1301,6 +1908,8 @@ def xp_median_preimage_1_2(): edge_required = True # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1358,11 +1967,14 @@ def xp_median_preimage_10_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1416,6 +2028,7 @@ def xp_median_preimage_10_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -1423,6 +2036,8 @@ def xp_median_preimage_10_2(): edge_required = True # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1480,11 +2095,14 @@ def xp_median_preimage_11_1(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1538,6 +2156,7 @@ def xp_median_preimage_11_2(): 'random_inits': 10, 'time_limit': 600, 'verbose': 2, + 'update_order': False, 'refine': False} save_results = True dir_save = '../results/xp_median_preimage/' + ds_name + '.' + kernel_options['name'] + '/' @@ -1545,6 +2164,8 @@ def xp_median_preimage_11_2(): edge_required = True # # print settings. + file_output = open(dir_save + 'output.txt', 'a') + sys.stdout = file_output print('parameters:') print('dataset name:', ds_name) print('mpg_options:', mpg_options) @@ -1565,77 +2186,201 @@ def xp_median_preimage_11_2(): if __name__ == "__main__": - #### xp 1_1: Letter-high, StructuralSP. +# #### xp 1_1: Letter-high, StructuralSP. +# # xp_median_preimage_1_1() + +# #### xp 1_2: Letter-high, ShortestPath. +# # xp_median_preimage_1_2() + +# #### xp 10_1: Letter-med, StructuralSP. +# # xp_median_preimage_10_1() + +# #### xp 10_2: Letter-med, ShortestPath. +# # xp_median_preimage_10_2() + +# #### xp 11_1: Letter-low, StructuralSP. +# # xp_median_preimage_11_1() + +# #### xp 11_2: Letter-low, ShortestPath. +# # xp_median_preimage_11_2() +# +# #### xp 2_1: COIL-DEL, StructuralSP, using LETTER2, only node attrs. +# # xp_median_preimage_2_1() +# +# #### xp 3_1: Fingerprint, StructuralSP, using LETTER2, only node attrs. +# # xp_median_preimage_3_1() + +# #### xp 3_2: Fingerprint, ShortestPath, using LETTER2, only node attrs. + # xp_median_preimage_3_2() + +# #### xp 4_1: COLORS-3, StructuralSP, using NON_SYMBOLIC. +# # xp_median_preimage_4_1() +# +# #### xp 5_1: FRANKENSTEIN, StructuralSP, using NON_SYMBOLIC. +# # xp_median_preimage_5_1() +# +# #### xp 6_1: COIL-RAG, StructuralSP, using NON_SYMBOLIC. +# # xp_median_preimage_6_1() + +# #### xp 6_2: COIL-RAG, ShortestPath, using NON_SYMBOLIC. + # xp_median_preimage_6_2() + +# #### xp 7_1: MUTAG, StructuralSP, using CONSTANT. +# # xp_median_preimage_7_1() + +# #### xp 7_2: MUTAG, PathUpToH, using CONSTANT. + # xp_median_preimage_7_2() + +# #### xp 7_3: MUTAG, Treelet, using CONSTANT. +# # xp_median_preimage_7_3() + +# #### xp 7_4: MUTAG, WeisfeilerLehman, using CONSTANT. +# xp_median_preimage_7_4() +# +# #### xp 8_1: Monoterpenoides, StructuralSP, using CONSTANT. +# # xp_median_preimage_8_1() + +# #### xp 8_2: Monoterpenoides, PathUpToH, using CONSTANT. +# # xp_median_preimage_8_2() + +# #### xp 8_3: Monoterpenoides, Treelet, using CONSTANT. +# # xp_median_preimage_8_3() + +# #### xp 8_4: Monoterpenoides, WeisfeilerLehman, using CONSTANT. +# xp_median_preimage_8_4() + +# #### xp 9_1: MAO, StructuralSP, using CONSTANT, symbolic only. + # xp_median_preimage_9_1() + +# #### xp 9_2: MAO, PathUpToH, using CONSTANT, symbolic only. + # xp_median_preimage_9_2() + +# #### xp 9_3: MAO, Treelet, using CONSTANT, symbolic only. + # xp_median_preimage_9_3() + +# #### xp 9_4: MAO, WeisfeilerLehman, using CONSTANT, symbolic only. + # xp_median_preimage_9_4() + + #### xp 12_1: PAH, StructuralSP, using NON_SYMBOLIC, unlabeled. + # xp_median_preimage_12_1() + + #### xp 12_2: PAH, PathUpToH, using CONSTANT, unlabeled. + # xp_median_preimage_12_2() + + #### xp 12_3: PAH, Treelet, using CONSTANT, unlabeled. +# xp_median_preimage_12_3() + + #### xp 12_4: PAH, WeisfeilerLehman, using CONSTANT, unlabeled. + # xp_median_preimage_12_4() + + #### xp 12_5: PAH, ShortestPath, using NON_SYMBOLIC, unlabeled. + # xp_median_preimage_12_5() + + #### xp 13_1: PAH, StructuralSP, using NON_SYMBOLIC. + # xp_median_preimage_13_1() + + #### xp 13_2: PAH, ShortestPath, using NON_SYMBOLIC. +# xp_median_preimage_13_2() + + #### xp 14_1: DD, PathUpToH, using CONSTANT. + xp_median_preimage_14_1() + + + + +# #### xp 1_1: Letter-high, StructuralSP. # xp_median_preimage_1_1() - #### xp 1_2: Letter-high, ShortestPath. -# xp_median_preimage_1_2() +# #### xp 1_2: Letter-high, ShortestPath. + # xp_median_preimage_1_2() - #### xp 10_1: Letter-med, StructuralSP. +# #### xp 10_1: Letter-med, StructuralSP. # xp_median_preimage_10_1() - #### xp 10_2: Letter-med, ShortestPath. +# #### xp 10_2: Letter-med, ShortestPath. # xp_median_preimage_10_2() - #### xp 11_1: Letter-low, StructuralSP. +# #### xp 11_1: Letter-low, StructuralSP. # xp_median_preimage_11_1() - #### xp 11_2: Letter-low, ShortestPath. -# xp_median_preimage_11_2() - - #### xp 2_1: COIL-DEL, StructuralSP, using LETTER2, only node attrs. -# xp_median_preimage_2_1() - - #### xp 3_1: Fingerprint, StructuralSP, using LETTER2, only node attrs. +# #### xp 11_2: Letter-low, ShortestPath. + # xp_median_preimage_11_2() +# +# #### xp 2_1: COIL-DEL, StructuralSP, using LETTER2, only node attrs. + # xp_median_preimage_2_1() +# +# #### xp 3_1: Fingerprint, StructuralSP, using LETTER2, only node attrs. # xp_median_preimage_3_1() - #### xp 3_2: Fingerprint, ShortestPath, using LETTER2, only node attrs. -# xp_median_preimage_3_2() +# #### xp 3_2: Fingerprint, ShortestPath, using LETTER2, only node attrs. + # xp_median_preimage_3_2() - #### xp 4_1: COLORS-3, StructuralSP, using NON_SYMBOLIC. -# xp_median_preimage_4_1() - - #### xp 5_1: FRANKENSTEIN, StructuralSP, using NON_SYMBOLIC. -# xp_median_preimage_5_1() - - #### xp 6_1: COIL-RAG, StructuralSP, using NON_SYMBOLIC. +# #### xp 4_1: COLORS-3, StructuralSP, using NON_SYMBOLIC. +# # xp_median_preimage_4_1() +# +# #### xp 5_1: FRANKENSTEIN, StructuralSP, using NON_SYMBOLIC. +# # xp_median_preimage_5_1() +# +# #### xp 6_1: COIL-RAG, StructuralSP, using NON_SYMBOLIC. # xp_median_preimage_6_1() - #### xp 6_2: COIL-RAG, ShortestPath, using NON_SYMBOLIC. -# xp_median_preimage_6_2() +# #### xp 6_2: COIL-RAG, ShortestPath, using NON_SYMBOLIC. + # xp_median_preimage_6_2() - #### xp 7_1: MUTAG, StructuralSP, using CONSTANT. +# #### xp 7_1: MUTAG, StructuralSP, using CONSTANT. # xp_median_preimage_7_1() - #### xp 7_2: MUTAG, PathUpToH, using CONSTANT. +# #### xp 7_2: MUTAG, PathUpToH, using CONSTANT. # xp_median_preimage_7_2() - #### xp 7_3: MUTAG, Treelet, using CONSTANT. +# #### xp 7_3: MUTAG, Treelet, using CONSTANT. # xp_median_preimage_7_3() - #### xp 7_4: MUTAG, WeisfeilerLehman, using CONSTANT. -# xp_median_preimage_7_4() - - #### xp 8_1: Monoterpenoides, StructuralSP, using CONSTANT. -# xp_median_preimage_8_1() +# #### xp 7_4: MUTAG, WeisfeilerLehman, using CONSTANT. + # xp_median_preimage_7_4() +# +# #### xp 8_1: Monoterpenoides, StructuralSP, using CONSTANT. + # xp_median_preimage_8_1() - #### xp 8_2: Monoterpenoides, PathUpToH, using CONSTANT. +# #### xp 8_2: Monoterpenoides, PathUpToH, using CONSTANT. # xp_median_preimage_8_2() - #### xp 8_3: Monoterpenoides, Treelet, using CONSTANT. -# xp_median_preimage_8_3() +# #### xp 8_3: Monoterpenoides, Treelet, using CONSTANT. + # xp_median_preimage_8_3() - #### xp 8_4: Monoterpenoides, WeisfeilerLehman, using CONSTANT. -# xp_median_preimage_8_4() +# #### xp 8_4: Monoterpenoides, WeisfeilerLehman, using CONSTANT. + # xp_median_preimage_8_4() - #### xp 9_1: MAO, StructuralSP, using CONSTANT, symbolic only. -# xp_median_preimage_9_1() +# #### xp 9_1: MAO, StructuralSP, using CONSTANT, symbolic only. + # xp_median_preimage_9_1() - #### xp 9_2: MAO, PathUpToH, using CONSTANT, symbolic only. +# #### xp 9_2: MAO, PathUpToH, using CONSTANT, symbolic only. # xp_median_preimage_9_2() - #### xp 9_3: MAO, Treelet, using CONSTANT. -# xp_median_preimage_9_3() +# #### xp 9_3: MAO, Treelet, using CONSTANT, symbolic only. + # xp_median_preimage_9_3() + +# #### xp 9_4: MAO, WeisfeilerLehman, using CONSTANT, symbolic only. + # xp_median_preimage_9_4() + + #### xp 12_1: PAH, StructuralSP, using NON_SYMBOLIC, unlabeled. + # xp_median_preimage_12_1() + + #### xp 12_2: PAH, PathUpToH, using CONSTANT, unlabeled. + # xp_median_preimage_12_2() + + #### xp 12_3: PAH, Treelet, using CONSTANT, unlabeled. + # xp_median_preimage_12_3() + + #### xp 12_4: PAH, WeisfeilerLehman, using CONSTANT, unlabeled. + # xp_median_preimage_12_4() + + #### xp 12_5: PAH, ShortestPath, using NON_SYMBOLIC, unlabeled. + # xp_median_preimage_12_5() + + #### xp 13_1: PAH, StructuralSP, using NON_SYMBOLIC. + # xp_median_preimage_13_1() + + #### xp 13_2: PAH, ShortestPath, using NON_SYMBOLIC. + # xp_median_preimage_13_2() - #### xp 9_4: MAO, WeisfeilerLehman, using CONSTANT. - xp_median_preimage_9_4() \ No newline at end of file diff --git a/gklearn/preimage/median_preimage_generator.py b/gklearn/preimage/median_preimage_generator.py index f342465..fa1f4db 100644 --- a/gklearn/preimage/median_preimage_generator.py +++ b/gklearn/preimage/median_preimage_generator.py @@ -18,6 +18,7 @@ from gklearn.ged.median import MedianGraphEstimator from gklearn.ged.median import constant_node_costs,mge_options_to_string from gklearn.gedlib import librariesImport, gedlibpy from gklearn.utils import Timer +from gklearn.utils.utils import get_graph_kernel_by_name # from gklearn.utils.dataset import Dataset class MedianPreimageGenerator(PreimageGenerator): @@ -81,7 +82,13 @@ class MedianPreimageGenerator(PreimageGenerator): def run(self): - self.__set_graph_kernel_by_name() + self._graph_kernel = get_graph_kernel_by_name(self._kernel_options['name'], + node_labels=self._dataset.node_labels, + edge_labels=self._dataset.edge_labels, + node_attrs=self._dataset.node_attrs, + edge_attrs=self._dataset.edge_attrs, + ds_infos=self._dataset.get_dataset_infos(keys=['directed']), + kernel_options=self._kernel_options) # record start time. start = time.time() @@ -180,6 +187,10 @@ class MedianPreimageGenerator(PreimageGenerator): results['itrs'] = self.__itrs results['converged'] = self.__converged results['num_updates_ecc'] = self.__num_updates_ecc + results['mge'] = {} + results['mge']['num_decrease_order'] = self.__mge.get_num_times_order_decreased() + results['mge']['num_increase_order'] = self.__mge.get_num_times_order_increased() + results['mge']['num_converged_descents'] = self.__mge.get_num_converged_descents() return results @@ -653,27 +664,27 @@ class MedianPreimageGenerator(PreimageGenerator): ged_env.init(init_option=self.__ged_options['init_option']) # Set up the madian graph estimator. - mge = MedianGraphEstimator(ged_env, constant_node_costs(self.__ged_options['edit_cost'])) - mge.set_refine_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) + self.__mge = MedianGraphEstimator(ged_env, constant_node_costs(self.__ged_options['edit_cost'])) + self.__mge.set_refine_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) options = self.__mge_options.copy() if not 'seed' in options: options['seed'] = int(round(time.time() * 1000)) # @todo: may not work correctly for possible parallel usage. # Select the GED algorithm. - mge.set_options(mge_options_to_string(options)) - mge.set_label_names(node_labels=self._dataset.node_labels, + self.__mge.set_options(mge_options_to_string(options)) + self.__mge.set_label_names(node_labels=self._dataset.node_labels, edge_labels=self._dataset.edge_labels, node_attrs=self._dataset.node_attrs, edge_attrs=self._dataset.edge_attrs) - mge.set_init_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) - mge.set_descent_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) + self.__mge.set_init_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) + self.__mge.set_descent_method(self.__ged_options['method'], ged_options_to_string(self.__ged_options)) # Run the estimator. - mge.run(graph_ids, set_median_id, gen_median_id) + self.__mge.run(graph_ids, set_median_id, gen_median_id) # Get SODs. - self.__sod_set_median = mge.get_sum_of_distances('initialized') - self.__sod_gen_median = mge.get_sum_of_distances('converged') + self.__sod_set_median = self.__mge.get_sum_of_distances('initialized') + self.__sod_gen_median = self.__mge.get_sum_of_distances('converged') # Get median graphs. self.__set_median = ged_env.get_nx_graph(set_median_id) @@ -722,43 +733,6 @@ class MedianPreimageGenerator(PreimageGenerator): print('distance in kernel space for generalized median:', self.__k_dis_gen_median) print('minimum distance in kernel space for each graph in median set:', self.__k_dis_dataset) print('distance in kernel space for each graph in median set:', k_dis_median_set) - - - def __set_graph_kernel_by_name(self): - if self._kernel_options['name'] == 'ShortestPath': - from gklearn.kernels import ShortestPath - self._graph_kernel = ShortestPath(node_labels=self._dataset.node_labels, - node_attrs=self._dataset.node_attrs, - ds_infos=self._dataset.get_dataset_infos(keys=['directed']), - **self._kernel_options) - elif self._kernel_options['name'] == 'StructuralSP': - from gklearn.kernels import StructuralSP - self._graph_kernel = StructuralSP(node_labels=self._dataset.node_labels, - edge_labels=self._dataset.edge_labels, - node_attrs=self._dataset.node_attrs, - edge_attrs=self._dataset.edge_attrs, - ds_infos=self._dataset.get_dataset_infos(keys=['directed']), - **self._kernel_options) - elif self._kernel_options['name'] == 'PathUpToH': - from gklearn.kernels import PathUpToH - self._graph_kernel = PathUpToH(node_labels=self._dataset.node_labels, - edge_labels=self._dataset.edge_labels, - ds_infos=self._dataset.get_dataset_infos(keys=['directed']), - **self._kernel_options) - elif self._kernel_options['name'] == 'Treelet': - from gklearn.kernels import Treelet - self._graph_kernel = Treelet(node_labels=self._dataset.node_labels, - edge_labels=self._dataset.edge_labels, - ds_infos=self._dataset.get_dataset_infos(keys=['directed']), - **self._kernel_options) - elif self._kernel_options['name'] == 'WeisfeilerLehman': - from gklearn.kernels import WeisfeilerLehman - self._graph_kernel = WeisfeilerLehman(node_labels=self._dataset.node_labels, - edge_labels=self._dataset.edge_labels, - ds_infos=self._dataset.get_dataset_infos(keys=['directed']), - **self._kernel_options) - else: - raise Exception('The graph kernel given is not defined. Possible choices include: "StructuralSP", "ShortestPath", "PathUpToH", "Treelet", "WeisfeilerLehman".') # def __clean_graph(self, G, node_labels=[], edge_labels=[], node_attrs=[], edge_attrs=[]): diff --git a/gklearn/preimage/utils.py b/gklearn/preimage/utils.py index 823ecc5..f99ab8a 100644 --- a/gklearn/preimage/utils.py +++ b/gklearn/preimage/utils.py @@ -25,7 +25,7 @@ import networkx as nx import os -def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=True, save_medians=True, plot_medians=True, load_gm='auto', dir_save='', irrelevant_labels=None, edge_required=False): +def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged_options, mge_options, save_results=True, save_medians=True, plot_medians=True, load_gm='auto', dir_save='', irrelevant_labels=None, edge_required=False, cut_range=None): import os.path from gklearn.preimage import MedianPreimageGenerator from gklearn.utils import split_dataset_by_target @@ -38,7 +38,8 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged dataset_all.trim_dataset(edge_required=edge_required) if irrelevant_labels is not None: dataset_all.remove_labels(**irrelevant_labels) -# dataset_all.cut_graphs(range(0, 10)) + if cut_range is not None: + dataset_all.cut_graphs(cut_range) datasets = split_dataset_by_target(dataset_all) if save_results: @@ -57,6 +58,9 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged itrs_list = [] converged_list = [] num_updates_ecc_list = [] + mge_decrease_order_list = [] + mge_increase_order_list = [] + mge_converged_order_list = [] nb_sod_sm2gm = [0, 0, 0] nb_dis_k_sm2gm = [0, 0, 0] nb_dis_k_gi2sm = [0, 0, 0] @@ -148,7 +152,10 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged results['runtime_precompute_gm'], results['runtime_optimize_ec'], results['runtime_generate_preimage'], results['runtime_total'], results['itrs'], results['converged'], - results['num_updates_ecc']]) + results['num_updates_ecc'], + results['mge']['num_decrease_order'] > 0, # @todo: not suitable for multi-start mge + results['mge']['num_increase_order'] > 0, + results['mge']['num_converged_descents'] > 0]) f_detail.close() # compute result summary. @@ -164,6 +171,9 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged itrs_list.append(results['itrs']) converged_list.append(results['converged']) num_updates_ecc_list.append(results['num_updates_ecc']) + mge_decrease_order_list.append(results['mge']['num_decrease_order'] > 0) + mge_increase_order_list.append(results['mge']['num_increase_order'] > 0) + mge_converged_order_list.append(results['mge']['num_converged_descents'] > 0) # # SOD SM -> GM if results['sod_set_median'] > results['sod_gen_median']: nb_sod_sm2gm[0] += 1 @@ -210,7 +220,11 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged results['runtime_precompute_gm'], results['runtime_optimize_ec'], results['runtime_generate_preimage'], results['runtime_total'], results['itrs'], results['converged'], - results['num_updates_ecc'], nb_sod_sm2gm, + results['num_updates_ecc'], + results['mge']['num_decrease_order'] > 0, # @todo: not suitable for multi-start mge + results['mge']['num_increase_order'] > 0, + results['mge']['num_converged_descents'] > 0, + nb_sod_sm2gm, nb_dis_k_sm2gm, nb_dis_k_gi2sm, nb_dis_k_gi2gm]) f_summary.close() @@ -256,6 +270,9 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged itrs_mean = np.mean(itrs_list) num_converged = np.sum(converged_list) num_updates_ecc_mean = np.mean(num_updates_ecc_list) + num_mge_decrease_order = np.sum(mge_decrease_order_list) + num_mge_increase_order = np.sum(mge_increase_order_list) + num_mge_converged = np.sum(mge_converged_order_list) sod_sm2gm_mean = get_relations(np.sign(sod_gm_mean - sod_sm_mean)) dis_k_sm2gm_mean = get_relations(np.sign(dis_k_gm_mean - dis_k_sm_mean)) dis_k_gi2sm_mean = get_relations(np.sign(dis_k_sm_mean - dis_k_gi_min_mean)) @@ -270,7 +287,9 @@ def generate_median_preimages_by_class(ds_name, mpg_options, kernel_options, ged dis_k_gi2sm_mean, dis_k_gi2gm_mean, time_precompute_gm_mean, time_optimize_ec_mean, time_generate_mean, time_total_mean, itrs_mean, - num_converged, num_updates_ecc_mean]) + num_converged, num_updates_ecc_mean, + num_mge_decrease_order, num_mge_increase_order, + num_mge_converged]) f_summary.close() # save total pairwise kernel distances. @@ -300,7 +319,8 @@ def __init_output_file(ds_name, gkernel, fit_method, dir_output): 'min dis_k gi', 'SOD SM -> GM', 'dis_k SM -> GM', 'dis_k gi -> SM', 'dis_k gi -> GM', 'edit cost constants', 'time precompute gm', 'time optimize ec', 'time generate preimage', 'time total', - 'itrs', 'converged', 'num updates ecc']) + 'itrs', 'converged', 'num updates ecc', 'mge decrease order', + 'mge increase order', 'mge converged']) f_detail.close() # fn_output_summary = 'results_summary.' + ds_name + '.' + gkernel + '.' + fit_method + '.csv' @@ -312,7 +332,8 @@ def __init_output_file(ds_name, gkernel, fit_method, dir_output): 'min dis_k gi', 'SOD SM -> GM', 'dis_k SM -> GM', 'dis_k gi -> SM', 'dis_k gi -> GM', 'time precompute gm', 'time optimize ec', 'time generate preimage', 'time total', 'itrs', 'num converged', - 'num updates ecc', '# SOD SM -> GM', '# dis_k SM -> GM', + 'num updates ecc', 'mge num decrease order', 'mge num increase order', + 'mge num converged', '# SOD SM -> GM', '# dis_k SM -> GM', '# dis_k gi -> SM', '# dis_k gi -> GM']) # 'repeats better SOD SM -> GM', # 'repeats better dis_k SM -> GM', 'repeats better dis_k gi -> SM', @@ -418,6 +439,8 @@ def compute_kernel(Gn, graph_kernel, node_label, edge_label, verbose, parallel=' Kmatrix, _ = weisfeilerlehmankernel(Gn, node_label=node_label, edge_label=edge_label, height=4, base_kernel='subtree', parallel=None, n_jobs=multiprocessing.cpu_count(), verbose=verbose) + else: + raise Exception('The graph kernel "', graph_kernel, '" is not defined.') # normalization Kmatrix_diag = Kmatrix.diagonal().copy() diff --git a/gklearn/tests/test_graph_kernels.py b/gklearn/tests/test_graph_kernels.py index bb442f3..59efc88 100644 --- a/gklearn/tests/test_graph_kernels.py +++ b/gklearn/tests/test_graph_kernels.py @@ -260,20 +260,20 @@ def test_Treelet(ds_name, parallel): @pytest.mark.parametrize('ds_name', ['Acyclic']) #@pytest.mark.parametrize('base_kernel', ['subtree', 'sp', 'edge']) -@pytest.mark.parametrize('base_kernel', ['subtree']) +# @pytest.mark.parametrize('base_kernel', ['subtree']) @pytest.mark.parametrize('parallel', ['imap_unordered', None]) -def test_WeisfeilerLehman(ds_name, parallel, base_kernel): - """Test Weisfeiler-Lehman kernel. +def test_WLSubtree(ds_name, parallel): + """Test Weisfeiler-Lehman subtree kernel. """ - from gklearn.kernels import WeisfeilerLehman + from gklearn.kernels import WLSubtree dataset = chooseDataset(ds_name) try: - graph_kernel = WeisfeilerLehman(node_labels=dataset.node_labels, + graph_kernel = WLSubtree(node_labels=dataset.node_labels, edge_labels=dataset.edge_labels, ds_infos=dataset.get_dataset_infos(keys=['directed']), - height=2, base_kernel=base_kernel) + height=2) gram_matrix, run_time = graph_kernel.compute(dataset.graphs, parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True) kernel_list, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1:], diff --git a/gklearn/utils/__init__.py b/gklearn/utils/__init__.py index 79d0a39..198bf75 100644 --- a/gklearn/utils/__init__.py +++ b/gklearn/utils/__init__.py @@ -20,4 +20,5 @@ from gklearn.utils.graph_files import load_dataset, save_dataset from gklearn.utils.timer import Timer from gklearn.utils.utils import get_graph_kernel_by_name from gklearn.utils.utils import compute_gram_matrices_by_class +from gklearn.utils.utils import SpecialLabel from gklearn.utils.trie import Trie diff --git a/gklearn/utils/dataset.py b/gklearn/utils/dataset.py index abd7edd..c499ce2 100644 --- a/gklearn/utils/dataset.py +++ b/gklearn/utils/dataset.py @@ -56,13 +56,14 @@ class Dataset(object): self.__node_attrs = label_names['node_attrs'] self.__edge_labels = label_names['edge_labels'] self.__edge_attrs = label_names['edge_attrs'] + self.clean_labels() def load_graphs(self, graphs, targets=None): # this has to be followed by set_labels(). self.__graphs = graphs self.__targets = targets -# self.set_labels_attrs() +# self.set_labels_attrs() # @todo def load_predefined_dataset(self, ds_name): @@ -89,6 +90,9 @@ class Dataset(object): elif ds_name == 'Cuneiform': ds_file = current_path + '../../datasets/Cuneiform/Cuneiform_A.txt' self.__graphs, self.__targets, label_names = load_dataset(ds_file) + elif ds_name == 'DD': + ds_file = current_path + '../../datasets/DD/DD_A.txt' + self.__graphs, self.__targets, label_names = load_dataset(ds_file) elif ds_name == 'Fingerprint': ds_file = current_path + '../../datasets/Fingerprint/Fingerprint_A.txt' self.__graphs, self.__targets, label_names = load_dataset(ds_file) @@ -113,6 +117,9 @@ class Dataset(object): elif ds_name == 'MUTAG': ds_file = current_path + '../../datasets/MUTAG/MUTAG_A.txt' self.__graphs, self.__targets, label_names = load_dataset(ds_file) + elif ds_name == 'PAH': + ds_file = current_path + '../../datasets/PAH/dataset.ds' + self.__graphs, self.__targets, label_names = load_dataset(ds_file) elif ds_name == 'SYNTHETIC': pass elif ds_name == 'SYNTHETICnew': @@ -120,11 +127,14 @@ class Dataset(object): self.__graphs, self.__targets, label_names = load_dataset(ds_file) elif ds_name == 'Synthie': pass + else: + raise Exception('The dataset name "', ds_name, '" is not pre-defined.') self.__node_labels = label_names['node_labels'] self.__node_attrs = label_names['node_attrs'] self.__edge_labels = label_names['edge_labels'] self.__edge_attrs = label_names['edge_attrs'] + self.clean_labels() def set_labels(self, node_labels=[], node_attrs=[], edge_labels=[], edge_attrs=[]): @@ -138,27 +148,27 @@ class Dataset(object): # @todo: remove labels which have only one possible values. if node_labels is None: self.__node_labels = self.__graphs[0].graph['node_labels'] -# # graphs are considered node unlabeled if all nodes have the same label. -# infos.update({'node_labeled': is_nl if node_label_num > 1 else False}) +# # graphs are considered node unlabeled if all nodes have the same label. +# infos.update({'node_labeled': is_nl if node_label_num > 1 else False}) if node_attrs is None: self.__node_attrs = self.__graphs[0].graph['node_attrs'] -# for G in Gn: -# for n in G.nodes(data=True): -# if 'attributes' in n[1]: -# return len(n[1]['attributes']) -# return 0 +# for G in Gn: +# for n in G.nodes(data=True): +# if 'attributes' in n[1]: +# return len(n[1]['attributes']) +# return 0 if edge_labels is None: self.__edge_labels = self.__graphs[0].graph['edge_labels'] -# # graphs are considered edge unlabeled if all edges have the same label. -# infos.update({'edge_labeled': is_el if edge_label_num > 1 else False}) +# # graphs are considered edge unlabeled if all edges have the same label. +# infos.update({'edge_labeled': is_el if edge_label_num > 1 else False}) if edge_attrs is None: self.__edge_attrs = self.__graphs[0].graph['edge_attrs'] -# for G in Gn: -# if nx.number_of_edges(G) > 0: -# for e in G.edges(data=True): -# if 'attributes' in e[2]: -# return len(e[2]['attributes']) -# return 0 +# for G in Gn: +# if nx.number_of_edges(G) > 0: +# for e in G.edges(data=True): +# if 'attributes' in e[2]: +# return len(e[2]['attributes']) +# return 0 def get_dataset_infos(self, keys=None): @@ -323,7 +333,7 @@ class Dataset(object): if self.__node_label_nums is None: self.__node_label_nums = {} for node_label in self.__node_labels: - self.__node_label_nums[node_label] = self.get_node_label_num(node_label) + self.__node_label_nums[node_label] = self.__get_node_label_num(node_label) infos['node_label_nums'] = self.__node_label_nums if 'edge_label_dim' in keys: @@ -335,7 +345,7 @@ class Dataset(object): if self.__edge_label_nums is None: self.__edge_label_nums = {} for edge_label in self.__edge_labels: - self.__edge_label_nums[edge_label] = self.get_edge_label_num(edge_label) + self.__edge_label_nums[edge_label] = self.__get_edge_label_num(edge_label) infos['edge_label_nums'] = self.__edge_label_nums if 'directed' in keys or 'substructures' in keys: @@ -411,33 +421,95 @@ class Dataset(object): def remove_labels(self, node_labels=[], edge_labels=[], node_attrs=[], edge_attrs=[]): + node_labels = [item for item in node_labels if item in self.__node_labels] + edge_labels = [item for item in edge_labels if item in self.__edge_labels] + node_attrs = [item for item in node_attrs if item in self.__node_attrs] + edge_attrs = [item for item in edge_attrs if item in self.__edge_attrs] + for g in self.__graphs: for nd in g.nodes(): for nl in node_labels: - del g.nodes[nd][nl] + del g.nodes[nd][nl] for na in node_attrs: del g.nodes[nd][na] for ed in g.edges(): for el in edge_labels: - del g.edges[ed][el] + del g.edges[ed][el] for ea in edge_attrs: - del g.edges[ed][ea] + del g.edges[ed][ea] if len(node_labels) > 0: - self.__node_labels = [nl for nl in self.__node_labels if nl not in node_labels] + self.__node_labels = [nl for nl in self.__node_labels if nl not in node_labels] if len(edge_labels) > 0: - self.__edge_labels = [el for el in self.__edge_labels if el not in edge_labels] + self.__edge_labels = [el for el in self.__edge_labels if el not in edge_labels] if len(node_attrs) > 0: - self.__node_attrs = [na for na in self.__node_attrs if na not in node_attrs] + self.__node_attrs = [na for na in self.__node_attrs if na not in node_attrs] if len(edge_attrs) > 0: - self.__edge_attrs = [ea for ea in self.__edge_attrs if ea not in edge_attrs] - + self.__edge_attrs = [ea for ea in self.__edge_attrs if ea not in edge_attrs] + + + def clean_labels(self): + labels = [] + for name in self.__node_labels: + label = set() + for G in self.__graphs: + label = label | set(nx.get_node_attributes(G, name).values()) + if len(label) > 1: + labels.append(name) + break + if len(label) < 2: + for G in self.__graphs: + for nd in G.nodes(): + del G.nodes[nd][name] + self.__node_labels = labels + + labels = [] + for name in self.__edge_labels: + label = set() + for G in self.__graphs: + label = label | set(nx.get_edge_attributes(G, name).values()) + if len(label) > 1: + labels.append(name) + break + if len(label) < 2: + for G in self.__graphs: + for ed in G.edges(): + del G.edges[ed][name] + self.__edge_labels = labels + + labels = [] + for name in self.__node_attrs: + label = set() + for G in self.__graphs: + label = label | set(nx.get_node_attributes(G, name).values()) + if len(label) > 1: + labels.append(name) + break + if len(label) < 2: + for G in self.__graphs: + for nd in G.nodes(): + del G.nodes[nd][name] + self.__node_attrs = labels + + labels = [] + for name in self.__edge_attrs: + label = set() + for G in self.__graphs: + label = label | set(nx.get_edge_attributes(G, name).values()) + if len(label) > 1: + labels.append(name) + break + if len(label) < 2: + for G in self.__graphs: + for ed in G.edges(): + del G.edges[ed][name] + self.__edge_attrs = labels + def cut_graphs(self, range_): self.__graphs = [self.__graphs[i] for i in range_] if self.__targets is not None: self.__targets = [self.__targets[i] for i in range_] - # @todo -# self.set_labels_attrs() + self.clean_labels() def trim_dataset(self, edge_required=False): @@ -448,8 +520,7 @@ class Dataset(object): idx = [p[0] for p in trimed_pairs] self.__graphs = [p[1] for p in trimed_pairs] self.__targets = [self.__targets[i] for i in idx] - # @todo -# self.set_labels_attrs() + self.clean_labels() def __get_dataset_size(self): @@ -652,4 +723,5 @@ def split_dataset_by_target(dataset): sub_dataset.load_graphs(sub_graphs, [key] * len(val)) sub_dataset.set_labels(node_labels=dataset.node_labels, node_attrs=dataset.node_attrs, edge_labels=dataset.edge_labels, edge_attrs=dataset.edge_attrs) datasets.append(sub_dataset) + # @todo: clean_labels? return datasets \ No newline at end of file diff --git a/gklearn/utils/graph_files.py b/gklearn/utils/graph_files.py index ce07a59..d977b73 100644 --- a/gklearn/utils/graph_files.py +++ b/gklearn/utils/graph_files.py @@ -63,7 +63,7 @@ def load_dataset(filename, filename_targets=None, gformat=None, **kwargs): return data, y, label_names -def save_dataset(Gn, y, gformat='gxl', group=None, filename='gfile', xparams=None): +def save_dataset(Gn, y, gformat='gxl', group=None, filename='gfile', **kwargs): """Save list of graphs. """ import os @@ -73,22 +73,22 @@ def save_dataset(Gn, y, gformat='gxl', group=None, filename='gfile', xparams=Non if not os.path.exists(dirname_ds) : os.makedirs(dirname_ds) - if xparams is not None and 'graph_dir' in xparams: - graph_dir = xparams['graph_dir'] + '/' + if 'graph_dir' in kwargs: + graph_dir = kwargs['graph_dir'] + '/' if not os.path.exists(graph_dir): os.makedirs(graph_dir) + del kwargs['graph_dir'] else: graph_dir = dirname_ds if group == 'xml' and gformat == 'gxl': - kwargs = {'method': xparams['method']} if xparams is not None else {} with open(filename + '.xml', 'w') as fgroup: fgroup.write("") fgroup.write("\n") fgroup.write("\n") for idx, g in enumerate(Gn): fname_tmp = "graph" + str(idx) + ".gxl" - saveGXL(g, graph_dir + fname_tmp, **kwargs) + save_gxl(g, graph_dir + fname_tmp, **kwargs) fgroup.write("\n\t") fgroup.write("\n") fgroup.close() @@ -226,7 +226,7 @@ def load_gxl(filename): # @todo: directed graphs. return g, label_names -def saveGXL(graph, filename, method='default', node_labels=[], edge_labels=[], node_attrs=[], edge_attrs=[]): +def save_gxl(graph, filename, method='default', node_labels=[], edge_labels=[], node_attrs=[], edge_attrs=[]): if method == 'default': gxl_file = open(filename, 'w') gxl_file.write("\n") diff --git a/gklearn/utils/utils.py b/gklearn/utils/utils.py index 17954f5..9223b7a 100644 --- a/gklearn/utils/utils.py +++ b/gklearn/utils/utils.py @@ -1,6 +1,7 @@ import networkx as nx import numpy as np from copy import deepcopy +from enum import Enum, auto #from itertools import product # from tqdm import tqdm @@ -299,21 +300,59 @@ def get_edge_labels(Gn, edge_label): def get_graph_kernel_by_name(name, node_labels=None, edge_labels=None, node_attrs=None, edge_attrs=None, ds_infos=None, kernel_options={}): - if name == 'structuralspkernel': + if name == 'ShortestPath': + from gklearn.kernels import ShortestPath + graph_kernel = ShortestPath(node_labels=node_labels, + node_attrs=node_attrs, + ds_infos=ds_infos, + **kernel_options) + elif name == 'StructuralSP': from gklearn.kernels import StructuralSP - graph_kernel = StructuralSP(node_labels=node_labels, edge_labels=edge_labels, - node_attrs=node_attrs, edge_attrs=edge_attrs, - ds_infos=ds_infos, **kernel_options) + graph_kernel = StructuralSP(node_labels=node_labels, + edge_labels=edge_labels, + node_attrs=node_attrs, + edge_attrs=edge_attrs, + ds_infos=ds_infos, + **kernel_options) + elif name == 'PathUpToH': + from gklearn.kernels import PathUpToH + graph_kernel = PathUpToH(node_labels=node_labels, + edge_labels=edge_labels, + ds_infos=ds_infos, + **kernel_options) + elif name == 'Treelet': + from gklearn.kernels import Treelet + graph_kernel = Treelet(node_labels=node_labels, + edge_labels=edge_labels, + ds_infos=ds_infos, + **kernel_options) + elif name == 'WLSubtree': + from gklearn.kernels import WLSubtree + graph_kernel = WLSubtree(node_labels=node_labels, + edge_labels=edge_labels, + ds_infos=ds_infos, + **kernel_options) + elif name == 'WeisfeilerLehman': + from gklearn.kernels import WeisfeilerLehman + graph_kernel = WeisfeilerLehman(node_labels=node_labels, + edge_labels=edge_labels, + ds_infos=ds_infos, + **kernel_options) + else: + raise Exception('The graph kernel given is not defined. Possible choices include: "StructuralSP", "ShortestPath", "PathUpToH", "Treelet", "WLSubtree", "WeisfeilerLehman".') + return graph_kernel -def compute_gram_matrices_by_class(ds_name, kernel_options, save_results=True, dir_save='', irrelevant_labels=None): +def compute_gram_matrices_by_class(ds_name, kernel_options, save_results=True, dir_save='', irrelevant_labels=None, edge_required=False): + import os from gklearn.utils import Dataset, split_dataset_by_target # 1. get dataset. print('1. getting dataset...') dataset_all = Dataset() dataset_all.load_predefined_dataset(ds_name) + dataset_all.trim_dataset(edge_required=edge_required) if not irrelevant_labels is None: dataset_all.remove_labels(**irrelevant_labels) # dataset_all.cut_graphs(range(0, 10)) @@ -349,6 +388,8 @@ def compute_gram_matrices_by_class(ds_name, kernel_options, save_results=True, d print() print('4. saving results...') if save_results: + if not os.path.exists(dir_save): + os.makedirs(dir_save) np.savez(dir_save + 'gram_matrix_unnorm.' + ds_name + '.' + kernel_options['name'] + '.gm', gram_matrix_unnorm_list=gram_matrix_unnorm_list, run_time_list=run_time_list) print('\ncomplete.') @@ -424,4 +465,10 @@ def get_mlti_dim_edge_attrs(G, attr_names): attributes = [] for ed, attrs in G.edges(data=True): attributes.append(tuple(attrs[aname] for aname in attr_names)) - return attributes \ No newline at end of file + return attributes + + +class SpecialLabel(Enum): + """can be used to define special labels. + """ + DUMMY = auto # The dummy label. \ No newline at end of file