From ed34704eedb438821720509c5cddb745bc1b5056 Mon Sep 17 00:00:00 2001 From: ievred Date: Tue, 7 Apr 2020 13:29:09 +0200 Subject: add sklearn to travis yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 5b3a26e..072bc55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ install: - pip install -r requirements.txt - pip install -U "numpy>=1.14" "scipy<1.3" # for numpy array formatting in doctests + scipy version: otherwise, pymanopt fails, cf - pip install flake8 pytest "pytest-cov<2.6" + - pip install -U "sklearn" - pip install . # command to run tests + check syntax style services: -- cgit v1.2.3 From ef7c11a5df3cf6c82864472f0cfa65d6b2036f2f Mon Sep 17 00:00:00 2001 From: Laetitia Chapel Date: Thu, 16 Apr 2020 15:52:00 +0200 Subject: partial with python 3.8 --- .travis.yml | 2 +- ot/partial.py | 12 ++++++------ test/test_partial.py | 9 ++++----- 3 files changed, 11 insertions(+), 12 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 072bc55..7ff1b3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ matrix: python: 3.7 - os: linux sudo: required - python: 2.7 + python: 3.8 # - os: osx # sudo: required # language: generic diff --git a/ot/partial.py b/ot/partial.py index 8698d9d..726a590 100755 --- a/ot/partial.py +++ b/ot/partial.py @@ -232,7 +232,7 @@ def partial_wasserstein(a, b, M, m=None, nb_dummies=1, log=False, **kwargs): b_extended = np.append(b, [(np.sum(a) - m) / nb_dummies] * nb_dummies) a_extended = np.append(a, [(np.sum(b) - m) / nb_dummies] * nb_dummies) - M_extended = np.ones((len(a_extended), len(b_extended))) * 0 + M_extended = np.zeros((len(a_extended), len(b_extended))) M_extended[-1, -1] = np.max(M) * 1e5 M_extended[:len(a), :len(b)] = M @@ -510,9 +510,9 @@ def partial_gromov_wasserstein(C1, C2, p, q, m=None, nb_dummies=1, G0=None, Gprev = G0 M = gwgrad_partial(C1, C2, G0) - M[M < eps] = np.quantile(M[M > eps], thres) + M[M < eps] = np.quantile(M, thres) - M_emd = np.ones(dim_G_extended) * np.max(M) * 1e2 + M_emd = np.zeros(dim_G_extended) M_emd[:len(p), :len(q)] = M M_emd[-nb_dummies:, -nb_dummies:] = np.max(M) * 1e5 M_emd = np.asarray(M_emd, dtype=np.float64) @@ -729,8 +729,8 @@ def entropic_partial_wasserstein(a, b, M, reg, m=None, numItermax=1000, M = np.asarray(M, dtype=np.float64) dim_a, dim_b = M.shape - dx = np.ones(dim_a) - dy = np.ones(dim_b) + dx = np.ones(dim_a, dtype=np.float64) + dy = np.ones(dim_b, dtype=np.float64) if len(a) == 0: a = np.ones(dim_a, dtype=np.float64) / dim_a @@ -738,7 +738,7 @@ def entropic_partial_wasserstein(a, b, M, reg, m=None, numItermax=1000, b = np.ones(dim_b, dtype=np.float64) / dim_b if m is None: - m = np.min((np.sum(a), np.sum(b))) + m = np.min((np.sum(a), np.sum(b))) * 1.0 if m < 0: raise ValueError("Problem infeasible. Parameter m should be greater" " than 0.") diff --git a/test/test_partial.py b/test/test_partial.py index fbcd3c2..1799fd4 100755 --- a/test/test_partial.py +++ b/test/test_partial.py @@ -93,10 +93,7 @@ def test_partial_gromov_wasserstein(): m = 2 / 3 res0, log0 = ot.partial.partial_gromov_wasserstein(C1, C3, p, q, m=m, log=True) - res, log = ot.partial.entropic_partial_gromov_wasserstein(C1, C3, p, q, 10, - m=m, log=True) np.testing.assert_allclose(res0, 0, atol=1e-1, rtol=1e-1) - np.testing.assert_allclose(res, 0, atol=1e-1, rtol=1e-1) C1 = sp.spatial.distance.cdist(xs, xs) C2 = sp.spatial.distance.cdist(xt, xt) @@ -123,8 +120,10 @@ def test_partial_gromov_wasserstein(): m = 2 / 3 res0, log0 = ot.partial.partial_gromov_wasserstein(C1, C2, p, q, m=m, log=True) - res, log = ot.partial.entropic_partial_gromov_wasserstein(C1, C2, p, q, 10, - m=m, log=True) + res, log = ot.partial.entropic_partial_gromov_wasserstein(C1, C2, p, q, + 100, m=m, + log=True) + # check constratints np.testing.assert_equal( res0.sum(1) <= p, [True] * len(p)) # cf convergence wasserstein -- cgit v1.2.3 From 2dc6dd874036b05eef02063c04a83a16a0568784 Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Mon, 20 Apr 2020 14:31:30 +0200 Subject: test build new version of scipy --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 7ff1b3c..b9cc88f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_install: # command to install dependencies install: - pip install -r requirements.txt - - pip install -U "numpy>=1.14" "scipy<1.3" # for numpy array formatting in doctests + scipy version: otherwise, pymanopt fails, cf + - pip install -U "numpy>=1.14" scipy # for numpy array formatting in doctests - pip install flake8 pytest "pytest-cov<2.6" - pip install -U "sklearn" - pip install . -- cgit v1.2.3 From 8c6a976c9d1225e469e22f7ef1c700eaf1e08dd7 Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort Date: Tue, 21 Apr 2020 11:00:24 +0200 Subject: try codecov setup --- .github/workflows/main.yml | 2 +- .travis.yml | 5 ++++- codecov.yml | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 codecov.yml (limited to '.travis.yml') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ca10c8c..1a8a759 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,4 +9,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} artifact-path: 0/docs/build/html/index.html - circleci-jobs: build_doc + circleci-jobs: build_docs diff --git a/.travis.yml b/.travis.yml index b9cc88f..3f63867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ before_install: install: - pip install -r requirements.txt - pip install -U "numpy>=1.14" scipy # for numpy array formatting in doctests - - pip install flake8 pytest "pytest-cov<2.6" + - pip install flake8 pytest "pytest-cov<2.6" codecov - pip install -U "sklearn" - pip install . # command to run tests + check syntax style @@ -45,3 +45,6 @@ script: - flake8 examples/ ot/ test/ - python -m pytest -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot # - py.test ot test +after_script: + # Need to run from source dir to execute "git" commands + - codecov; diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..1e7b888 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +coverage: + precision: 2 + round: down + range: "70...100" + status: + project: + default: + target: auto + threshold: 0.01 + patch: false + changes: false +comment: + layout: "header, diff, sunburst, uncovered" + behavior: default -- cgit v1.2.3 From f9638166521a1160838fae75e2a2e318d645460e Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort Date: Tue, 21 Apr 2020 17:40:32 +0200 Subject: rm travis --- .github/workflows/pythonpackage.yml | 8 +++--- .travis.yml | 50 ------------------------------------- .travis/before_install.sh | 15 ----------- README.md | 1 - 4 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 .travis.yml delete mode 100755 .travis/before_install.sh (limited to '.travis.yml') diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 19527c3..755937a 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -3,12 +3,10 @@ name: Test Package on: push: branches: - - '**' - create: + - master + pull_request: branches: - - 'master' - tags: - - '**' + - master jobs: linux: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f63867..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -dist: xenial # required for Python >= 3.7 -language: python -matrix: - # allow_failures: - # - os: osx - # - os: windows - include: - - os: linux - sudo: required - python: 3.5 - - os: linux - sudo: required - python: 3.6 - - os: linux - sudo: required - python: 3.7 - - os: linux - sudo: required - python: 3.8 - # - os: osx - # sudo: required - # language: generic - # - name: "Python 3.7.3 on Windows" - # os: windows # Windows 10.0.17134 N/A Build 17134 - # language: shell # 'language: python' is an error on Travis CI Windows - # before_install: choco install python - # env: PATH=/c/Python37:/c/Python37/Scripts:$PATH -# before_script: # configure a headless display to test plot generation -# - "export DISPLAY=:99.0" -# - sleep 3 # give xvfb some time to start -before_install: - - ./.travis/before_install.sh -# command to install dependencies -install: - - pip install -r requirements.txt - - pip install -U "numpy>=1.14" scipy # for numpy array formatting in doctests - - pip install flake8 pytest "pytest-cov<2.6" codecov - - pip install -U "sklearn" - - pip install . -# command to run tests + check syntax style -services: - - xvfb -script: - - python setup.py develop - - flake8 examples/ ot/ test/ - - python -m pytest -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot - # - py.test ot test -after_script: - # Need to run from source dir to execute "git" commands - - codecov; diff --git a/.travis/before_install.sh b/.travis/before_install.sh deleted file mode 100755 index 0ae6249..0000000 --- a/.travis/before_install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then - - # Install some custom requirements on OS X - # e.g. brew install pyenv-virtualenv - #brew update - #brew install python - sudo easy_install -U pip - -else - # Install some custom requirements on Linux - sudo apt-get update -q - sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev -fi diff --git a/README.md b/README.md index 65193ff..ca8481c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![PyPI version](https://badge.fury.io/py/POT.svg)](https://badge.fury.io/py/POT) [![Anaconda Cloud](https://anaconda.org/conda-forge/pot/badges/version.svg)](https://anaconda.org/conda-forge/pot) -[![Build Status](https://travis-ci.org/PythonOT/POT.svg?branch=master)](https://travis-ci.org/PythonOT/POT) [![Build Status](https://github.com/PythonOT/POT/workflows/Linux%7CWin%7CMacOS/badge.svg)](https://github.com/PythonOT/POT/actions) [![Codecov Status](https://codecov.io/gh/PythonOT/POT/branch/master/graph/badge.svg)](https://codecov.io/gh/PythonOT/POT) [![Documentation Status](https://readthedocs.org/projects/pot/badge/?version=latest)](http://pot.readthedocs.io/en/latest/?badge=latest) -- cgit v1.2.3