From f17ddc29045d8e2142361808e65a8adf6f07016b Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 9 Feb 2024 12:45:02 +0000 Subject: [PATCH] build based on b175087 --- previews/PR42/.documenter-siteinfo.json | 2 +- previews/PR42/api/index.html | 14 ++-- previews/PR42/assets/Manifest.toml | 14 ++-- previews/PR42/complete_sii/index.html | 2 +- previews/PR42/index.html | 8 +-- previews/PR42/simple_sii_sys/index.html | 2 +- previews/PR42/solution_wrappers/index.html | 2 +- .../PR42/usage/{55391e9e.svg => 2c13ec45.svg} | 64 +++++++++---------- previews/PR42/usage/index.html | 4 +- 9 files changed, 57 insertions(+), 55 deletions(-) rename previews/PR42/usage/{55391e9e.svg => 2c13ec45.svg} (98%) diff --git a/previews/PR42/.documenter-siteinfo.json b/previews/PR42/.documenter-siteinfo.json index a9752e6..bde94a7 100644 --- a/previews/PR42/.documenter-siteinfo.json +++ b/previews/PR42/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2024-02-09T07:46:00","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2024-02-09T12:44:56","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/previews/PR42/api/index.html b/previews/PR42/api/index.html index 1653db5..6d0d81b 100644 --- a/previews/PR42/api/index.html +++ b/previews/PR42/api/index.html @@ -3,10 +3,10 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-90474609-3', {'page_path': location.pathname + location.search + location.hash}); -

Interface Functions

Mandatory methods

SymbolicIndexingInterface.symbolic_containerFunction
symbolic_container(p)

Using p, return an object that implements the symbolic indexing interface. In case p itself implements the interface, p can be returned as-is. All symbolic indexing interface methods fall back to calling the same method on symbolic_container(p), so this may be used for trivial implementations of the interface that forward all calls to another object.

source
SymbolicIndexingInterface.variable_symbolsFunction
variable_symbols(sys, [i])

Return a vector of the symbolic variables being solved for in the system sys. If constant_structure(sys) == false this accepts an additional parameter indicating the current time index. The returned vector should not be mutated.

For types that implement Base.getindex with symbolic indices using this interface, the shorthand sys[solvedvariables] can be used as shorthand for sys[variable_symbols(sys)]. See: solvedvariables.

source
SymbolicIndexingInterface.all_variable_symbolsFunction
all_variable_symbols(sys)

Return a vector of variable symbols in the system, including observed quantities.

For types that implement Base.getindex with symbolic indices using this interface, The shorthand sys[allvariables] can be used as shorthand for sys[all_variable_symbols(sys)]. See: allvariables.

source

Optional Methods

Observed equation handling

SymbolicIndexingInterface.observedFunction
observed(sys, sym, [states])

Return the observed function of the given sym in sys. The returned function should have the signature (u, p) -> [values...] where u and p is the current state and parameter vector, respectively. If istimedependent(sys) == true, the function should accept the current time t as its third parameter. If constant_structure(sys) == false, accept a third parameter, which can either be a vector of symbols indicating the order of states or a time index, which identifies the order of states. This function does not need to be defined if is_observed always returns false. Thus, it is mandatory to always check is_observed before using this function.

See also: is_time_dependent, constant_structure

source

Parameter indexing

SymbolicIndexingInterface.parameter_valuesFunction
parameter_values(p)
-parameter_values(p, i)

Return an indexable collection containing the value of each parameter in p. The two- argument version of this function returns the parameter value at index i. The two-argument version of this function will default to returning parameter_values(p)[i].

If this function is called with an AbstractArray, it will return the same array.

source
SymbolicIndexingInterface.set_parameter!Function
set_parameter!(sys, val, idx)

Set the parameter at index idx to val for system sys. This defaults to modifying parameter_values(sys). If any additional bookkeeping needs to be performed or the default implementation does not work for a particular type, this method needs to be defined to enable the proper functioning of setp.

See: parameter_values

source
SymbolicIndexingInterface.getpFunction
getp(sys, p)

Return a function that takes an array representing the parameter vector or an integrator or solution of sys, and returns the value of the parameter p. Note that p can be a direct index or a symbolic value, or an array/tuple of the aforementioned.

