generated from JuliaAI/MLJExampleInterface.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4032807
Showing
10 changed files
with
444 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CompatHelper | ||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
CompatHelper: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV}} | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: TagBot | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
jobs: | ||
TagBot: | ||
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh: ${{ secrets.DOCUMENTER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
tags: '*' | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.0' | ||
- '1' # automatically expands to the latest stable 1.x release of Julia. | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
env: | ||
JULIA_NUM_THREADS: 2 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info | ||
docs: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: '1' | ||
- run: | | ||
julia -e ' | ||
function set_environment_variable(name::AbstractString, value::AbstractString) | ||
github_env = ENV["GITHUB_ENV"] | ||
touch(github_env) | ||
open(github_env, "a") do io | ||
println(io, "$(name)=$(value)") | ||
end | ||
end | ||
event_name = "${{ github.event_name }}" | ||
if event_name == "pull_request" | ||
base_ref = "${{ github.base_ref }}" | ||
head_ref = "${{ github.head_ref }}" | ||
base_repository = "${{ github.repository }}" | ||
head_repository = "${{ github.event.pull_request.head.repo.full_name }}" | ||
build_docs = (base_ref == "master") && (head_ref == "dev") && (base_repository == head_repository) | ||
elseif event_name == "push" | ||
ref = "${{ github.ref }}" | ||
build_docs = (ref == "refs/heads/master") || (startswith(ref, "refs/tags/")) | ||
elseif event_name == "schedule" | ||
build_docs = ref == "refs/heads/master" | ||
elseif event_name == "workflow_dispatch" | ||
build_docs = ref == "refs/heads/master" | ||
else | ||
build_docs = false | ||
end | ||
if build_docs | ||
@info("We will build the docs") | ||
set_environment_variable("BUILD_DOCS", "true") | ||
else | ||
@info("We will NOT build the docs") | ||
set_environment_variable("BUILD_DOCS", "false") | ||
end' | ||
- run: | | ||
julia --project=docs -e ' | ||
if ENV["BUILD_DOCS"] == "true" | ||
using Pkg | ||
Pkg.develop(PackageSpec(path=pwd())) | ||
Pkg.instantiate() | ||
end' | ||
- run: | | ||
julia --project=docs -e ' | ||
if ENV["BUILD_DOCS"] == "true" | ||
using Documenter: doctest | ||
using MLJBase | ||
@info "attempting to run the doctests" | ||
doctest(MLJBase) | ||
else | ||
@info "skipping the doctests" | ||
end' | ||
- run: julia --project=docs -e ' | ||
if ENV["BUILD_DOCS"] == "true" | ||
@info "attempting to build the docs" | ||
run(`julia --project=docs docs/make.jl`) | ||
@info "successfully built the docs" | ||
else | ||
@info "skipping the docs build" | ||
end' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CI (Julia nightly) | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
tags: '*' | ||
env: | ||
TEST_MLJBASE: "true" | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- 'nightly' | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
env: | ||
JULIA_NUM_THREADS: 2 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Manifest.toml | ||
.ipynb_checkpoints | ||
*~ | ||
#* | ||
.DS_Store | ||
sandbox/ | ||
/docs/build/ | ||
/docs/site/ | ||
/docs/Manifest.toml | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
MIT License Copyright (c) 2021 - JuliaAI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name = "MLJExampleInterface" | ||
uuid = "33837fe5-dbff-4c9e-8c2f-c5612fe2b8b6" | ||
authors = ["Anthony D. Blaom <[email protected]>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
Example = "7876af07-990d-54b4-ab0e-23690620f79a" | ||
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" | ||
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161" | ||
|
||
[compat] | ||
Example = "0.5" | ||
MLJModelInterface = "1" | ||
ScientificTypesBase = "1, 2" | ||
julia = "1" | ||
|
||
[extras] | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d" | ||
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Distributions", "MLJBase", "StableRNGs", "Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# MLJExampleInterface.jl | ||
|
||
This repository is a template for creating repositories that contain | ||
glue code between (i) packages providing machine learning algorithms; and (ii) | ||
the machine learning toolbox | ||
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) - that is, | ||
for so-called *interface-only packages*. | ||
|
||
## When to use this template | ||
|
||
This template is intended for use when a package providing a machine | ||
learning model algorithm is not hosting the code that implements the | ||
MLJ model API, and a separate package for this purpose is to be | ||
created. This repo is itself a working implementation but should | ||
be used in conjunction with the more detailed [model implementation | ||
guidelines](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/). | ||
|
||
## How to use this template | ||
|
||
1. Clone this repository or use it as a template if available from your organization. | ||
|
||
2. Rename this repository, replacing the word "Example" with the name of the model-providing package. | ||
|
||
1. Develop the contents of src/MLJExampleInterface.jl appropriately. | ||
|
||
2. Rename src/MLJExampleInterface.jl appropriately. | ||
|
||
3. Remove Example from Project.toml and instead add the model-providing package. | ||
|
||
3. **GENERATE A NEW UUID in Project.toml** and change the Project.toml | ||
name and author appropriately. | ||
|
||
1. You may want to remove the Distributions test dependency if you don't need it. | ||
|
||
4. Replace every instance of "Example" in this README.md with the name | ||
of the model-providing package and adjust the organization name in | ||
the link. | ||
|
||
5. Remove everything in this REAMDE.md except what is below the line | ||
you are currently reading 😉. | ||
|
||
|
||
# MLJ.jl <--> Example.jl | ||
|
||
Repository implementing the [MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model interface for models provided by | ||
[Example.jl](https://github.com/JuliaLang/Example.jl). | ||
|
||
| Linux | Coverage | | ||
| :------------ | :------- | | ||
| [![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) | |
Oops, something went wrong.