diff --git a/Project.toml b/Project.toml index ab14292..d1532da 100644 --- a/Project.toml +++ b/Project.toml @@ -3,13 +3,7 @@ uuid = "89f642e6-4179-4274-8202-c11f4bd9a72c" authors = ["Samuel Belko and contributors"] version = "1.0.0" -[deps] -Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" - [compat] -Statistics = "1" -StatsBase = "0.34" julia = "1.10" [extras] diff --git a/docs/make.jl b/docs/make.jl index 3454cbd..d82cb28 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,9 @@ using Documenter, SurrogatesBase +DocMeta.setdocmeta!(SurrogatesBase, + :DocTestSetup, + :(using SurrogatesBase)) + cp("./docs/Manifest.toml", "./docs/src/assets/Manifest.toml", force = true) cp("./docs/Project.toml", "./docs/src/assets/Project.toml", force = true) @@ -14,7 +18,7 @@ ENV["GKSwstype"] = "100" makedocs(modules = [SurrogatesBase], sitename = "SurrogatesBase.jl", clean = true, - doctest = false, + doctest = true, linkcheck = true, format = Documenter.HTML(assets = ["assets/favicon.ico"], canonical = "https://docs.sciml.ai/SurrogatesBase/stable/"), diff --git a/docs/src/interface.md b/docs/src/interface.md index c57e5d2..ae9aaab 100644 --- a/docs/src/interface.md +++ b/docs/src/interface.md @@ -75,8 +75,7 @@ The following methods might be supported: - `mean(finite_posterior(s,xs))` returns a `Vector` of posterior means at `xs` - `var(finite_posterior(s,xs))` returns a `Vector` of posterior variances at `xs` -- `mean_and_var(finite_posterior(s,xs))` returns a `Tuple` consisting of a `Vector` -of posterior means and a `Vector` of posterior variances at `xs` +- `mean_and_var(finite_posterior(s,xs))` returns a `Tuple` consisting of a `Vector` of posterior means and a `Vector` of posterior variances at `xs` - `rand(finite_posterior(s,xs))` returns a `Vector`, which is a sample from the joint posterior at points `xs` ### Optional methods diff --git a/src/SurrogatesBase.jl b/src/SurrogatesBase.jl index d55cc10..1f5391c 100644 --- a/src/SurrogatesBase.jl +++ b/src/SurrogatesBase.jl @@ -18,18 +18,18 @@ Subtypes of `AbstractDeterministicSurrogate` are callable with a `Vector` of poi The result is a `Vector` of evaluations of the surrogate at points `xs`, corresponding to approximations of the underlying function at points `xs` respectively. - # Examples - ```jldoctest - julia> struct ZeroSurrogate <: AbstractDeterministicSurrogate end +# Examples - julia> (::ZeroSurrogate)(xs) = 0 +```jldoctest +julia> struct ZeroSurrogate <: AbstractDeterministicSurrogate end - julia> s = ZeroSurrogate() - ZeroSurrogate() +julia> (::ZeroSurrogate)(xs) = 0 - julia> s([4]) == 0 - true - ``` +julia> s = ZeroSurrogate(); + +julia> s([4]) == 0 +true +``` """ abstract type AbstractDeterministicSurrogate <: Function end @@ -93,8 +93,7 @@ the returned object: - `mean(finite_posterior(s,xs))` returns a `Vector` of posterior means at `xs` - `var(finite_posterior(s,xs))` returns a `Vector` of posterior variances at `xs` -- `mean_and_var(finite_posterior(s,xs))` returns a `Tuple` consisting of a `Vector` -of posterior means and a `Vector` of posterior variances at `xs` +- `mean_and_var(finite_posterior(s,xs))` returns a `Tuple` consisting of a `Vector` of posterior means and a `Vector` of posterior variances at `xs` - `rand(finite_posterior(s,xs))` returns a `Vector`, which is a sample from the joint posterior at points `xs`