Skip to content

Commit 4f1de49

Browse files
authored
Make dataset loading case insensitive (#12)
* make dataset loading case insensitive * ignore versioned manifests * Aqua version bump * CI overhaul * full test coverage * more CI tweaks * only do macos for current release
1 parent ebb7c7b commit 4f1de49

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,32 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
version: [1.6, 1, nightly]
25-
arch: [x64]
26-
os: [ubuntu-latest]
24+
version: [min, 1, nightly]
25+
os: [ubuntu-latest, macos-latest]
26+
exclude:
27+
- os: macos-latest
28+
version: min
29+
- os: macos-latest
30+
version: nightly
2731
steps:
2832
- name: Checkout
2933
uses: actions/checkout@v4
3034
- name: Julia Setup
3135
uses: julia-actions/setup-julia@v2
3236
with:
33-
version: ${{ matrix.version }}
34-
arch: ${{ matrix.arch }}
37+
version: ${{ matrix.version }}
3538
- uses: julia-actions/cache@v2
3639
with:
3740
cache-compiled: "true"
38-
- name: Build
39-
uses: julia-actions/julia-buildpkg@v1
4041
- name: Test
4142
uses: julia-actions/julia-runtest@v1
4243
env:
4344
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4445
- name: Coverage Process
4546
uses: julia-actions/julia-processcoverage@v1
46-
if: ${{ startsWith(matrix.os, 'ubuntu') && (matrix.version == '1') }}
4747
- name: Coverage Upload
4848
uses: codecov/codecov-action@v5
49-
if: ${{ startsWith(matrix.os, 'ubuntu') && (matrix.version == '1') }}
5049
with:
51-
file: lcov.info
50+
files: lcov.info
5251
env:
5352
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/style.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,29 @@ on:
1212
- '.gitignore'
1313
jobs:
1414
format-check:
15-
name: Style Enforcement (Julia ${{ matrix.julia-version }} - ${{ github.event_name }})
15+
name: Style Enforcement (Julia ${{ matrix.version }} - ${{ github.event_name }})
1616
# Run on push's or non-draft PRs
1717
if: (github.event_name == 'push') || (github.event.pull_request.draft == false)
1818
runs-on: ubuntu-latest
1919
# TODO: further restrict this
2020
permissions: write-all
2121
strategy:
2222
matrix:
23-
julia-version: [1.6]
23+
version: [1]
2424
steps:
25-
- uses: julia-actions/setup-julia@latest
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Julia Setup
28+
uses: julia-actions/setup-julia@v2
2629
with:
27-
version: ${{ matrix.julia-version }}
28-
- uses: actions/checkout@v4
30+
version: ${{ matrix.version }}
31+
- uses: julia-actions/cache@v2
32+
with:
33+
cache-compiled: "true"
2934
- name: Instantiate `format` environment and format
3035
run: |
31-
julia -e'
32-
using Pkg; Pkg.activate()
36+
julia --project=@format -e'
37+
using Pkg;
3338
Pkg.add("JuliaFormatter")
3439
using JuliaFormatter
3540
format(".", YASStyle())'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ docs/site/
2222
# committed for packages, but should be committed for applications that require a static
2323
# environment.
2424
Manifest.toml
25+
Manifest-v*.toml
26+
coverage/lcov.info

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
name = "MixedModelsDatasets"
22
uuid = "7e9fb7ac-9f67-43bf-b2c8-96ba0796cbb6"
33
authors = ["Phillip Alday <[email protected]>", "Douglas Bates <[email protected]>"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
88
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
99
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
1010

1111
[compat]
12-
Aqua = "0.5, 0.6, 0.7"
12+
Aqua = "0.8"
1313
Arrow = "1, 2"
1414
Artifacts = "1"
1515
LazyArtifacts = "1"
16+
Test = "0.0, 1"
1617
julia = "1.6"
1718

1819
[extras]

src/MixedModelsDatasets.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ cacheddatasets = Dict{String,Arrow.Table}()
1313
dataset(nm)
1414
1515
Return, as an `Arrow.Table`, the test data set named `nm`, which can be a `String` or `Symbol`
16+
17+
!!! note "Case insensitive"
18+
Dataset names are case insensitive: internally all names are normalized to lowercase.
1619
"""
1720
function dataset(nm::AbstractString)
1821
get!(cacheddatasets, nm) do
19-
path = joinpath(_testdata(), nm * ".arrow")
22+
path = joinpath(_testdata(), lowercase(nm) * ".arrow")
2023
if !isfile(path)
2124
throw(ArgumentError("Dataset \"$nm\" is not available.\nUse MixedModels.datasets() for available names."))
2225
end

test/runtests.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ using MixedModelsDatasets
44
using Test
55

66
@testset "Aqua" begin
7-
@static if VERSION >= v"1.9"
8-
Aqua.test_all(MixedModelsDatasets; ambiguities=false, piracy=true)
9-
end
7+
Aqua.test_all(MixedModelsDatasets)
108
end
119

1210
@testset "datasets" begin
1311
@test length(datasets()) == 17
1412

1513
@testset "$(ds) loadable" for ds in datasets()
1614
@test dataset(ds) isa Arrow.Table
15+
@test dataset(Symbol(titlecase(ds))) isa Arrow.Table
1716
end
17+
18+
@test_throws ArgumentError dataset("This is not a Dataset")
1819
end

0 commit comments

Comments
 (0)