diff --git a/.circleci/config.yml b/.circleci/config.yml index d0e972cc2..00cd876cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2 jobs: build_docs: docker: - - image: cimg/python:3.9 + - image: cimg/python:3.10 resource_class: medium steps: - checkout diff --git a/RELEASES.md b/RELEASES.md index 2f47f4095..595fecfb5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -17,6 +17,8 @@ - Make marginal parameters optional for (F)GW solvers in `._gw`, `._bregman` and `._semirelaxed` (PR #455) #### Closed issues + +- Fix change in scipy API for `cdist` (PR #487) - Fix circleci-redirector action and codecov (PR #460) - Fix issues with cuda for ot.binary_search_circle and with gradients for ot.sliced_wasserstein_sphere (PR #457) - Major documentation cleanup (PR #462, #467, #475) diff --git a/docs/source/conf.py b/docs/source/conf.py index e88804bd6..2131a9d0b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -357,6 +357,7 @@ def __getattr__(cls, name): sphinx_gallery_conf = { 'examples_dirs': ['../../examples', '../../examples/da'], 'gallery_dirs': 'auto_examples', + 'filename_pattern': 'plot_(?!barycenter_fgw)', 'nested_sections' : False, 'backreferences_dir': 'gen_modules/backreferences', 'inspect_global_variables' : True, diff --git a/examples/gromov/plot_barycenter_fgw.py b/examples/gromov/plot_barycenter_fgw.py index 3b5db8b3b..40e5008c8 100644 --- a/examples/gromov/plot_barycenter_fgw.py +++ b/examples/gromov/plot_barycenter_fgw.py @@ -161,7 +161,7 @@ def graph_colors(nx_graph, vmin=0, vmax=7): #%% We compute the barycenter using FGW. Structure matrices are computed using the shortest_path distance in the graph # Features distances are the euclidean distances -Cs = [shortest_path(nx.adjacency_matrix(x)) for x in X0] +Cs = [shortest_path(nx.adjacency_matrix(x, dtype=np.int_)) for x in X0] ps = [np.ones(len(x.nodes())) / len(x.nodes()) for x in X0] Ys = [np.array([v for (k, v) in nx.get_node_attributes(x, 'attr_name').items()]).reshape(-1, 1) for x in X0] lambdas = np.array([np.ones(len(Ys)) / len(Ys)]).ravel() diff --git a/ot/utils.py b/ot/utils.py index 091b26813..1559eaaa6 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -285,7 +285,7 @@ def dist(x1, x2=None, metric='sqeuclidean', p=2, w=None): 'sqeuclidean' or 'euclidean' on all backends. On numpy the function also accepts from the scipy.spatial.distance.cdist function : 'braycurtis', 'canberra', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', - 'euclidean', 'hamming', 'jaccard', 'kulsinski', 'mahalanobis', + 'euclidean', 'hamming', 'jaccard', 'kulczynski1', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'wminkowski', 'yule'. p : float, optional diff --git a/test/test_utils.py b/test/test_utils.py index 87f4dc48d..a726a588c 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -187,7 +187,7 @@ def test_dist(): # tests that every metric runs correctly metrics_w = [ 'braycurtis', 'canberra', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', - 'euclidean', 'hamming', 'jaccard', 'kulsinski', + 'euclidean', 'hamming', 'jaccard', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule' ] # those that support weights