You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -9,8 +10,8 @@ Plans can be nested and form a tree. A parent plan can be accessed with `parent`
9
10
10
11
Plans feature serialization with `toTOML`, `toPlan` and `loadPlan` and the ability to attach callbacks to property changes with `Òbservables` and `on`.
RecoPlan(::Type{T}; kwargs...) where {T<:AbstractImageReconstructionParameters}
@@ -60,17 +61,17 @@ Return the `Observable` for the `name` property of `plan`. Equivalent to `plan[n
60
61
Base.getindex(plan::RecoPlan{T}, name::Symbol) where {T} =getfield(plan, :values)[name]
61
62
62
63
export types, type
63
-
types(::RecoPlan{T}) where {T<:AbstractImageReconstructionParameters} =fieldtypes(T)
64
-
type(::RecoPlan{T}, name::Symbol) where {T<:AbstractImageReconstructionParameters} =fieldtype(T, name)
64
+
types(::AbstractRecoPlan{T}) where {T<:AbstractImageReconstructionParameters} =fieldtypes(T)
65
+
type(::AbstractRecoPlan{T}, name::Symbol) where {T<:AbstractImageReconstructionParameters} =fieldtype(T, name)
65
66
66
-
functiontype(plan::RecoPlan{T}, name::Symbol) where {T<:AbstractImageReconstructionAlgorithm}
67
+
functiontype(plan::AbstractRecoPlan{T}, name::Symbol) where {T<:AbstractImageReconstructionAlgorithm}
67
68
if name ==:parameter
68
69
return RecoPlan
69
70
else
70
71
error("type $(typeof(plan)) has no field $name")
71
72
end
72
73
end
73
-
types(::RecoPlan{T}) where {T<:AbstractImageReconstructionAlgorithm} = [type(plan, name) for name inpropertynames(plan)]
74
+
types(::AbstractRecoPlan{T}) where {T<:AbstractImageReconstructionAlgorithm} = [type(plan, name) for name inpropertynames(plan)]
74
75
75
76
"""
76
77
setproperty!(plan::RecoPlan{T}, name::Symbol, x::X) where {T, X}
@@ -97,9 +98,9 @@ function Base.setproperty!(plan::RecoPlan{T}, name::Symbol, x::X) where {T, X}
97
98
end
98
99
validvalue(plan, t, value::Missing) =true
99
100
validvalue(plan, ::Type{T}, value::X) where {T, X <:T} =true
100
-
validvalue(plan, ::Type{T}, value::RecoPlan{<:T}) where T =true
101
+
validvalue(plan, ::Type{T}, value::AbstractRecoPlan{<:T}) where T =true
101
102
# RecoPlans are stripped of parameters
102
-
validvalue(plan, t::UnionAll, ::RecoPlan{T}) where T = T <:t|| T <:Base.typename(t).wrapper # Last case doesnt work for Union{...} that is a UnionAll, such as ProcessCache Unio
103
+
validvalue(plan, t::UnionAll, ::AbstractRecoPlan{T}) where T = T <:t|| T <:Base.typename(t).wrapper # Last case doesnt work for Union{...} that is a UnionAll, such as ProcessCache Unio
Return a vector of property names of `plan` in its parent, s.t. `getproperty(parent(plan), last(parentproperties(plan))) === plan`. Return an empty vector if `plan` has no parent.
188
189
"""
189
-
functionparentproperties(plan::RecoPlan)
190
+
functionparentproperties(plan::AbstractRecoPlan)
190
191
trace = Symbol[]
191
192
returnparentproperties!(trace, plan)
192
193
end
@@ -195,7 +196,7 @@ end
195
196
196
197
Return the property name of `plan` in its parent, s.t. `getproperty(parent(plan), parentproperty(plan)) === plan`. Return `nothing` if `plan` has no parent.
197
198
"""
198
-
functionparentproperty(plan::RecoPlan)
199
+
functionparentproperty(plan::AbstractRecoPlan)
199
200
p =parent(plan)
200
201
if!isnothing(p)
201
202
for property inpropertynames(p)
@@ -206,7 +207,7 @@ function parentproperty(plan::RecoPlan)
0 commit comments