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

Jishnub aqua #546

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Test using Aqua v0.8
  • Loading branch information
jishnub committed Dec 1, 2023
commit 92f74ae1a29f7dbb506e12ff33c9d7a5a1690a25
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PolynomialsMakieCoreExt = "MakieCore"
PolynomialsMutableArithmeticsExt = "MutableArithmetics"

[compat]
Aqua = "0.6, 0.7"
Aqua = "0.8"
ChainRulesCore = "1"
ChainRulesTestUtils = "1"
DualNumbers = "0.6"
Expand Down
10 changes: 7 additions & 3 deletions src/polynomial-container-types/immutable-dense-polynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ ImmutableDensePolynomial{B,T,X,N}(check::Type{Val{true}}, cs::NTuple{N,T}) where
ImmutableDensePolynomial{B,T,X,N}(cs)

# tuple with mismatched size
function ImmutableDensePolynomial{B,T,X,N}(xs::NTuple{M,S}) where {B,T,S,X,N,M}
function ImmutableDensePolynomial{B,T,X,N}(xs::Tuple{S,Vararg{S}}) where {B,T,S,X,N}
M = length(xs)
p = ImmutableDensePolynomial{B,S,X,M}(xs)
convert(ImmutableDensePolynomial{B,T,X,N}, ImmutableDensePolynomial{B,T,X,M}(xs))
end
Expand All @@ -46,10 +47,13 @@ function ImmutableDensePolynomial{B,T,X,N}(c::S) where {B,T,X,N,S<:Scalar}
cs = ntuple(i -> i == 1 ? T(c) : zero(T), Val(N))
return ImmutableDensePolynomial{B,T,X,N}(cs)
end
ImmutableDensePolynomial{B,T,X}(::Val{false}, xs::NTuple{N,S}) where {B,T,S,X,N} = ImmutableDensePolynomial{B,T,X,N}(convert(NTuple{N,T}, xs))
function ImmutableDensePolynomial{B,T,X}(::Val{false}, xs::Tuple{S,Vararg{S}}) where {B,T,S,X}
N = length(xs)
ImmutableDensePolynomial{B,T,X,N}(convert(NTuple{N,T}, xs))
end
ImmutableDensePolynomial{B,T,X}(xs::NTuple{N}) where {B,T,X,N} = ImmutableDensePolynomial{B,T,X,N}(convert(NTuple{N,T}, xs))
ImmutableDensePolynomial{B,T}(xs::NTuple{N}, var::SymbolLike=Var(:x)) where {B,T,N} = ImmutableDensePolynomial{B,T,Symbol(var),N}(xs)
ImmutableDensePolynomial{B}(xs::NTuple{N,T}, var::SymbolLike=Var(:x)) where {B,T,N} = ImmutableDensePolynomial{B,T,Symbol(var),N}(xs)
ImmutableDensePolynomial{B}(xs::Tuple{T,Vararg{T}}, var::SymbolLike=Var(:x)) where {B,T} = ImmutableDensePolynomial{B,T,Symbol(var),length(xs)}(xs)

# abstract vector. Must eat order
ImmutableDensePolynomial{B,T,X}(::Val{false}, xs::AbstractVector, order::Int=0) where {B,T,X} =
Expand Down
5 changes: 1 addition & 4 deletions test/aqua.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Aqua

Aqua.test_all(Polynomials;
unbound_args = false,
stale_deps = false
)
Aqua.test_all(Polynomials)
Loading