Requires that the integrator or solution implement parameter_values. This function typically does not need to be implemented, and has a default implementation relying on parameter_values.

source
SymbolicIndexingInterface.setpFunction
setp(sys, p)

Return a function that takes an array representing the parameter vector or an integrator or problem of sys, and a value, and sets the parameter p to that value. Note that p can be a direct index or a symbolic value.

Requires that the integrator implement parameter_values and the returned collection be a mutable reference to the parameter vector in the integrator. In case parameter_values cannot return such a mutable reference, or additional actions need to be performed when updating parameters, set_parameter! must be implemented.

source
SymbolicIndexingInterface.ParameterIndexingProxyType
struct ParameterIndexingProxy

This struct wraps any struct implementing the symbolic indexing interface. It allows getindex and setindex! operations to get/set parameter values. Requires that the wrapped type support getp and setp for getting and setting parameter values respectively.

source

State indexing

SymbolicIndexingInterface.NotTimeseriesType
struct NotTimeseries <: IsTimeseriesTrait end

Trait indicating a type does not contain timeseries data. This affects the behaviour of functions such as state_values and current_time. Note that if a type is NotTimeseries this only implies that it does not store timeseries data. It may still be time-dependent. For example, an ODEProblem only stores the initial state of a system, so it is NotTimeseries, but still time-dependent. This is the default trait variant for all types.

See also: Timeseries, is_timeseries

source
SymbolicIndexingInterface.state_valuesFunction
state_values(p)
-state_values(p, i)

Return an indexable collection containing the values of all states in the integrator or problem p. If is_timeseries(p) is Timeseries, return a vector of arrays, each of which contain the state values at the corresponding timestep. In this case, the two-argument version of the function can also be implemented to efficiently return the state values at timestep i. By default, the two-argument method calls state_values(p)[i]

If this function is called with an AbstractArray, it will return the same array.

See: is_timeseries

source
SymbolicIndexingInterface.set_state!Function
set_state!(sys, val, idx)

Set the state at index idx to val for system sys. This defaults to modifying state_values(sys). If any additional bookkeeping needs to be performed or the default implementation does not work for a particular type, this method needs to be defined to enable the proper functioning of setu.

See: state_values

source
SymbolicIndexingInterface.current_timeFunction
current_time(p)
-current_time(p, i)

Return the current time in the integrator or problem p. If is_timeseries(p) is Timeseries, return the vector of timesteps at which the state value is saved. In this case, the two-argument version of the function can also be implemented to efficiently return the time at timestep i. By default, the two- argument method calls current_time(p)[i]

See: is_timeseries

source
SymbolicIndexingInterface.getuFunction
getu(sys, sym)

Return a function that takes an integrator, problem or solution of sys, and returns the value of the symbolic sym. If sym is not an observed quantity, the returned function can also directly be called with an array of values representing the state vector. sym can be a direct index into the state vector, a symbolic state, a symbolic expression involving symbolic quantities in the system sys, a parameter symbol, or the independent variable symbol, or an array/tuple of the aforementioned. If the returned function is called with a timeseries object, it can also be given a second argument representing the index at which to find the value of sym.

At minimum, this requires that the integrator, problem or solution implement state_values. To support symbolic expressions, the integrator or problem must implement observed, parameter_values and current_time.

This function typically does not need to be implemented, and has a default implementation relying on the above functions.

source
SymbolicIndexingInterface.setuFunction
setu(sys, sym)

Return a function that takes an array representing the state vector or an integrator or problem of sys, and a value, and sets the the state sym to that value. Note that sym can be a direct index, a symbolic state, or an array/tuple of the aforementioned.

Requires that the integrator implement state_values and the returned collection be a mutable reference to the state vector in the integrator/problem. Alternatively, if this is not possible or additional actions need to be performed when updating state, set_state! can be defined. This function does not work on types for which is_timeseries is Timeseries.

source

Symbolic Trait

SymbolicIndexingInterface.ArraySymbolicType
struct ArraySymbolic <: SymbolicTypeTrait end

Trait indicating type is a symbolic array. Calling collect on a symbolic array must return an AbstractArray containing ScalarSymbolic variables for each element in the array, in the same shape as the represented array. For example, if a is a symbolic array representing a 2x2 matrix, collect(a) must return a 2x2 array of scalar symbolic variables.

