dasi.utils.networkx.utils

Functions

compare_matrix_to_true_paths(mat, path_dict, …)

compare_path_rank_order(mat, path_dict, nodelist)

divide(mata, matb)

Divides two matricies, replacing NaN with np.inf.

find_all_min_paths

min_edit_distance(s1, s2)

replace_nan_with_inf(m)

select_from_arrs(A, B, condition)

Returns an ndarray of same shape as A and B, selecting elements from either A or B according to the condition.

sort_cycle(arr[, key])

Sort a cyclic array, maintaining order.

Functions

divide(mata, matb)

Divides two matricies, replacing NaN with np.inf.

select_from_arrs(A, B, condition)

Returns an ndarray of same shape as A and B, selecting elements from either A or B according to the condition.

sort_cycle(arr[, key])

Sort a cyclic array, maintaining order.

dasi.utils.networkx.utils.divide(mata, matb)[source]

Divides two matricies, replacing NaN with np.inf.

dasi.utils.networkx.utils.select_from_arrs(A, B, condition)[source]

Returns an ndarray of same shape as A and B, selecting elements from either A or B according to the condition.

Note

This method is called many thousands of times in the

execution of the modified floyd-warshall algorithm. This implementation is 2X faster than whatever is implemented in np.choose, resulting in significant speed improvements.

dasi.utils.networkx.utils.sort_cycle(arr, key=None)[source]

Sort a cyclic array, maintaining order.