Skip to content

Commit

Permalink
Merge pull request #8 from samuelbelko/remove-dep-and-fix-docs
Browse files Browse the repository at this point in the history
Remove dependencies and improve docs
  • Loading branch information
ChrisRackauckas authored Feb 28, 2024
2 parents 135a11d + 18bab89 commit df1f49f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
6 changes: 0 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ uuid = "89f642e6-4179-4274-8202-c11f4bd9a72c"
authors = ["Samuel Belko <[email protected]> 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]
Expand Down
6 changes: 5 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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/"),
Expand Down
3 changes: 1 addition & 2 deletions docs/src/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 10 additions & 11 deletions src/SurrogatesBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit df1f49f

Please sign in to comment.