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

Add Aqua tests #775

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Add Aqua tests #775

wants to merge 8 commits into from

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Jan 8, 2025

There are quite a number of things to fix 😳

Method ambiguities

(fixed)

Ambiguity #1
DynamicPPL.SimpleVarInfo(values::NT, logp::T, transformation::C) where {NT, T, C<:AbstractTransformation} @ DynamicPPL ~/ppl/dppl/src/simple_varinfo.jl:192
DynamicPPL.SimpleVarInfo(model::DynamicPPL.Model, args...) @ DynamicPPL ~/ppl/dppl/src/simple_varinfo.jl:235

Possible fix, define
  DynamicPPL.SimpleVarInfo(::NT, ::T, ::C) where {NT<:DynamicPPL.Model, T, C<:DynamicPPL.AbstractTransformation}

(fixed)

Ambiguity #2
DynamicPPL.VarInfo(metadata::Tmeta, logp::Base.RefValue{Tlogp}, num_produce::Base.RefValue{Int64}) where {Tmeta, Tlogp} @ DynamicPPL ~/ppl/dppl/src/varinfo.jl:100
DynamicPPL.VarInfo(model::DynamicPPL.Model, args...) @ DynamicPPL ~/ppl/dppl/src/varinfo.jl:209

Possible fix, define
  DynamicPPL.VarInfo(::Tmeta, ::Base.RefValue{Tlogp}, ::Base.RefValue{Int64}) where {Tmeta<:DynamicPPL.Model, Tlogp}

(fixed)

Ambiguity #3
dot_tilde_assume(::DynamicPPL.IsParent, context::AbstractPPL.AbstractContext, args...) @ DynamicPPL ~/ppl/dppl/src/context_implementations.jl:298
dot_tilde_assume(::DynamicPPL.IsParent, rng, context::AbstractPPL.AbstractContext, args...) @ DynamicPPL ~/ppl/dppl/src/context_implementations.jl:301

Possible fix, define
  dot_tilde_assume(::DynamicPPL.IsParent, ::AbstractPPL.AbstractContext, ::AbstractPPL.AbstractContext, ::Vararg{Any})

Ambiguity #4
invlink!!(t::DynamicPPL.StaticTransformation{<:Bijectors.Transform}, vi::DynamicPPL.AbstractVarInfo, spl::AbstractMCMC.AbstractSampler, model::DynamicPPL.Model) @ DynamicPPL ~/ppl/dppl/src/abstract_varinfo.jl:615
invlink!!(t::DynamicPPL.AbstractTransformation, vi::DynamicPPL.ThreadSafeVarInfo, spl::AbstractMCMC.AbstractSampler, model::DynamicPPL.Model) @ DynamicPPL ~/ppl/dppl/src/threadsafe.jl:90

Possible fix, define
  invlink!!(::DynamicPPL.StaticTransformation{<:Bijectors.Transform}, ::DynamicPPL.ThreadSafeVarInfo, ::AbstractMCMC.AbstractSampler, ::DynamicPPL.Model)

Ambiguity #5
link!!(t::DynamicPPL.StaticTransformation{<:Bijectors.Transform}, vi::DynamicPPL.AbstractVarInfo, spl::AbstractMCMC.AbstractSampler, model::DynamicPPL.Model) @ DynamicPPL ~/ppl/dppl/src/abstract_varinfo.jl:600
link!!(t::DynamicPPL.AbstractTransformation, vi::DynamicPPL.ThreadSafeVarInfo, spl::AbstractMCMC.AbstractSampler, model::DynamicPPL.Model) @ DynamicPPL ~/ppl/dppl/src/threadsafe.jl:84

Possible fix, define
  link!!(::DynamicPPL.StaticTransformation{<:Bijectors.Transform}, ::DynamicPPL.ThreadSafeVarInfo, ::AbstractMCMC.AbstractSampler, ::DynamicPPL.Model)

(fixed)

Ambiguity #6
logpdf(d::Distributions.UnivariateDistribution, x::AbstractArray{<:Real, 0}) @ Distributions ~/.julia/packages/Distributions/j0ZcJ/src/univariates.jl:327
logpdf(dist::DynamicPPL.NamedDist, x::AbstractArray{<:Real}) @ DynamicPPL ~/ppl/dppl/src/distribution_wrappers.jl:20

Possible fix, define
  logpdf(::DynamicPPL.NamedDist{Distributions.Univariate, S, Td} where {S<:Distributions.ValueSupport, Td<:Distributions.UnivariateDistribution{S}}, ::AbstractArray{<:Real, 0})

Ambiguity #7
unwrap_right_left_vns(right::DynamicPPL.NamedDist, left, vns) @ DynamicPPL ~/ppl/dppl/src/compiler.jl:223
unwrap_right_left_vns(right::Distributions.MultivariateDistribution, left::AbstractMatrix, vn::AbstractPPL.VarName) @ DynamicPPL ~/ppl/dppl/src/compiler.jl:226

Possible fix, define
  unwrap_right_left_vns(::DynamicPPL.NamedDist{Distributions.Multivariate, support, Td} where {support<:Distributions.ValueSupport, Td<:Distributions.MultivariateDistribution{support}}, ::AbstractMatrix, ::AbstractPPL.VarName)

