Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 13 additions & 64 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ jobs:
fail-fast: false
matrix:
julia-version:
- "1.6"
- "lts"
- "1"
- "nightly"
os:
- ubuntu-latest
- macos-latest
- windows-latest
julia-arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- name: Cache artifacts
uses: actions/cache@v2
uses: julia-actions/cache@v2
env:
cache-name: cache-artifacts
with:
Expand All @@ -54,67 +53,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
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 OpenML
@info "attempting to run the doctests"
doctest(OpenML)
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'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using OpenML
DocMeta.setdocmeta!(OpenML, :DocTestSetup, :(using OpenML); recursive=true)
doctest(OpenML)'
18 changes: 18 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -12,4 +28,6 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name = "OpenML"
uuid = "8b6db2d4-7670-4922-a472-f9537c81ab66"
authors = ["Diego Arenas <darenasc@gmail.com>", "Anthony D. Blaom <anthony.blaom@gmail.com>"]
version = "0.3.1"
version = "0.3.3"

[deps]
ARFFFiles = "da404889-ca92-49ff-9e8b-0aa6b4d38dc8"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand All @@ -13,15 +14,16 @@ Scratch = "6c6a2e73-6563-6170-7368-637461726353"

[compat]
ARFFFiles = "1.4.1"
Downloads = "1.6.0"
HTTP = "0.8, 0.9, 1"
JSON = "0.21"
JSON = "0.21, 1"
Scratch = "1.1"
julia = "1.6"

[extras]
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"

[targets]
test = ["Tables", "Test", "Logging"]
21 changes: 0 additions & 21 deletions README.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ OpenML = "8b6db2d4-7670-4922-a472-f9537c81ab66"
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"

[compat]
Documenter = "~0.26"
Documenter = "1"
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Contains both the original `Documenter.jl` documentation and the same documentation rendered as markdown to include in the harmonized OpenML docs.

Generating the markdown is done as follows:

* Install [DocumenterMarkDown](https://documentermarkdown.juliadocs.org/dev/).
* Note: currently this only works with version 0.27 of Documenter.jl
* In Julia, open the package manager (type ']') and run `add Documenter@0.27` and `add DocumenterMarkdown`.
* Run `julia make-md.jl` in the `docs` folder to generate the markdown filew
* These appear in the `build` folder
* Run `mkdocs serve` in the root folder to build the markdown docs.

7 changes: 7 additions & 0 deletions docs/make-md.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using OpenML, DataFrames, ScientificTypes, DocumenterMarkdown, Documenter

makedocs(
format = Markdown(),
modules = [OpenML,],
sitename = "OpenML.jl",
)
8 changes: 6 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using Documenter, OpenML, DataFrames

const REPO = Remotes.GitHub("JuliaAI", "OpenML.jl")

makedocs(
modules = [OpenML,],
sitename = "OpenML.jl",
warnonly = [:cross_references, :missing_docs],
repo = Remotes.GitHub("JuliaAI", "LearnAPI.jl"),
)

deploydocs(
repo = "github.com/JuliaAI/OpenML.jl",
push_preview = true
repo = "github.com/JuliaAI/OpenML.jl.git",
devbranch="dev",
)
59 changes: 59 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
site_name: OpenML.jl
repo_url: https://github.com/openml/OpenML.jl
site_description: "This is the reference documentation of OpenML.jl"

theme:
name: "material"
language: "en"
palette:
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
primary: indigo
accent: indigo
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode
font:
text: "Roboto"
code: "Roboto Mono"
icon:
edit: material/pencil
view: material/eye

extra_css:
- assets/Documenter.css

extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML
- assets/mathjaxhelper.js

markdown_extensions:
- extra
- tables
- fenced_code
- admonition
- codehilite
- attr_list
- pymdownx.details
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences


docs_dir: 'docs/build'

nav:
- Home: index.md
2 changes: 2 additions & 0 deletions src/OpenML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using JSON
import ARFFFiles
using Markdown
using Scratch
import Downloads

export OpenML

Expand All @@ -17,3 +18,4 @@ function __init__()
end

end # module

9 changes: 7 additions & 2 deletions src/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ function load(id::Int; maxbytes = nothing)
fname = joinpath(download_cache, "$id.arff")
if !isfile(fname)
@info "Downloading dataset $id."
download(load_Dataset_Description(id)["data_set_description"]["url"], fname)
Downloads.download(
load_Dataset_Description(id)["data_set_description"]["url"],
fname,)
end
open(fname) do io
reader = ARFFFiles.loadstreaming(io)
return ARFFFiles.readcolumns(reader; maxbytes=maxbytes)
end
ARFFFiles.load(x -> ARFFFiles.readcolumns(x; maxbytes = maxbytes), fname)
end


Expand Down
8 changes: 1 addition & 7 deletions test/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ offset = 8
filters_test = OpenML.load_List_And_Filter("limit/$limit/offset/$offset")

@testset "HTTP connection" begin
@test typeof(response_test) <: Dict
# @test typeof(response_test) <: Dict
@test response_test["data_set_description"]["name"] == "iris"
@test response_test["data_set_description"]["format"] == "ARFF"
end
Expand All @@ -28,14 +28,8 @@ end
end

@testset "data api functions" begin
@test typeof(dqlist_test["data_qualities_list"]) <: Dict

@test typeof(data_features_test) <: Dict
@test length(data_features_test["data_features"]["feature"]) == 5
@test data_features_test["data_features"]["feature"][1]["name"] == "sepallength"

@test typeof(data_qualities_test) <: Dict

@test length(filters_test["data"]["dataset"]) == limit
@test length(filters_test["data"]["dataset"][1]) == offset
end
Expand Down
Loading