Skip to content

Commit ab88a19

Browse files
baggepinnenclaude
andcommitted
Qualify parameters in the LowLevelParticleFilters methods for AbstractIdData
`parameters` is not exported by LowLevelParticleFilters, so `forward_trajectory(kf, d::AbstractIdData)` and `smooth(kf, d)` raised `UndefVarError: parameters` when called without the parameter argument. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent bfc0f7c commit ab88a19

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎src/subspace.jl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,23 +247,23 @@ end
247247

248248
m2vv(x) = collect.(eachcol(x))
249249

250-
function LowLevelParticleFilters.forward_trajectory(kf::LowLevelParticleFilters.AbstractFilter, d::AbstractIdData, p=parameters(kf))
250+
function LowLevelParticleFilters.forward_trajectory(kf::LowLevelParticleFilters.AbstractFilter, d::AbstractIdData, p=LowLevelParticleFilters.parameters(kf))
251251
y = time2(output(d))
252252
u = input(d)
253253
U = m2vv(u)
254254
Y = m2vv(y)
255255
forward_trajectory(kf, U, Y, p)
256256
end
257257

258-
function LowLevelParticleFilters.smooth(kf::LowLevelParticleFilters.AbstractFilter, d::AbstractIdData, p=parameters(kf))
258+
function LowLevelParticleFilters.smooth(kf::LowLevelParticleFilters.AbstractFilter, d::AbstractIdData, p=LowLevelParticleFilters.parameters(kf))
259259
y = time2(output(d))
260260
u = input(d)
261261
U = m2vv(u)
262262
Y = m2vv(y)
263263
LowLevelParticleFilters.smooth(kf, U, Y, p)
264264
end
265265

266-
function LowLevelParticleFilters.smooth(kf::LowLevelParticleFilters.AbstractFilter, M::Int, d::AbstractIdData, p=parameters(kf))
266+
function LowLevelParticleFilters.smooth(kf::LowLevelParticleFilters.AbstractFilter, M::Int, d::AbstractIdData, p=LowLevelParticleFilters.parameters(kf))
267267
y = time2(output(d))
268268
u = input(d)
269269
U = m2vv(u)

‎test/test_subspace.jl‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ end
166166
@test kf.B == res.B
167167
@test kf.C == res.C
168168

169+
sol = ControlSystemIdentification.LowLevelParticleFilters.forward_trajectory(kf, d)
170+
@test length(sol.x) == length(d)
171+
if pkgversion(ControlSystemIdentification.LowLevelParticleFilters) >= v"3.33.1" # Earlier versions dispatch smooth(::KalmanFilter, ::AbstractIdData) to their own method
172+
ssol = ControlSystemIdentification.LowLevelParticleFilters.smooth(kf, d)
173+
@test length(ssol.xT) == length(d)
174+
end
175+
169176
end
170177

171178
# Test u scaling

0 commit comments

Comments
 (0)