See also: ScalarSymbolic, NotSymbolic, symbolic_type

source

Types

SymbolicIndexingInterface.SymbolCacheType
struct SymbolCache{V,P,I}
-function SymbolCache(vars, [params, [indepvars]])

A struct implementing the symbolic indexing interface for the trivial case of having a vector of variables, parameters, and independent variables. This struct does not implement observed, and is_observed returns false for all input symbols. It is considered time dependent if it contains at least one independent variable.

The independent variable may be specified as a single symbolic variable instead of an array containing a single variable if the system has only one independent variable.

source
+

Interface Functions

Mandatory methods

SymbolicIndexingInterface.symbolic_containerFunction
symbolic_container(p)

Using p, return an object that implements the symbolic indexing interface. In case p itself implements the interface, p can be returned as-is. All symbolic indexing interface methods fall back to calling the same method on symbolic_container(p), so this may be used for trivial implementations of the interface that forward all calls to another object.

source
SymbolicIndexingInterface.variable_symbolsFunction
variable_symbols(sys, [i])

Return a vector of the symbolic variables being solved for in the system sys. If constant_structure(sys) == false this accepts an additional parameter indicating the current time index. The returned vector should not be mutated.

For types that implement Base.getindex with symbolic indices using this interface, the shorthand sys[solvedvariables] can be used as shorthand for sys[variable_symbols(sys)]. See: solvedvariables.

source
SymbolicIndexingInterface.all_variable_symbolsFunction
all_variable_symbols(sys)

Return a vector of variable symbols in the system, including observed quantities.

For types that implement Base.getindex with symbolic indices using this interface, The shorthand sys[allvariables] can be used as shorthand for sys[all_variable_symbols(sys)]. See: allvariables.

source

Optional Methods

Observed equation handling

SymbolicIndexingInterface.observedFunction
observed(sys, sym, [states])

Return the observed function of the given sym in sys. The returned function should have the signature (u, p) -> [values...] where u and p is the current state and parameter vector, respectively. If istimedependent(sys) == true, the function should accept the current time t as its third parameter. If constant_structure(sys) == false, accept a third parameter, which can either be a vector of symbols indicating the order of states or a time index, which identifies the order of states. This function does not need to be defined if is_observed always returns false. Thus, it is mandatory to always check is_observed before using this function.

See also: is_time_dependent, constant_structure

source

Parameter indexing

SymbolicIndexingInterface.parameter_valuesFunction
parameter_values(p)
+parameter_values(p, i)

Return an indexable collection containing the value of each parameter in p. The two- argument version of this function returns the parameter value at index i. The two-argument version of this function will default to returning parameter_values(p)[i].

If this function is called with an AbstractArray, it will return the same array.

source
SymbolicIndexingInterface.set_parameter!Function
set_parameter!(sys, val, idx)

Set the parameter at index idx to val for system sys. This defaults to modifying parameter_values(sys). If any additional bookkeeping needs to be performed or the default implementation does not work for a particular type, this method needs to be defined to enable the proper functioning of setp.

See: parameter_values

source
SymbolicIndexingInterface.getpFunction
getp(sys, p)

Return a function that takes an array representing the parameter vector or an integrator or solution of sys, and returns the value of the parameter p. Note that p can be a direct index or a symbolic value, or an array/tuple of the aforementioned.

Requires that the integrator or solution implement parameter_values. This function typically does not need to be implemented, and has a default implementation relying on parameter_values.

source
SymbolicIndexingInterface.setpFunction
setp(sys, p)

Return a function that takes an array representing the parameter vector or an integrator or problem of sys, and a value, and sets the parameter p to that value. Note that p can be a direct index or a symbolic value.

Requires that the integrator implement parameter_values and the returned collection be a mutable reference to the parameter vector in the integrator. In case parameter_values cannot return such a mutable reference, or additional actions need to be performed when updating parameters, set_parameter! must be implemented.

source
SymbolicIndexingInterface.ParameterIndexingProxyType
struct ParameterIndexingProxy

This struct wraps any struct implementing the symbolic indexing interface. It allows getindex and setindex! operations to get/set parameter values. Requires that the wrapped type support getp and setp for getting and setting parameter values respectively.

source

State indexing

SymbolicIndexingInterface.NotTimeseriesType
struct NotTimeseries <: IsTimeseriesTrait end

