jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
567 stars 121 forks source link

Add Aqua.jl to the tests #642

Closed ericphanson closed 5 months ago

ericphanson commented 5 months ago

closes #639

This revealed 6 ambiguities:

julia> Aqua.test_ambiguities(Convex)
6 ambiguities found. To get a list, set `broken = false`.
Ambiguity #1
Convex.Problem{T}(head::Symbol, objective::Union{Nothing, Convex.AbstractExpr}) where T<:Real @ Convex ~/Convex.jl/src/problems.jl:12
Convex.Problem{T}(head::Symbol, objective::Convex.AbstractExpr, constraints::Convex.Constraint...) where T<:Real @ Convex ~/Convex.jl/src/problems.jl:186

Possible fix, define
  Convex.Problem{T}(::Symbol, ::Convex.AbstractExpr) where T<:Real

Ambiguity #2
getindex(x::Convex.AbstractExpr, I::AbstractVector{Bool}) @ Convex ~/Convex.jl/src/atoms/IndexAtom.jl:116
getindex(x::Convex.VcatAtom, inds::AbstractVector{<:Real}) @ Convex ~/Convex.jl/src/atoms/VcatAtom.jl:103

Possible fix, define
  getindex(::Convex.VcatAtom, ::AbstractVector{Bool})

Ambiguity #3
is_feasible(x::Number, set::MathOptInterface.AbstractVectorSet, tol) @ Convex ~/Convex.jl/src/constraints/GenericConstraint.jl:47
is_feasible(x, ::MathOptInterface.PositiveSemidefiniteConeSquare, tol) @ Convex ~/Convex.jl/src/constraints/GenericConstraint.jl:244

Possible fix, define
  is_feasible(::Number, ::MathOptInterface.PositiveSemidefiniteConeSquare, ::Any)

Ambiguity #4
populate_dual!(model::MathOptInterface.ModelLike, c::Convex.GenericConstraint, indices) @ Convex ~/Convex.jl/src/constraints/GenericConstraint.jl:99
populate_dual!(::MathOptInterface.ModelLike, c::Convex.Constraint, ::Nothing) @ Convex ~/Convex.jl/src/solution.jl:142

Possible fix, define
  populate_dual!(::MathOptInterface.ModelLike, ::Convex.GenericConstraint, ::Nothing)

Ambiguity #5
quadform(x::Convex.Constant, A::Convex.AbstractExpr; assume_psd) @ Convex ~/Convex.jl/src/reformulations/quadform.jl:88
quadform(x::Convex.AbstractExpr, A::Convex.Constant; assume_psd) @ Convex ~/Convex.jl/src/reformulations/quadform.jl:92

Possible fix, define
  quadform(::Convex.Constant, ::Convex.Constant)

Ambiguity #6
kwcall(::NamedTuple, ::typeof(Convex.quadform), x::Convex.Constant, A::Convex.AbstractExpr) @ Convex ~/Convex.jl/src/reformulations/quadform.jl:88
kwcall(::NamedTuple, ::typeof(Convex.quadform), x::Convex.AbstractExpr, A::Convex.Constant) @ Convex ~/Convex.jl/src/reformulations/quadform.jl:92

Possible fix, define
  kwcall(::NamedTuple, ::typeof(Convex.quadform), ::Convex.Constant, ::Convex.Constant)

Here I just add broken=true, but ideally we could pare down the list.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.86%. Comparing base (84a30f2) to head (8dbce8c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #642 +/- ## ======================================= Coverage 97.86% 97.86% ======================================= Files 88 88 Lines 5116 5116 ======================================= Hits 5007 5007 Misses 109 109 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.