diff --git a/Project.toml b/Project.toml index 83e260710..d65787be7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +version = "2.122.0" authors = ["Chris Rackauckas and contributors"] -version = "2.121.1" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" @@ -28,6 +28,7 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" +SciMLPublic = "431bcebd-1456-4ced-9d72-93c2757fff0b" SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" @@ -82,8 +83,8 @@ ConstructionBase = "1.5" Distributed = "1.10" Distributions = "0.25" DocStringExtensions = "0.9" -Enzyme = "0.13" EnumX = "1" +Enzyme = "0.13" ForwardDiff = "0.10.36, 1" FunctionWrappersWrappers = "0.1.3" IteratorInterfaceExtensions = "^1" @@ -110,6 +111,7 @@ Reexport = "1" ReverseDiff = "1" RuntimeGeneratedFunctions = "0.5.12" SciMLOperators = "1.3" +SciMLPublic = "1.0.0" SciMLStructures = "1.1" StableRNGs = "1.0" StaticArrays = "1.7" diff --git a/docs/src/interfaces/Algorithms.md b/docs/src/interfaces/Algorithms.md index eb2f4c9b1..cce780597 100644 --- a/docs/src/interfaces/Algorithms.md +++ b/docs/src/interfaces/Algorithms.md @@ -35,6 +35,8 @@ SciMLBase.isadaptive SciMLBase.isdiscrete SciMLBase.forwarddiffs_model SciMLBase.forwarddiffs_model_time +SciMLBase.has_init +SciMLBase.has_step ``` ### Abstract SciML Algorithms diff --git a/src/SciMLBase.jl b/src/SciMLBase.jl index 9c950a944..92b149941 100644 --- a/src/SciMLBase.jl +++ b/src/SciMLBase.jl @@ -46,6 +46,8 @@ import SciMLOperators: @reexport using SciMLOperators +using SciMLPublic: @public + function __solve end function __init end @@ -930,4 +932,9 @@ export Clocks, TimeDomain, is_discrete_time_domain, isclock, issolverstepclock, export ODEAliasSpecifier, LinearAliasSpecifier +# Public traits + +@public has_init +@public has_step + end diff --git a/src/alg_traits.jl b/src/alg_traits.jl index fcbc4c8ff..8b96ef7fb 100644 --- a/src/alg_traits.jl +++ b/src/alg_traits.jl @@ -299,8 +299,23 @@ allows_late_binding_tstops(alg::AbstractODEAlgorithm) = false """ $(TYPEDSIGNATURES) -Trait declaration for whether the optimization algorithm supports the `init` interface. +Trait declaration for whether the optimization algorithm supports the `init` interface. Deprecated as this is not an optimization-specific idea and should use the traits for general caching. """ supports_opt_cache_interface(alg) = false + +""" + $(TYPEDSIGNATURES) + +Trait for specifying whether the passed algorithm supports `init`. Any `init`ed object can `solve!`. +""" +has_init(a::AbstractSciMLAlgorithm) = false + +""" + $(TYPEDSIGNATURES) + +Trait for specifying whether the passed algorithm supports `step!`, specifying a more direct control over the internal solver process. +See https://docs.sciml.ai/SciMLBase/stable/interfaces/Init_Solve/#init-and-the-Iterator-Interface for more details. +""" +has_step(a::AbstractSciMLAlgorithm) = false diff --git a/src/integrator_interface.jl b/src/integrator_interface.jl index d3c1122ad..9ba669d56 100644 --- a/src/integrator_interface.jl +++ b/src/integrator_interface.jl @@ -83,7 +83,7 @@ end """ ratenoise_cache(integrator::DEIntegrator) -Returns cache arrays for rate noise in stochastic differential equations. +Returns cache arrays for rate noise in stochastic differential equations. Returns an empty tuple by default for deterministic problems. """ ratenoise_cache(i::DEIntegrator) = ()