Trait indicating a type does not contain timeseries data. This affects the behaviour of functions such as state_values and current_time. Note that if a type is NotTimeseries this only implies that it does not store timeseries data. It may still be time-dependent. For example, an ODEProblem only stores the initial state of a system, so it is NotTimeseries, but still time-dependent. This is the default trait variant for all types.

See also: Timeseries, is_timeseries

source
SymbolicIndexingInterface.state_valuesFunction
state_values(p)
+state_values(p, i)

Return an indexable collection containing the values of all states in the integrator or problem p. If is_timeseries(p) is Timeseries, return a vector of arrays, each of which contain the state values at the corresponding timestep. In this case, the two-argument version of the function can also be implemented to efficiently return the state values at timestep i. By default, the two-argument method calls state_values(p)[i]

If this function is called with an AbstractArray, it will return the same array.

See: is_timeseries

source
SymbolicIndexingInterface.set_state!Function
set_state!(sys, val, idx)

Set the state at index idx to val for system sys. This defaults to modifying state_values(sys). If any additional bookkeeping needs to be performed or the default implementation does not work for a particular type, this method needs to be defined to enable the proper functioning of setu.

See: state_values

source
SymbolicIndexingInterface.current_timeFunction
current_time(p)
+current_time(p, i)

Return the current time in the integrator or problem p. If is_timeseries(p) is Timeseries, return the vector of timesteps at which the state value is saved. In this case, the two-argument version of the function can also be implemented to efficiently return the time at timestep i. By default, the two- argument method calls current_time(p)[i]

See: is_timeseries

source
SymbolicIndexingInterface.getuFunction
getu(sys, sym)

Return a function that takes an integrator, problem or solution of sys, and returns the value of the symbolic sym. If sym is not an observed quantity, the returned function can also directly be called with an array of values representing the state vector. sym can be a direct index into the state vector, a symbolic state, a symbolic expression involving symbolic quantities in the system sys, a parameter symbol, or the independent variable symbol, or an array/tuple of the aforementioned. If the returned function is called with a timeseries object, it can also be given a second argument representing the index at which to find the value of sym.

At minimum, this requires that the integrator, problem or solution implement state_values. To support symbolic expressions, the integrator or problem must implement observed, parameter_values and current_time.

This function typically does not need to be implemented, and has a default implementation relying on the above functions.

source
SymbolicIndexingInterface.setuFunction
setu(sys, sym)

Return a function that takes an array representing the state vector or an integrator or problem of sys, and a value, and sets the the state sym to that value. Note that sym can be a direct index, a symbolic state, or an array/tuple of the aforementioned.

Requires that the integrator implement state_values and the returned collection be a mutable reference to the state vector in the integrator/problem. Alternatively, if this is not possible or additional actions need to be performed when updating state, set_state! can be defined. This function does not work on types for which is_timeseries is Timeseries.

source

Symbolic Trait

SymbolicIndexingInterface.ArraySymbolicType
struct ArraySymbolic <: SymbolicTypeTrait end

Trait indicating type is a symbolic array. Calling collect on a symbolic array must return an AbstractArray containing ScalarSymbolic variables for each element in the array, in the same shape as the represented array. For example, if a is a symbolic array representing a 2x2 matrix, collect(a) must return a 2x2 array of scalar symbolic variables.

See also: ScalarSymbolic, NotSymbolic, symbolic_type

source

Types

SymbolicIndexingInterface.SymbolCacheType
struct SymbolCache{V,P,I}
+function SymbolCache(vars, [params, [indepvars]])

A struct implementing the symbolic indexing interface for the trivial case of having a vector of variables, parameters, and independent variables. This struct does not implement observed, and is_observed returns false for all input symbols. It is considered time dependent if it contains at least one independent variable.

The independent variable may be specified as a single symbolic variable instead of an array containing a single variable if the system has only one independent variable.

