Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type piracies #278

Closed
nathanaelbosch opened this issue Nov 22, 2023 · 4 comments · Fixed by #316
Closed

Fix type piracies #278

nathanaelbosch opened this issue Nov 22, 2023 · 4 comments · Fixed by #316
Labels
enhancement New feature or request

Comments

@nathanaelbosch
Copy link
Owner

Current output:

julia> Aqua.test_piracies(ProbNumDiffEq)
Possible type-piracy detected:
[1] *(M::AbstractMatrix, g::Gaussian{VM, PSDMatrix{T, S}} where {T, S, VM<:AbstractVecOrMat{T}}) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:25
[2] X_A_Xt(A, X) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/ProbNumDiffEq.jl:37
[3] copy(K::Kronecker.KroneckerProduct) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/kronecker.jl:1
[4] copy(P::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:4
[5] copy!(dst::Gaussian, src::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:6
[6] isapprox(M1::PSDMatrix, M2::PSDMatrix; kwargs...) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/filtering/markov_kernel.jl:48
[7] kwcall(::Any, ::typeof(isapprox), M1::PSDMatrix, M2::PSDMatrix) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/filtering/markov_kernel.jl:48
[8] mean(s::StructArray{Gaussian{VM, PSDMatrix{T, S}} where VM<:AbstractVecOrMat{T}} where {T, S}) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:35
[9] ndims(g::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:17
[10] recursivecopy(P::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:11
[11] recursivecopy!(dst::Gaussian, src::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:12
[12] show(io::IO, g::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:13
[13] similar(P::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:5
[14] size(g::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:16
[15] std(g::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:19
[16] var(g::Gaussian) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/gaussians.jl:18
@nathanaelbosch
Copy link
Owner Author

PSDMatrices.jl now has isapprox: nathanaelbosch/PSDMatrices.jl#31

@nathanaelbosch
Copy link
Owner Author

To get rid of more, we could move from GaussianDistributions.jl, which seems quite unmaintained, to the much bigger Distributions.jl. The main issue here is that MvNormal requires a covariance of type AbstractPDMat, so this would basically require PSDMatrices.jl to move towards being a subtype of AbstractPDMat. This could work!

Alternatively, we could also make our own small little Gaussian distribution package, like GaussianDistributions.jl but focusing only on the multivariate case, mostly considering PSDMatrices as covariances, witht speed in mind, and most importantly, maintained.

@nathanaelbosch nathanaelbosch added the enhancement New feature or request label Nov 22, 2023
@nathanaelbosch
Copy link
Owner Author

Turns out Distributions.jl does not have copy!, similar, etc. So SimpleGaussians.jl it is?

@nathanaelbosch
Copy link
Owner Author

Current output:

julia> Aqua.test_piracies(ProbNumDiffEq)
Possible type-piracy detected:
[1] X_A_Xt(A, X) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/ProbNumDiffEq.jl:42
[2] copy(K::Kronecker.KroneckerProduct) @ ProbNumDiffEq ~/.julia/dev/ProbNumDiffEq/src/kronecker.jl:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant