Skip to content
Merged
23 changes: 22 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,27 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh shit, that shouldn't be there... why is static needed? Just noticed this too late. This should not be in SciMLBase!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduce_tup is used for the Dual type checking, anyeltypedual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can that be isolated from the rest of Static?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, I don't see anything in the definition that uses anything besides Base functions. Should I just copy paste this?

@generated function reduce_tup(f::F, inds::Tuple{Vararg{Any, N}}) where {F, N}
    q = Expr(:block, Expr(:meta, :inline, :propagate_inbounds))
    if N == 1
        push!(q.args, :(inds[1]))
        return q
    end
    syms = Vector{Symbol}(undef, N)
    i = 0
    for n in 1:N
        syms[n] = iₙ = Symbol(:i_, (i += 1))
        push!(q.args, Expr(:(=), iₙ, Expr(:ref, :inds, n)))
    end
    W = 1 << (8sizeof(N) - 2 - leading_zeros(N))
    while W > 0
        _N = length(syms)
        for _ in (2W):W:_N
            for w in 1:W
                new_sym = Symbol(:i_, (i += 1))
                push!(q.args, Expr(:(=), new_sym, Expr(:call, :f, syms[w], syms[w + W])))
                syms[w] = new_sym
            end
            deleteat!(syms, (1 + W):(2W))
        end
        W >>>= 1
    end
    q
end

StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"

[weakdeps]
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
Expand All @@ -53,6 +61,12 @@ SciMLBasePyCallExt = "PyCall"
SciMLBasePythonCallExt = "PythonCall"
SciMLBaseRCallExt = "RCall"
SciMLBaseZygoteExt = ["Zygote", "ChainRulesCore"]
SciMLBaseDistributionsExt = "Distributions"
SciMLBaseMonteCarloMeasurementsExt = "MonteCarloMeasurements"
SciMLBaseMooncakeExt = "Mooncake"
SciMLBaseReverseDiffExt = "ReverseDiff"
SciMLBaseTrackerExt = "Tracker"
SciMLBaseForwardDiffExt = "ForwardDiff"

[compat]
ADTypes = "0.2.5,1.0.0"
Expand All @@ -64,6 +78,7 @@ ChainRulesCore = "1.18"
CommonSolve = "0.2.4"
ConstructionBase = "1.5"
Distributed = "1.10"
Distributions = "0.25"
DocStringExtensions = "0.9"
EnumX = "1"
ForwardDiff = "0.10.36, 1"
Expand All @@ -75,6 +90,9 @@ MLStyle = "0.4.17"
Makie = "0.20, 0.21, 0.22, 0.23, 0.24"
Markdown = "1.10"
Moshi = "0.3"
Mooncake = "0.4"
Measurements = "2"
MonteCarloMeasurements = "1"
PartialFunctions = "1.1"
PreallocationTools = "0.4.31"
PrecompileTools = "1.2"
Expand All @@ -86,15 +104,18 @@ RCall = "0.14.0"
RecipesBase = "1.3.4"
RecursiveArrayTools = "3.35"
Reexport = "1"
ReverseDiff = "1"
RuntimeGeneratedFunctions = "0.5.12"
SciMLOperators = "1.3"
SciMLStructures = "1.1"
StableRNGs = "1.0"
Static = "1"
StaticArrays = "1.7"
StaticArraysCore = "1.4"
Statistics = "1.10"
SymbolicIndexingInterface = "0.3.36"
Tables = "1.11"
Tracker = "0.2"
Zygote = "0.7.10"
julia = "1.10"

Expand All @@ -116,4 +137,4 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "ForwardDiff", "MLStyle", "PartialFunctions", "Pkg", "SafeTestsets", "Serialization", "StableRNGs", "StaticArrays", "Tables", "Test", "UnicodePlots", "Zygote"]
test = ["Aqua", "ForwardDiff", "MLStyle", "PartialFunctions", "Pkg", "SafeTestsets", "Serialization", "StableRNGs", "StaticArrays", "Tables", "Test", "UnicodePlots", "Zygote", "Distributions", "MonteCarloMeasurements", "Measurements", "ReverseDiff", "Tracker"]
8 changes: 8 additions & 0 deletions ext/SciMLBaseDistributionsExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module SciMLBaseDistributionsExt

using Distributions, SciMLBase

SciMLBase.handle_distribution_u0(_u0::Distributions.Sampleable) = rand(_u0)
SciMLBase.isdistribution(_u0::Distributions.Sampleable) = true

end
Loading
Loading