@@ -98,38 +98,17 @@ function timeseries_parameter_index(indp, sym)
9898 end
9999end
100100
101- """
102- struct ParameterObservedFunction
103- function ParameterObservedFunction(timeseries_idx, observed_fn::Function)
104- function ParameterObservedFunction(observed_fn::Function)
105-
106- A struct which stores the parameter observed function and optional timeseries index for
107- a particular symbol. The timeseries index is optional and may be omitted. Specifying the
108- timeseries index allows [`getp`](@ref) to return the appropriate timeseries for a
109- timeseries parameter.
110-
111- For time-dependent index providers (where `is_time_dependent(indp)`) `observed_fn` must
112- have the signature `(p, t) -> [values...]`. For non-time-dependent index providers
113- (where `!is_time_dependent(indp)`) `observed_fn` must have the signature
114- `(p) -> [values...]`. To support in-place `getp` methods, `observed_fn` must also have an
115- additional method which takes `buffer::AbstractArray` as its first argument. The required
116- values must be written to the buffer in the appropriate order.
117- """
118- struct ParameterObservedFunction{I, F <: Function }
119- timeseries_idx:: I
120- observed_fn:: F
121- end
122-
123101"""
124102 parameter_observed(indp, sym)
125103
126- Return the observed function of `sym` in `indp` as a [`ParameterObservedFunction`](@ref).
127- If `sym` only involves variables from a single parameter timeseries (optionally along
128- with non-timeseries parameters) the timeseries index of the parameter timeseries should
129- be provided in the [`ParameterObservedFunction`](@ref). In all other cases, just the
130- observed function should be returned as part of the `ParameterObservedFunction` object .
104+ Return the observed function of `sym` in `indp`. This functions similarly to
105+ [`observed`](@ref) except that `u` is not an argument of the returned function. For time-
106+ dependent systems, the returned function must have the signature `(p, t) -> [values...]`.
107+ For time-independent systems, the returned function must have the signature
108+ `(p) -> [values...]` .
131109
132- By default, this function returns `nothing`.
110+ By default, this function returns `nothing`, indicating that the index provider does not
111+ support generating parameter observed functions.
133112"""
134113function parameter_observed (indp, sym)
135114 if hasmethod (symbolic_container, Tuple{typeof (indp)})
@@ -139,6 +118,38 @@ function parameter_observed(indp, sym)
139118 end
140119end
141120
121+ """
122+ struct ContinuousTimeseries end
123+
124+ A singleton struct corresponding to the timeseries index of the continuous timeseries.
125+ """
126+ struct ContinuousTimeseries end
127+
128+ """
129+ get_all_timeseries_indexes(indp, sym)
130+
131+ Return a `Set` of all unique timeseries indexes of variables in symbolic variable
132+ `sym`. `sym` may be a symbolic variable or expression, an array of symbolics, an index,
133+ or an array of indices. Continuous variables correspond to the
134+ [`ContinuousTimeseries`](@ref) timeseries index. Non-timeseries parameters do not have a
135+ timeseries index. Timeseries parameters have the same timeseries index as that returned by
136+ [`timeseries_parameter_index`](@ref). Note that the independent variable corresponds to
137+ the `ContinuousTimeseries` timeseries index.
138+
139+ Any ambiguities should be resolved in favor of variables. For example, if `1` could refer
140+ to the variable at index `1` or parameter at index `1`, it should be interpreted as the
141+ variable.
142+
143+ By default, this function returns `Set([ContinuousTimeseries()])`.
144+ """
145+ function get_all_timeseries_indexes (indp, sym)
146+ if hasmethod (symbolic_container, Tuple{typeof (indp)})
147+ return get_all_timeseries_indexes (symbolic_container (indp), sym)
148+ else
149+ return Set ([ContinuousTimeseries ()])
150+ end
151+ end
152+
142153"""
143154 parameter_symbols(indp)
144155
0 commit comments