diff --git a/Project.toml b/Project.toml index af77cf7d5..aa9501100 100644 --- a/Project.toml +++ b/Project.toml @@ -10,9 +10,9 @@ DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" +MixedModelsDatasets = "7e9fb7ac-9f67-43bf-b2c8-96ba0796cbb6" NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" @@ -36,7 +36,7 @@ DataAPI = "1" Distributions = "0.21, 0.22, 0.23, 0.24, 0.25" GLM = "1.8.2" JSON3 = "1" -LazyArtifacts = "1" +MixedModelsDatasets = "0.1" NLopt = "0.6, 1" PooledArrays = "0.5, 1" PrecompileTools = "1" diff --git a/src/MixedModels.jl b/src/MixedModels.jl index 9cbca31f1..9052d5b1f 100644 --- a/src/MixedModels.jl +++ b/src/MixedModels.jl @@ -6,7 +6,6 @@ using DataAPI using Distributions using GLM using JSON3 -using LazyArtifacts using LinearAlgebra using Markdown using NLopt @@ -27,6 +26,7 @@ using LinearAlgebra: BlasFloat, BlasReal, HermOrSym, PosDefException, copytri! using Base: Ryu, require_one_based_indexing using DataAPI: levels, refpool, refarray, refvalue using GLM: Link, canonicallink, linkfun, linkinv, dispersion, dispersion_parameter +using MixedModelsDatasets: dataset, datasets using NLopt: Opt using StatsModels: TableRegressionModel using StatsFuns: log2π, normccdf @@ -164,7 +164,6 @@ abstract type MixedModel{T} <: StatsModels.RegressionModel end # model with fixe include("utilities.jl") include("blocks.jl") include("pca.jl") -include("datasets.jl") include("arraytypes.jl") include("varcorr.jl") include("Xymat.jl") diff --git a/src/datasets.jl b/src/datasets.jl deleted file mode 100644 index a8b9861a3..000000000 --- a/src/datasets.jl +++ /dev/null @@ -1,33 +0,0 @@ -_testdata() = artifact"TestData" - -cacheddatasets = Dict{String,Arrow.Table}() -""" - dataset(nm) - -Return, as an `Arrow.Table`, the test data set named `nm`, which can be a `String` or `Symbol` -""" -function dataset(nm::AbstractString) - get!(cacheddatasets, nm) do - path = joinpath(_testdata(), nm * ".arrow") - if !isfile(path) - throw( - ArgumentError( - "Dataset \"$nm\" is not available.\nUse MixedModels.datasets() for available names.", - ), - ) - end - Arrow.Table(path) - end -end -dataset(nm::Symbol) = dataset(string(nm)) - -""" - datasets() - -Return a vector of names of the available test data sets -""" -function datasets() - return first.( - Base.Filesystem.splitext.(filter(endswith(".arrow"), readdir(_testdata()))) - ) -end