Repository navigation
Return a Diagonal from rand of a diagonal uncertainty matrix - #163
Merged
Merged
Conversation
Broadcasting rand over a Diagonal returns a dense Matrix on Julia 1.10 and a Diagonal on Julia 1.13, so the result type of rand(D, N) depended on the Julia version and test_uncertainty.jl failed on 1.13. A dedicated method now returns a Diagonal on all versions. Julia 1 is added to the CI matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #163 +/- ##
==========================================
+ Coverage 91.81% 92.17% +0.35%
==========================================
Files 20 20
Lines 3128 3130 +2
==========================================
+ Hits 2872 2885 +13
+ Misses 256 245 -11
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.
rand(D, N)for a diagonal uncertainty matrixD = Δ(n, δc)broadcastsrandover theDiagonal. On Julia 1.10 the broadcast returns a denseMatrix, on Julia 1.13 it preserves theDiagonalstructure. The values are identical, but the testtest_uncertainty.jl:42, which assertsrand(D, 100) isa Matrix{Complex{Particles{Float64, 100}}}, fails on Julia 1.13.Changes:
Base.rand(D::Diagonal{<:δ}, N), which returns aDiagonalon all Julia versions.Diagonalresult with zero off-diagonal entries.Verified locally on Julia 1.10.12 and 1.13.2 for complex (
δc) and real (δr) uncertainties. The full test suite on Julia 1.13 failed only at this test before the change (apart from the LinearMPC example, see below).CI resolves MatrixEquations v2 while LinearMPC (a test dependency) restricts it to v2 (see darnstrom/LinearMPC.jl#153).
Host: demeter2, session: MatrixEquations v3 compat PRs (session_01JGy8YZaumSKXZ3ucgmVARB), working directory: /home/baggepinnen/.julia/dev
🤖 Generated with Claude Code