Skip to content

Commit 9afa6af

Browse files
authored
Update CI (#18)
* Update CI.yml * Update Docs.yml * Update JuliaNightly.yml * Simplify docs and remove Manifest file * Update sinkhorn2 doctest * Actually fix doctest * Use example from POT documentation * Actually use example * Update lib.jl * Update lib.jl * Revert example
1 parent 135f45e commit 9afa6af

File tree

6 files changed

+27
-147
lines changed

6 files changed

+27
-147
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- main
77
pull_request:
88

9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
915
jobs:
1016
test:
1117
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ (matrix.python && 'system Python') || 'conda' }}
@@ -38,9 +44,6 @@ jobs:
3844
python-version: '3.x'
3945
architecture: ${{ matrix.arch }}
4046
if: matrix.python
41-
# Limitation of pip: https://pythonot.github.io/index.html#pip-installation
42-
- run: python -m pip install cython numpy
43-
if: matrix.python
4447
- run: python -m pip install pot
4548
if: matrix.python
4649
- uses: julia-actions/setup-julia@v1
@@ -67,7 +70,7 @@ jobs:
6770
PYTHON: ${{ matrix.python }}
6871
- uses: julia-actions/julia-processcoverage@v1
6972
if: matrix.coverage
70-
- uses: codecov/codecov-action@v1
73+
- uses: codecov/codecov-action@v2
7174
if: matrix.coverage
7275
with:
7376
file: lcov.info

.github/workflows/Docs.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
tags: '*'
88
pull_request:
99

10+
concurrency:
11+
# Skip intermediate builds: always.
12+
# Cancel intermediate builds: only if it is a pull request build.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
15+
1016
jobs:
1117
docs:
1218
name: Documentation
@@ -16,14 +22,7 @@ jobs:
1622
- uses: julia-actions/setup-julia@v1
1723
with:
1824
version: '1'
19-
- run: |
20-
julia --project=docs -e '
21-
using Pkg
22-
Pkg.develop(PackageSpec(path=pwd()))
23-
Pkg.instantiate()'
24-
env:
25-
PYTHON: ''
26-
- run: julia --project=docs docs/make.jl
25+
- uses: julia-actions/julia-docdeploy@v1
2726
env:
2827
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2928
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/JuliaNightly.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
- main
1010
pull_request:
1111

12+
concurrency:
13+
# Skip intermediate builds: always.
14+
# Cancel intermediate builds: only if it is a pull request build.
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
1218
jobs:
1319
test:
1420
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ (matrix.python && 'system Python') || 'conda' }}
@@ -35,9 +41,6 @@ jobs:
3541
python-version: '3.x'
3642
architecture: ${{ matrix.arch }}
3743
if: matrix.python
38-
# Limitation of pip: https://pythonot.github.io/index.html#pip-installation
39-
- run: python -m pip install cython numpy
40-
if: matrix.python
4144
- run: python -m pip install pot
4245
if: matrix.python
4346
- uses: julia-actions/setup-julia@v1

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*.jl.*.cov
22
*.jl.cov
33
*.jl.mem
4-
/Manifest.toml
5-
/test/Manifest.toml
4+
Manifest.toml
65
/docs/build/

docs/Manifest.toml

Lines changed: 0 additions & 123 deletions
This file was deleted.

src/lib.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ julia> ν = [0.0, 1.0];
222222
223223
julia> C = [0.0 1.0; 2.0 0.0; 0.5 1.5];
224224
225-
julia> round.(sinkhorn2(μ, ν, C, 0.01); sigdigits=6)
226-
1-element Vector{Float64}:
227-
0.95
225+
julia> round(sinkhorn2(μ, ν, C, 0.01); sigdigits=6)
226+
0.95
228227
```
229228
230229
It is possible to provide multiple target marginals as columns of a matrix.
@@ -258,17 +257,17 @@ in the Python Optimal Transport package. Keyword arguments are listed in the doc
258257
# Examples
259258
260259
```jldoctest
261-
julia> xsource = [1];
260+
julia> xsource = [1.0];
262261
263-
julia> xtarget = [2, 3];
262+
julia> xtarget = [2.0, 3.0];
264263
265264
julia> ε = 0.01;
266265
267266
julia> empirical_sinkhorn_divergence(xsource, xtarget, ε) ≈
268-
sinkhorn2([1], [0.5, 0.5], [1 4], ε) -
267+
sinkhorn2([1], [0.5, 0.5], [1.0 4.0], ε) -
269268
(
270269
sinkhorn2([1], [1], zeros(1, 1), ε) +
271-
sinkhorn2([0.5, 0.5], [0.5, 0.5], [0 1; 1 0], ε)
270+
sinkhorn2([0.5, 0.5], [0.5, 0.5], Float64[0 1; 1 0], ε)
272271
) / 2
273272
true
274273
```

0 commit comments

Comments
 (0)