Skip to content

Commit

Permalink
Remove module docs, add missing copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 committed Feb 27, 2023
1 parent f6420ff commit f840639
Show file tree
Hide file tree
Showing 45 changed files with 93 additions and 55 deletions.
13 changes: 13 additions & 0 deletions src/ott/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from importlib.metadata import PackageNotFoundError, version

try:
Expand Down
1 change: 0 additions & 1 deletion src/ott/problems/linear/barycenter_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Classes defining OT problem(s) (objective function + utilities)."""
from typing import Any, Dict, Optional, Sequence, Tuple

import jax
Expand Down
2 changes: 0 additions & 2 deletions src/ott/problems/linear/linear_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Classes defining OT problem(s) (objective function + utilities)."""

from typing import Any, Callable, Dict, Optional, Sequence, Tuple

import jax
Expand Down
2 changes: 0 additions & 2 deletions src/ott/solvers/linear/discrete_barycenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Implementation of :cite:`janati:20` Wasserstein barycenter algorithm."""

import functools
from typing import NamedTuple, Optional, Sequence

Expand Down
1 change: 0 additions & 1 deletion src/ott/tools/segment_sinkhorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Segmented sinkhorn utility."""
from types import MappingProxyType
from typing import Any, Mapping, Optional, Tuple

Expand Down
1 change: 0 additions & 1 deletion src/ott/tools/sinkhorn_divergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Implements the sinkhorn divergence."""
from types import MappingProxyType
from typing import Any, List, Mapping, NamedTuple, Optional, Tuple, Type

Expand Down
2 changes: 0 additions & 2 deletions src/ott/tools/soft_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Soft sort operators."""

import functools
from typing import Any, Callable, Optional

Expand Down
2 changes: 2 additions & 0 deletions src/ott/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import jax.numpy as jnp

__all__ = ["Transport"]

# TODO(michalk8): introduce additional types here


Expand Down
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import collections.abc
import itertools
from typing import Any, Mapping, Optional, Sequence
Expand Down
1 change: 0 additions & 1 deletion tests/geometry/costs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the cost/norm functions."""
from typing import Type

import jax
Expand Down
13 changes: 13 additions & 0 deletions tests/geometry/graph_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import time
from typing import Any, Callable, Literal, Optional, Tuple, Union

Expand Down
1 change: 0 additions & 1 deletion tests/geometry/pointcloud_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for apply_cost and apply_kernel."""
from typing import Union

import jax
Expand Down
1 change: 0 additions & 1 deletion tests/geometry/scaling_cost_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the option to scale the cost matrix."""
from typing import Optional, Union

import jax
Expand Down
13 changes: 13 additions & 0 deletions tests/geometry/subsetting_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional, Sequence, Tuple, Type, Union

import jax
Expand Down
1 change: 0 additions & 1 deletion tests/initializers/linear/sinkhorn_init_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Sinkhorn initializers."""
from typing import Literal, Optional

import jax
Expand Down
2 changes: 0 additions & 2 deletions tests/initializers/linear/sinkhorn_lr_init_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Sinkhorn initializers."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/initializers/quadratic/gw_init_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Gromov-Wasserstein initializers."""

import jax
import numpy as np
import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/math/lse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the jvp of a custom implementation of lse."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/math/matrix_square_root_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for matrix square roots."""
from typing import Any, Callable

import jax
Expand Down
13 changes: 13 additions & 0 deletions tests/problems/linear/potentials_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import jax
import jax.numpy as jnp
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/continuous_barycenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for continuous barycenter."""
import functools
from typing import Tuple

Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/discrete_barycenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import jax.numpy as jnp
import pytest
from ott.geometry import grid, pointcloud
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/sinkhorn_diff_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the differentiability of reg_ot_cost w.r.t weights/locations."""
import functools
from typing import Callable, List, Optional, Tuple

Expand Down
2 changes: 0 additions & 2 deletions tests/solvers/linear/sinkhorn_grid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Sinkhorn when applied on a grid."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/sinkhorn_lr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests Sinkhorn Low-Rank solver with various initializations."""
import jax
import jax.numpy as jnp
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/sinkhorn_misc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests Anderson acceleration for Sinkhorn."""
from typing import Optional, Tuple

import chex
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/linear/sinkhorn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Sinkhorn."""
from typing import Any, Optional, Tuple

import jax
Expand Down
2 changes: 0 additions & 2 deletions tests/solvers/nn/icnn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for ICNN network architecture."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/solvers/nn/neuraldual_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for implementation of ICNN-based Kantorovich dual by Makkuva+(2020)."""
from typing import Sequence, Tuple

import jax
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/quadratic/fgw_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the Fused Gromov Wasserstein."""
from typing import Literal, Tuple, Union

import jax
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/quadratic/gw_barycenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Gromov-Wasserstein barycenter."""
from typing import Any, Optional, Sequence, Tuple

import jax
Expand Down
1 change: 0 additions & 1 deletion tests/solvers/quadratic/gw_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the Gromov Wasserstein."""
from typing import Tuple, Union

import jax
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/fit_gmm_pair_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for fit_gmm_pair."""

import jax
import jax.numpy as jnp
import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/fit_gmm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for fit_gmm_pair."""

import jax
import jax.numpy as jnp
import jax.test_util
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/gaussian_mixture_pair_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for gaussian_mixture_pair."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/gaussian_mixture_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for gaussian_mixture."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/gaussian_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for gaussian."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/linalg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for linalg."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/probabilities_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for probabilities."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/gaussian_mixture/scale_tril_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for ScaleTriL."""

import jax
import jax.numpy as jnp
import numpy as np
Expand Down
Loading

0 comments on commit f840639

Please sign in to comment.