JuliaStats / PDMats.jl

Uniform Interface for positive definite matrices of various structures
Other
104 stars 43 forks source link

Redundant dimension wastes space and allows disagreement #178

Closed chriselrod closed 11 months ago

chriselrod commented 11 months ago

Tests also fail on Julia 1.9 on the master branch. I fixed one of the failures, but the BandedMatrices failure is obviously unrelated so I figured someone else could handle it in a separate PR.

This PR should be non-breaking. I left the old constructors, and added getproperty and propertynames methods so that the old behaviors are preserved.

Thus, I think bumping the patch version to 0.11.18 should be fine, but I could make it 0.12.0 instead.

codecov-commenter commented 11 months ago

Codecov Report

Patch coverage is 86.36% of modified lines.

Files Changed Coverage
src/pdiagmat.jl 80.00%
src/pdsparsemat.jl 87.50%
src/pdmat.jl 88.88%

:loudspeaker: Thoughts on this report? Let us know!.

devmotion commented 11 months ago

Tests also fail on Julia 1.9 on the master branch.

Interesting, tests passed in #175 end of July, apart from a bug in ArrayLayouts that I fixed upstream. Seems I had also fixed the BandedMatrices tests in that PR.

Edit: Seems tests in that PR still pass on all Julia versions apart from the nightlies.

chriselrod commented 11 months ago

Good to merge?

devmotion commented 11 months ago

Looks good but I would like the test errors and inconsistencies on the master branch to be fixed first since tests on Julia 1.9 (and the nightlies) in this PR are aborted due to these problems. I opened #180.

devmotion commented 11 months ago

Looks good, and tests pass as well with the recent changes on the master branch 🙂 Speaking about tests, I guess the only thing we should check before merging the PR: Are there existing tests of the getproperty implementations and internal constructors? And do we use the deprecated constructors anywhere in our codebase (maybe in convert)?

chriselrod commented 11 months ago

Re pre-existing getproperty tests, only for .diag:

> rg "\.d"
pdmtypes.jl
52:        @test convert(PDiagMat{Float64}, PDiagMat(m)).diag == PDiagMat(convert(Array{Float64}, m)).diag
53:        @test convert(AbstractArray{Float64}, PDiagMat(m)).diag == PDiagMat(convert(Array{Float64}, m)).diag
84:        @test d.diag === v

While Base.size's implementation uses getproperty(a, :dim), so that branch should be taken here.

Re deprecated constructors: tests still pass if we delete them, so they aren't used anywhere that is tested.