Skip to content

Commit 4032807

Browse files
authored
Initial commit
0 parents  commit 4032807

File tree

10 files changed

+444
-0
lines changed

10 files changed

+444
-0
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: '00 00 * * *'
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV}}
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- dev
7+
push:
8+
branches:
9+
- master
10+
- dev
11+
tags: '*'
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
version:
20+
- '1.0'
21+
- '1' # automatically expands to the latest stable 1.x release of Julia.
22+
os:
23+
- ubuntu-latest
24+
arch:
25+
- x64
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: julia-actions/setup-julia@v1
29+
with:
30+
version: ${{ matrix.version }}
31+
arch: ${{ matrix.arch }}
32+
- uses: actions/cache@v1
33+
env:
34+
cache-name: cache-artifacts
35+
with:
36+
path: ~/.julia/artifacts
37+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-test-${{ env.cache-name }}-
40+
${{ runner.os }}-test-
41+
${{ runner.os }}-
42+
- uses: julia-actions/julia-buildpkg@v1
43+
- uses: julia-actions/julia-runtest@v1
44+
env:
45+
JULIA_NUM_THREADS: 2
46+
- uses: julia-actions/julia-processcoverage@v1
47+
- uses: codecov/codecov-action@v1
48+
with:
49+
file: lcov.info
50+
docs:
51+
name: Documentation
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: julia-actions/setup-julia@v1
56+
with:
57+
version: '1'
58+
- run: |
59+
julia -e '
60+
function set_environment_variable(name::AbstractString, value::AbstractString)
61+
github_env = ENV["GITHUB_ENV"]
62+
touch(github_env)
63+
open(github_env, "a") do io
64+
println(io, "$(name)=$(value)")
65+
end
66+
end
67+
event_name = "${{ github.event_name }}"
68+
if event_name == "pull_request"
69+
base_ref = "${{ github.base_ref }}"
70+
head_ref = "${{ github.head_ref }}"
71+
base_repository = "${{ github.repository }}"
72+
head_repository = "${{ github.event.pull_request.head.repo.full_name }}"
73+
build_docs = (base_ref == "master") && (head_ref == "dev") && (base_repository == head_repository)
74+
elseif event_name == "push"
75+
ref = "${{ github.ref }}"
76+
build_docs = (ref == "refs/heads/master") || (startswith(ref, "refs/tags/"))
77+
elseif event_name == "schedule"
78+
build_docs = ref == "refs/heads/master"
79+
elseif event_name == "workflow_dispatch"
80+
build_docs = ref == "refs/heads/master"
81+
else
82+
build_docs = false
83+
end
84+
if build_docs
85+
@info("We will build the docs")
86+
set_environment_variable("BUILD_DOCS", "true")
87+
else
88+
@info("We will NOT build the docs")
89+
set_environment_variable("BUILD_DOCS", "false")
90+
end'
91+
- run: |
92+
julia --project=docs -e '
93+
if ENV["BUILD_DOCS"] == "true"
94+
using Pkg
95+
Pkg.develop(PackageSpec(path=pwd()))
96+
Pkg.instantiate()
97+
end'
98+
- run: |
99+
julia --project=docs -e '
100+
if ENV["BUILD_DOCS"] == "true"
101+
using Documenter: doctest
102+
using MLJBase
103+
@info "attempting to run the doctests"
104+
doctest(MLJBase)
105+
else
106+
@info "skipping the doctests"
107+
end'
108+
- run: julia --project=docs -e '
109+
if ENV["BUILD_DOCS"] == "true"
110+
@info "attempting to build the docs"
111+
run(`julia --project=docs docs/make.jl`)
112+
@info "successfully built the docs"
113+
else
114+
@info "skipping the docs build"
115+
end'
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci_nightly.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI (Julia nightly)
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- dev
7+
push:
8+
branches:
9+
- master
10+
- dev
11+
tags: '*'
12+
env:
13+
TEST_MLJBASE: "true"
14+
jobs:
15+
test:
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
version:
22+
- 'nightly'
23+
os:
24+
- ubuntu-latest
25+
arch:
26+
- x64
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: julia-actions/setup-julia@v1
30+
with:
31+
version: ${{ matrix.version }}
32+
arch: ${{ matrix.arch }}
33+
- uses: actions/cache@v1
34+
env:
35+
cache-name: cache-artifacts
36+
with:
37+
path: ~/.julia/artifacts
38+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39+
restore-keys: |
40+
${{ runner.os }}-test-${{ env.cache-name }}-
41+
${{ runner.os }}-test-
42+
${{ runner.os }}-
43+
- uses: julia-actions/julia-buildpkg@v1
44+
- uses: julia-actions/julia-runtest@v1
45+
env:
46+
JULIA_NUM_THREADS: 2
47+
- uses: julia-actions/julia-processcoverage@v1
48+
- uses: codecov/codecov-action@v1
49+
with:
50+
file: lcov.info

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Manifest.toml
2+
.ipynb_checkpoints
3+
*~
4+
#*
5+
.DS_Store
6+
sandbox/
7+
/docs/build/
8+
/docs/site/
9+
/docs/Manifest.toml
10+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
MIT License Copyright (c) 2021 - JuliaAI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Project.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name = "MLJExampleInterface"
2+
uuid = "33837fe5-dbff-4c9e-8c2f-c5612fe2b8b6"
3+
authors = ["Anthony D. Blaom <[email protected]>"]
4+
version = "0.1.0"
5+
6+
[deps]
7+
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
8+
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
9+
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"
10+
11+
[compat]
12+
Example = "0.5"
13+
MLJModelInterface = "1"
14+
ScientificTypesBase = "1, 2"
15+
julia = "1"
16+
17+
[extras]
18+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
19+
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
20+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
21+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
22+
23+
[targets]
24+
test = ["Distributions", "MLJBase", "StableRNGs", "Test"]

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# MLJExampleInterface.jl
2+
3+
This repository is a template for creating repositories that contain
4+
glue code between (i) packages providing machine learning algorithms; and (ii)
5+
the machine learning toolbox
6+
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) - that is,
7+
for so-called *interface-only packages*.
8+
9+
## When to use this template
10+
11+
This template is intended for use when a package providing a machine
12+
learning model algorithm is not hosting the code that implements the
13+
MLJ model API, and a separate package for this purpose is to be
14+
created. This repo is itself a working implementation but should
15+
be used in conjunction with the more detailed [model implementation
16+
guidelines](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/).
17+
18+
## How to use this template
19+
20+
1. Clone this repository or use it as a template if available from your organization.
21+
22+
2. Rename this repository, replacing the word "Example" with the name of the model-providing package.
23+
24+
1. Develop the contents of src/MLJExampleInterface.jl appropriately.
25+
26+
2. Rename src/MLJExampleInterface.jl appropriately.
27+
28+
3. Remove Example from Project.toml and instead add the model-providing package.
29+
30+
3. **GENERATE A NEW UUID in Project.toml** and change the Project.toml
31+
name and author appropriately.
32+
33+
1. You may want to remove the Distributions test dependency if you don't need it.
34+
35+
4. Replace every instance of "Example" in this README.md with the name
36+
of the model-providing package and adjust the organization name in
37+
the link.
38+
39+
5. Remove everything in this REAMDE.md except what is below the line
40+
you are currently reading &#128521;.
41+
42+
43+
# MLJ.jl <--> Example.jl
44+
45+
Repository implementing the [MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model interface for models provided by
46+
[Example.jl](https://github.com/JuliaLang/Example.jl).
47+
48+
| Linux | Coverage |
49+
| :------------ | :------- |
50+
| [![Build Status](https://github.com/JuliaAI/MLJExampleInterface.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/MLJExampleInterface.jl/actions) | [![Coverage](https://codecov.io/gh/JuliaAI/MLJExampleInterface.jl/branch/master/graph/badge.svg)](https://codecov.io/github/JuliaAI/MLJExampleInterface.jl?branch=master) |

0 commit comments

Comments
 (0)