source
diff --git a/previews/PR42/assets/Manifest.toml b/previews/PR42/assets/Manifest.toml index 587f04f..27667e7 100644 --- a/previews/PR42/assets/Manifest.toml +++ b/previews/PR42/assets/Manifest.toml @@ -281,9 +281,9 @@ version = "1.9.1" [[deps.DiffEqBase]] deps = ["ArrayInterface", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces"] -git-tree-sha1 = "6af33c2eb7478db06bcf5c810e6f3dda53aac2ac" +git-tree-sha1 = "fefc2eeabecb745f1b1e1f91634381f7c81bd75d" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.146.0" +version = "6.146.1" [deps.DiffEqBase.extensions] DiffEqBaseChainRulesCoreExt = "ChainRulesCore" @@ -1313,9 +1313,9 @@ version = "0.2.1" [[deps.PreallocationTools]] deps = ["Adapt", "ArrayInterface", "ForwardDiff"] -git-tree-sha1 = "64bb68f76f789f5fe5930a80af310f19cdafeaed" +git-tree-sha1 = "9d6e62d1ea6ab709142b42d3be4bd1db495bc4e0" uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" -version = "0.4.17" +version = "0.4.18" [deps.PreallocationTools.extensions] PreallocationToolsReverseDiffExt = "ReverseDiff" @@ -1465,12 +1465,13 @@ version = "0.6.42" [[deps.SciMLBase]] deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FillArrays", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces"] -git-tree-sha1 = "75bae786dc8b07ec3c2159d578886691823bcb42" +git-tree-sha1 = "fe886daed83db8f4881ff7b6ef10853055fa8b4b" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.23.1" +version = "2.23.2" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" + SciMLBaseMakieExt = "Makie" SciMLBasePartialFunctionsExt = "PartialFunctions" SciMLBasePyCallExt = "PyCall" SciMLBasePythonCallExt = "PythonCall" @@ -1480,6 +1481,7 @@ version = "2.23.1" [deps.SciMLBase.weakdeps] ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" diff --git a/previews/PR42/complete_sii/index.html b/previews/PR42/complete_sii/index.html index 86f7c45..ff00e3b 100644 --- a/previews/PR42/complete_sii/index.html +++ b/previews/PR42/complete_sii/index.html @@ -181,4 +181,4 @@ MySym(Symbol(sym.name, :_, join(idxs, "_"))) for idxs in Iterators.product(Base.OneTo.(sym.size)...) ] -end

hasname is not required to always be true for symbolic types. For example, Symbolics.Num returns false whenever the wrapped value is a number, or an expression.

+end

hasname is not required to always be true for symbolic types. For example, Symbolics.Num returns false whenever the wrapped value is a number, or an expression.

diff --git a/previews/PR42/index.html b/previews/PR42/index.html index a66e904..9b55477 100644 --- a/previews/PR42/index.html +++ b/previews/PR42/index.html @@ -56,7 +56,7 @@ [864edb3b] DataStructures v0.18.16 [e2d170a0] DataValueInterfaces v1.0.0 [8bb1440f] DelimitedFiles v1.9.1 - [2b5f629d] DiffEqBase v6.146.0 + [2b5f629d] DiffEqBase v6.146.1 [459566f4] DiffEqCallbacks v2.36.1 [163ba53b] DiffResults v1.1.0 [b552c78f] DiffRules v1.15.1 @@ -152,7 +152,7 @@ [e409e4f3] PoissonRandom v0.4.4 [f517fe37] Polyester v0.7.9 [1d0040c9] PolyesterWeave v0.2.1 - [d236fae5] PreallocationTools v0.4.17 + [d236fae5] PreallocationTools v0.4.18 [aea7be01] PrecompileTools v1.2.0 [21216c6a] Preferences v1.4.1 [1fd47b50] QuadGK v2.9.4 @@ -169,7 +169,7 @@ [7e49a35a] RuntimeGeneratedFunctions v0.5.12 [94e857df] SIMDTypes v0.1.0 [476501e8] SLEEFPirates v0.6.42 - [0bca4576] SciMLBase v2.23.1 + [0bca4576] SciMLBase v2.23.2 [c0aeaf25] SciMLOperators v0.3.7 [6c6a2e73] Scratch v1.2.1 [efcf1570] Setfield v1.1.1 @@ -342,4 +342,4 @@ [8e850b90] libblastrampoline_jll v5.8.0+1 [8e850ede] nghttp2_jll v1.52.0+1 [3f19e933] p7zip_jll v17.4.0+2 -Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`

You can also download the manifest file and the project file.

+Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`

You can also download the manifest file and the project file.

