Skip to content

Commit dba6dcf

Browse files
committed
Update the CI/CD pipeline to use GitHub actions rather than Travis CI. Small reformatting updates to the README.
1 parent 016f995 commit dba6dcf

File tree

5 files changed

+109
-86
lines changed

5 files changed

+109
-86
lines changed

.github/workflows/CI.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test:
7+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
version:
13+
- '1'
14+
- '1.0'
15+
- 'nightly'
16+
os:
17+
- ubuntu-latest
18+
- macOS-latest
19+
- windows-latest
20+
arch:
21+
- x64
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: julia-actions/setup-julia@v1
25+
with:
26+
version: ${{ matrix.version }}
27+
arch: ${{ matrix.arch }}
28+
- uses: actions/cache@v1
29+
env:
30+
cache-name: cache-artifacts
31+
with:
32+
path: ~/.julia/artifacts
33+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
34+
restore-keys: |
35+
${{ runner.os }}-test-${{ env.cache-name }}-
36+
${{ runner.os }}-test-
37+
${{ runner.os }}-
38+
- uses: julia-actions/julia-buildpkg@v1
39+
- uses: julia-actions/julia-runtest@v1
40+
- uses: julia-actions/julia-processcoverage@v1
41+
- uses: codecov/codecov-action@v1
42+
with:
43+
file: lcov.info
44+
docs:
45+
name: Documentation
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: julia-actions/setup-julia@v1
50+
with:
51+
version: '1'
52+
- run: |
53+
julia --project=docs -e '
54+
using Pkg
55+
Pkg.develop(PackageSpec(path=pwd()))
56+
Pkg.instantiate()'
57+
- run: |
58+
julia --project=docs -e '
59+
using Documenter: DocMeta, doctest
60+
using LSHFunctions
61+
DocMeta.setdocmeta!(LSHFunctions, :DocTestSetup, :(using LSHFunctions); recursive=true)
62+
doctest(LSHFunctions)'
63+
- run: julia --project=docs docs/make.jl
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/CompatHelper.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
name: CompatHelper
2-
32
on:
43
schedule:
5-
- cron: '00 00 * * *'
6-
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
76
jobs:
87
CompatHelper:
98
runs-on: ubuntu-latest
109
steps:
11-
- uses: julia-actions/setup-julia@latest
12-
with:
13-
version: 1.3
1410
- name: Pkg.add("CompatHelper")
1511
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
1612
- name: CompatHelper.main()
1713
env:
1814
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
1916
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
workflow_dispatch:
77
jobs:
88
TagBot:
9-
runs-on: ubuntu-latest
109
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
1111
steps:
1212
- uses: JuliaRegistries/TagBot@v1
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.travis.yml

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

README.md

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
11
# LSHFunctions.jl
22

