Skip to content

Commit 602d043

Browse files
committed
params
1 parent a7bdad7 commit 602d043

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/parameterized.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ end
3838

3939
export params
4040

41-
params(μ::ParameterizedMeasure) = getfield(μ, :par)
41+
params(::Type{PM}) where {N, PM<:ParameterizedMeasure{N}} = N
4242

43-
function params(::Type{M}, constraints::NamedTuple{N2}=NamedTuple()) where {N1, N2, M<: ParameterizedMeasure{N1}}
44-
thekeys = tuple((k for k in N1 if k N2)...)
43+
function params(::Type{M}, constraints::NamedTuple{N2}) where {N1, N2, M<: ParameterizedMeasure{N1}}
44+
tuple((k for k in N1 if k N2)...)
4545
end
4646

47+
params(::Type{A}, nt::NamedTuple{C}) where {A<:Affine{N,M}} where {N,M,C} = tuple(setdiff(union(N, params(M)),C)...)
48+
4749
params(μ) = ()
4850

4951

0 commit comments

Comments
 (0)