Ambiguity #8
unwrap_right_left_vns(right::DynamicPPL.NamedDist, left, vns) @ DynamicPPL ~/ppl/dppl/src/compiler.jl:223
unwrap_right_left_vns(right::Union{AbstractArray{<:Distributions.Distribution}, Distributions.Distribution}, left::AbstractArray, vn::AbstractPPL.VarName) @ DynamicPPL ~/ppl/dppl/src/compiler.jl:238

Possible fix, define
  unwrap_right_left_vns(::Union{DynamicPPL.NamedDist{F, S, Td} where {S<:Distributions.ValueSupport, Td<:Distributions.Distribution{F, S}}, DynamicPPL.NamedDist{F, support, Td} where {support<:Distributions.ValueSupport, Td<:Distributions.Distribution{F, support}}} where F<:Distributions.VariateForm, ::AbstractArray, ::AbstractPPL.VarName)

#776 should fix this

Ambiguity #9
|(x, ::Union{InitialValues.NonspecificInitialValue, InitialValues.SpecificInitialValue{typeof(|)}}) @ InitialValues ~/.julia/packages/InitialValues/OWP8V/src/InitialValues.jl:161
|(model::DynamicPPL.Model, values) @ DynamicPPL ~/ppl/dppl/src/model.jl:99

Possible fix, define
  |(::DynamicPPL.Model, ::Union{InitialValues.NonspecificInitialValue, InitialValues.SpecificInitialValue{typeof(|)}})

No compat bounds (fixed)

Base.PkgId(Base.UUID("366bfd00-2699-11ea-058f-f148b4cae6d8"), "DynamicPPL") does not declare a compat entry for the following deps:
1-element Vector{Base.PkgId}:
 InteractiveUtils [b77e0a4c-d291-57a0-90e8-8db25a27a240]

Type piracy (fixed)

Possible type-piracy detected:
[1] condition(context::AbstractContext, values::NTuple{var"#s77", Pair{<:VarName}} where var"#s77") @ DynamicPPL ~/ppl/dppl/src/contexts.jl:433
[2] condition(context::AbstractContext, value::Pair{<:VarName}, values::Pair{<:VarName}...) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:428
[3] condition(context::AbstractContext; values...) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:425
[4] condition(context::AbstractContext, values::Union{AbstractDict, NamedTuple}) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:420
[5] condition(context::AbstractContext, values::NamedTuple{()}) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:419
[6] condition(values::NTuple{var"#s77", var"#s76"} where {var"#s77", var"#s76"<:(Pair{<:VarName})}) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:416
[7] condition(value::Pair{<:VarName}, values::Pair{<:VarName}...) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:413
[8] condition(values::NamedTuple) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:412
[9] condition(; values...) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:411
[10] kwcall(::NamedTuple, ::typeof(condition)) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:411
[11] kwcall(::NamedTuple, ::typeof(condition), context::AbstractContext) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:425
[12] decondition(context, args...) @ DynamicPPL ~/ppl/dppl/src/contexts.jl:452
[13] getsym(::AbstractVector{<:VarName{sym}}) where sym @ DynamicPPL ~/ppl/dppl/src/varname.jl:46
Piracy: Test Failed at /Users/pyong/.julia/packages/Aqua/bBjXC/src/piracies.jl:240

@coveralls
Copy link

coveralls commented Jan 8, 2025

Pull Request Test Coverage Report for Build 12678919230

Details

  • 0 of 11 (0.0%) changed or added relevant lines in 4 files are covered.
  • 2849 unchanged lines in 26 files lost coverage.
  • Overall coverage decreased (-82.3%) to 3.951%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/distribution_wrappers.jl 0 2 0.0%
src/varinfo.jl 0 2 0.0%
src/simple_varinfo.jl 0 3 0.0%
src/context_implementations.jl 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
src/selector.jl 5 0.0%
src/varname.jl 6 0.0%
src/test_utils/model_interface.jl 7 0.0%
src/model_utils.jl 11 0.0%
src/test_utils/contexts.jl 12 0.0%
src/distribution_wrappers.jl 13 0.0%
src/test_utils/varinfo.jl 23 0.0%
src/logdensityfunction.jl 23 0.0%
src/submodel_macro.jl 26 0.0%
src/extract_priors.jl 30 0.0%
Totals Coverage Status
Change from base Build 12657521724: -82.3%
Covered Lines: 166
Relevant Lines: 4201

💛 - Coveralls

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 3.86%. Comparing base (e673b69) to head (92b45d8).

Files with missing lines Patch % Lines
src/context_implementations.jl 0.00% 4 Missing ⚠️
src/simple_varinfo.jl 0.00% 3 Missing ⚠️
src/distribution_wrappers.jl 0.00% 2 Missing ⚠️
src/varinfo.jl 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (e673b69) and HEAD (92b45d8). Click for more details.

HEAD has 21 uploads less than BASE
Flag BASE (e673b69) HEAD (92b45d8)
28 7
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #775       +/-   ##
==========================================
- Coverage   86.26%   3.86%   -82.40%     
==========================================
  Files          36      36               
  Lines        4332    4293       -39     
==========================================
- Hits         3737     166     -3571     
- Misses        595    4127     +3532     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

2 participants