3-
- Docs: [![Stable docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://kernelmethod.github.io/LSHFunctions.jl/stable/) [![Dev docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://kernelmethod.github.io/LSHFunctions.jl/dev/)
4-
- Build status: [![Build Status](https://travis-ci.com/kernelmethod/LSHFunctions.jl.svg?branch=master)](https://travis-ci.com/kernelmethod/LSHFunctions.jl)
5-
- Code coverage: [![Coverage Status](https://coveralls.io/repos/github/kernelmethod/LSHFunctions.jl/badge.svg?branch=master)](https://coveralls.io/github/kernelmethod/LSHFunctions.jl?branch=master)
6-
[![codecov](https://codecov.io/gh/kernelmethod/LSHFunctions.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/kernelmethod/LSHFunctions.jl)
7-
- DOI to cite this code: [![DOI](https://zenodo.org/badge/197700982.svg)](https://zenodo.org/badge/latestdoi/197700982)
3+
[![Stable docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://kernelmethod.github.io/LSHFunctions.jl/stable/) [![Dev docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://kernelmethod.github.io/LSHFunctions.jl/dev/)
4+
[![Build Status](https://github.com/kernelmethod/LSHFunctions.jl/workflows/CI/badge.svg)](https://github.com/kernelmethod/LSHFunctions.jl/actions)
5+
[![Codecov](https://codecov.io/gh/kernelmethod/LSHFunctions.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/kernelmethod/LSHFunctions.jl)
6+
[![DOI](https://zenodo.org/badge/197700982.svg)](https://zenodo.org/badge/latestdoi/197700982)
87

9-
A Julia package for [locality-sensitive hashing](https://en.wikipedia.org/wiki/Locality-sensitive_hashing) to accelerate similarity search.
8+
A Julia package for [locality-sensitive
9+
hashing](https://en.wikipedia.org/wiki/Locality-sensitive_hashing) to accelerate
10+
similarity search.
1011

1112
- [What's LSH?](#whats-lsh)
1213
- [Installation](#installation)
1314
- [Supported similarity functions](#supported-similarity-functions)
1415
- [Examples](#examples)
1516

1617
## What's LSH?
17-
Traditionally, if you have a data point `x`, and want to find the most similar point(s) to `x` in your database, you would compute the similarity between `x` and all of the points in your database, and keep whichever points were the most similar. For instance, this type of approach is used by the classic [k-nearest neighbors algorithm](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm). However, it has two major problems:
18-
19-
- The time to find the most similar point(s) to `x` is linear in the number of points in your database. This can make similarity search prohibitively expensive for even moderately large datasets.
20-
- In addition, the time complexity to compute the similarity between two datapoints is typically linear in the number of dimensions of those datapoints. If your data are high-dimensional (i.e. in the thousands to millions of dimensions), every similarity computation you perform can be fairly costly.
21-
22-
**Locality-sensitive hashing** (LSH) is a technique for accelerating these kinds of similarity searches. Instead of measuring how similar your query point is to every point in your database, you calculate a few hashes of the query point and only compare it against those points with which it experiences a hash collision. Locality-sensitive hash functions are randomly generated, with the fundamental property that as the similarity between `x` and `y` increases, the probability of a hash collision between `x` and `y` also increases.
18+
Traditionally, if you have a data point `x`, and want to find the most similar
19+
point(s) to `x` in your database, you would compute the similarity between `x`
20+
and all of the points in your database, and keep whichever points were the most
21+
similar. For instance, this type of approach is used by the classic [k-nearest
22+
neighbors algorithm](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm).
23+
However, it has two major problems:
24+
25+
- The time to find the most similar point(s) to `x` is linear in the number of
26+
points in your database. This can make similarity search prohibitively
27+
expensive for even moderately large datasets.
28+
- In addition, the time complexity to compute the similarity between two
29+
datapoints is typically linear in the number of dimensions of those
30+
datapoints. If your data are high-dimensional (i.e. in the thousands to
31+
millions of dimensions), every similarity computation you perform can be
32+
fairly costly.
33+
34+
**Locality-sensitive hashing** (LSH) is a technique for accelerating these kinds
35+
of similarity searches. Instead of measuring how similar your query point is to
36+
every point in your database, you calculate a few hashes of the query point and
37+
only compare it against those points with which it experiences a hash collision.
38+
Locality-sensitive hash functions are randomly generated, with the fundamental
39+
property that as the similarity between `x` and `y` increases, the probability
40+
of a hash collision between `x` and `y` also increases.
2341

2442

2543
## Installation
@@ -43,18 +61,21 @@ So far, there are hash functions for the similarity functions:
4361
- `MonteCarloHash`
4462
- `ChebHash`
4563

46-
This package still needs a lot of work, including improvement to the documentation and API.
64+
This package still needs a lot of work, including improvement to the
65+
documentation and API.
4766

4867
## Examples
49-
The easiest way to start constructing new hash functions is by calling `LSHFunction` with the following syntax:
68+
The easiest way to start constructing new hash functions is by calling
69+
`LSHFunction` with the following syntax:
5070

5171
```
5272
hashfn = LSHFunction(similarity function,
5373
number of hash functions to generate;
5474
[LSH family-specific keyword arguments])
5575
```
5676

57-
For example, the following snippet generates 10 locality-sensitive hash functions (bundled together into a single `SimHash` struct) for cosine similarity:
77+
For example, the following snippet generates 10 locality-sensitive hash
78+
functions (bundled together into a single `SimHash` ) for cosine similarity:
5879

5980
```julia
6081
julia> using LSHFunctions;
@@ -76,4 +97,5 @@ julia> x = randn(128);
7697
julia> x_hashes = hashfn(x);
7798
```
7899

79-
For more details, [check out the LSHFunctions.jl documentation](https://kernelmethod.github.io/LSHFunctions.jl/dev/).
100+
For more details, [check out the LSHFunctions.jl
101+
documentation](https://kernelmethod.github.io/LSHFunctions.jl/dev/).

0 commit comments

Comments
 (0)