Qualify parameters in the LowLevelParticleFilters methods, add timeevol to FRD - #201
Merged
Merged
Conversation
…actIdData `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>
…resp(::FRD)
ControlSystemsBase 1.22 calls `freqresp(sys, w; balance)` from `nyquist`. Since `freqresp(::FRD, w)` accepted no keyword arguments, the call was dispatched to the generic `freqresp(::LTISystem, w; balance)`, which failed in `timeevol(::FRD)` and, after that, in `numeric_type(::FRD)`. `FRD` now has the property `timeevol = Continuous()`, consistent with its supertype `LTISystem{Continuous}`, and `freqresp(::FRD, w; kwargs...)` ignores the keyword arguments.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For the Kautz basis with poles up to 1e3 rad/s, the absolute difference between the two frequency-response computations exceeded 1e-10 for about 70% of the random coefficient vectors with ControlSystemsBase 1.22, while the relative difference was at most 2e-13. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ion to 2.12.1 The largest difference observed for the Kautz basis over 300 random coefficient vectors was 6.7e-10. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #201 +/- ##
==========================================
+ Coverage 89.49% 89.50% +0.01%
==========================================
Files 15 15
Lines 2722 2726 +4
==========================================
+ Hits 2436 2440 +4
Misses 286 286
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
forward_trajectory(kf, d::AbstractIdData),smooth(kf, d)andsmooth(kf, M, d)usedparameters(kf)as the default value ofp. LowLevelParticleFilters does not exportparameters, so calls withoutpraisedUndefVarError: parameters not defined in ControlSystemIdentification. The default is nowLowLevelParticleFilters.parameters(kf).smooth(kf::KalmanFilter, d)additionally required a change in LowLevelParticleFilters: its methodsmooth(kf::KalmanFilter, args...)was more specific thansmooth(kf::AbstractFilter, d::AbstractIdData)and failed forAbstractIdData. LowLevelParticleFilters.jl#290 restricts that method to vector data (version 3.33.1). The newsmoothtest is therefore only run with LowLevelParticleFilters ≥ 3.33.1; theforward_trajectorytest runs unconditionally. The compat bound is unchanged.FRD and ControlSystemsBase 1.22
CI on this PR exposed an unrelated failure with ControlSystemsBase 1.22:
nyquist(frd::FRD)callsfreqresp(sys, w; balance).freqresp(::FRD, w)accepted no keyword arguments, so the call was dispatched to the genericfreqresp(::LTISystem, w; balance), which failed withFieldError: type FRD has no field timeevol, and, once that was resolved, with aMethodErrorfornumeric_type(::FRD).FRDnow has the propertytimeevol, which returnsContinuous(), consistent with its supertypeLTISystem{Continuous}.iscontinuous(frd)therefore works.propertynamesliststimeevol,nuandnyas well.freqresp(::FRD, w; kwargs...)accepts and ignores keyword arguments such asbalance.Other changes
test_basis_functions.jlis increased from 1e-10 to 2e-9. With ControlSystemsBase 1.22, the difference for the Kautz basis exceeded 1e-10 for about 70% of the random coefficient vectors (largest observed value 6.7e-10 over 300 draws; relative difference at most 2e-13).Found during LowLevelParticleFilters.jl#288.
Tests
test_subspace.jlchecksforward_trajectory(kf, d)andsmooth(kf, d)for a filter obtained fromsubspaceid.test_frd.jlchecksiscontinuous(frd)andfreqresp(frd, w; balance = false); it passes locally with ControlSystemsBase 1.22.0 (56 passed).test_subspace.jlpasses locally on Julia 1.13 against the branch of LowLevelParticleFilters.jl#290 (2690 passed). The rest of the test suite was not run locally.Host:
demeter2, Claude Code sessiona4b42284-297c-4d79-b33c-7149cef31ba8🤖 Generated with Claude Code