Skip to content
Open
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
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

Expand All @@ -27,7 +26,6 @@ Parameters = "0.12"
RecursiveArrayTools = "2"
Reexport = "0.2, 1.0"
SciMLBase = "1"
StaticArrays = "1"
Zygote = "0.6"
julia = "1.6"

Expand All @@ -46,9 +44,10 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"

[targets]
test = ["Test", "SafeTestsets", "TestExtras", "Pkg", "PkgBenchmark", "BenchmarkTools", "ReferenceTests", "SymPy", "Random", "OrdinaryDiffEq", "ComponentArrays", "ForwardDiff", "Integrals", "IntegralsCubature", "IntegralsCuba", "FiniteDiff", "RecursiveArrayTools"]
test = ["Test", "SafeTestsets", "TestExtras", "Pkg", "PkgBenchmark", "BenchmarkTools", "ReferenceTests", "SymPy", "StaticArrays", "Random", "OrdinaryDiffEq", "ComponentArrays", "ForwardDiff", "Integrals", "IntegralsCubature", "IntegralsCuba", "FiniteDiff", "RecursiveArrayTools"]
2 changes: 1 addition & 1 deletion src/SciMLExpectations.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SciMLExpectations

# LinearAlgebra
using DiffEqBase, SciMLBase, Statistics, Reexport, RecursiveArrayTools, StaticArrays,
using DiffEqBase, SciMLBase, Statistics, Reexport, RecursiveArrayTools,
Distributions, KernelDensity, Zygote, LinearAlgebra, Random
using Parameters: @unpack

Expand Down
4 changes: 2 additions & 2 deletions src/distribution_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function GenericDistribution(d::Distributions.Sampleable, ds...)
dists = (d, ds...)
pdf_func(x) = exp(sum(logpdf(f, y) for (f, y) in zip(dists, x)))
rand_func() = [rand(d) for d in dists]
lb = SVector(map(minimum, dists)...)
ub = SVector(map(maximum, dists)...)
lb = tuple(map(minimum, dists)...)
ub = tuple(map(maximum, dists)...)

GenericDistribution(pdf_func, rand_func, lb, ub)
end
Expand Down
6 changes: 3 additions & 3 deletions test/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ end
@constinferred GenericDistribution(pdf_f, rand_f, lb, ub)

for gd in (gd_ind, gd_raw)
@test minimum(gd) == minimum(P)
@test maximum(gd) == maximum(P)
@test extrema(gd) == extrema(P)
@test minimum([gd...]) == minimum([P...])
@test maximum([gd...]) == maximum([P...])
@test extrema([gd...]) == extrema([P...])
@test pdf(gd, x) ≈ pdf(P, x)
@constinferred pdf(gd, x)

Expand Down