From 2f5242be393cda9a8ce55d26d455f4a4b9df32d1 Mon Sep 17 00:00:00 2001 From: michalk8 <46717574+michalk8@users.noreply.github.com> Date: Mon, 12 Dec 2022 20:03:12 +0100 Subject: [PATCH] Update docstrings for deprecated functions (#207) * Add `deprecate` function * Deprecate `sinkhorn` and `gromov_wasserstein` * Deprecate `solve` * [ci skip] Add deprecation warnings in docstrings --- src/ott/solvers/linear/sinkhorn.py | 6 ++++++ src/ott/solvers/quadratic/gromov_wasserstein.py | 7 +++++++ src/ott/tools/transport.py | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/src/ott/solvers/linear/sinkhorn.py b/src/ott/solvers/linear/sinkhorn.py index fc2899fcd..2e330ca04 100644 --- a/src/ott/solvers/linear/sinkhorn.py +++ b/src/ott/solvers/linear/sinkhorn.py @@ -935,6 +935,12 @@ def sinkhorn( ): r"""Solve regularized OT problem using Sinkhorn iterations. + .. note:: + + This function has been deprecated and will be removed in ``0.3.2`` release. + Please use the :class:`~ott.solvers.linear.sinkhorn.Sinkhorn` solver + instead. + The Sinkhorn algorithm is a fixed point iteration that solves a regularized optimal transport (reg-OT) problem between two measures. The optimization variables are a pair of vectors (called potentials, or diff --git a/src/ott/solvers/quadratic/gromov_wasserstein.py b/src/ott/solvers/quadratic/gromov_wasserstein.py index a2a5398ab..487780637 100644 --- a/src/ott/solvers/quadratic/gromov_wasserstein.py +++ b/src/ott/solvers/quadratic/gromov_wasserstein.py @@ -474,6 +474,13 @@ def gromov_wasserstein( ) -> GWOutput: """Solve a Gromov Wasserstein problem. + .. note:: + + This function has been deprecated and will be removed in ``0.3.2`` release. + Please use the + :class:`~ott.solvers.quadratic.gromov_wasserstein.GromovWasserstein` + solver instead. + Wrapper that instantiates a quadratic problem (possibly with linear term if the problem is fused) and calls a solver to output a solution. diff --git a/src/ott/tools/transport.py b/src/ott/tools/transport.py index 0d671e3ec..147c27c6d 100644 --- a/src/ott/tools/transport.py +++ b/src/ott/tools/transport.py @@ -92,6 +92,11 @@ def solve( ) -> Transport: """Generic interface to transport problem. + .. note: + + This function has been deprecated and will be removed in ``0.3.2`` release. + Please use :mod:`ott.solvers` module directly. + The geometries can be passed as arrays, geometry.Geometry or directly as a problem. The solver is passed via kwargs.