diff --git a/previews/PR42/simple_sii_sys/index.html b/previews/PR42/simple_sii_sys/index.html index 22509f0..8fe9b6d 100644 --- a/previews/PR42/simple_sii_sys/index.html +++ b/previews/PR42/simple_sii_sys/index.html @@ -107,4 +107,4 @@ 64593.73530179436 77241.71691097679 92180.81843146283 - 100000.0 + 100000.0 diff --git a/previews/PR42/solution_wrappers/index.html b/previews/PR42/solution_wrappers/index.html index 1680b21..4f3aaaa 100644 --- a/previews/PR42/solution_wrappers/index.html +++ b/previews/PR42/solution_wrappers/index.html @@ -8,4 +8,4 @@ # other properties... end -symbolic_container(sys::MySolutionWrapper) = sys.sol

MySolutionWrapper wraps an AbstractTimeseriesSolution which already implements the interface. Since symbolic_container will return the wrapped solution, all method calls such as is_parameter(sys::MySolutionWrapper, sym) will be forwarded to is_parameter(sys.sol, sym).

In cases where some methods need to function differently than those of the wrapped type, they can be selectively defined. For example, suppose MySolutionWrapper does not support observed quantities. The following method can be defined (in addition to the one above):

is_observed(sys::MySolutionWrapper, sym) = false
+symbolic_container(sys::MySolutionWrapper) = sys.sol

MySolutionWrapper wraps an AbstractTimeseriesSolution which already implements the interface. Since symbolic_container will return the wrapped solution, all method calls such as is_parameter(sys::MySolutionWrapper, sym) will be forwarded to is_parameter(sys.sol, sym).

In cases where some methods need to function differently than those of the wrapped type, they can be selectively defined. For example, suppose MySolutionWrapper does not support observed quantities. The following method can be defined (in addition to the one above):

is_observed(sys::MySolutionWrapper, sym) = false
diff --git a/previews/PR42/usage/55391e9e.svg b/previews/PR42/usage/2c13ec45.svg similarity index 98% rename from previews/PR42/usage/55391e9e.svg rename to previews/PR42/usage/2c13ec45.svg index d54adad..1256937 100644 --- a/previews/PR42/usage/55391e9e.svg +++ b/previews/PR42/usage/2c13ec45.svg @@ -1,46 +1,46 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/previews/PR42/usage/index.html b/previews/PR42/usage/index.html index 08b7aba..fbbeecc 100644 --- a/previews/PR42/usage/index.html +++ b/previews/PR42/usage/index.html @@ -142,7 +142,7 @@ -7.739577070649573 -5.727345621871555
sol(1.3, idxs=[:y, :z])
2-element Vector{Float64}:
  -1.6888746814711415
-  3.7011061302491606
plot(sol, idxs=x)
Example block output

If necessary, Symbols can be used to refer to variables. This is only valid for symbolic variables for which hasname returns true. The Symbol used must match the one returned by getname for the variable.

hasname(x)
true
getname(x)
:x
sol[(:x, :w)]
1495-element Vector{Tuple{Float64, Float64}}:
+  3.7011061302491606
plot(sol, idxs=x)
Example block output

If necessary, Symbols can be used to refer to variables. This is only valid for symbolic variables for which hasname returns true. The Symbol used must match the one returned by getname for the variable.

hasname(x)
true
getname(x)
:x
sol[(:x, :w)]
1495-element Vector{Tuple{Float64, Float64}}:
  (1.0, 1.0)
  (1.0002823510089436, 1.001695702996486)
  (1.0030752466310615, 1.0186439140427952)
@@ -213,4 +213,4 @@
 parameter_values(prob)
3-element Vector{Float64}:
  29.0
  11.0
-  2.5
Note

These getters and setters generate high-performance functions for the specific chosen symbols or collection of symbols. Caching the getter/setter function and reusing it on other problem/solution instances can be the key to achieving good performance. Note that this caching is allowed only when the symbolic system is unchanged (it's fine for the numerical values to have changed, but not the underlying equations).

+ 2.5
Note

These getters and setters generate high-performance functions for the specific chosen symbols or collection of symbols. Caching the getter/setter function and reusing it on other problem/solution instances can be the key to achieving good performance. Note that this caching is allowed only when the symbolic system is unchanged (it's fine for the numerical values to have changed, but not the underlying equations).