Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
torfjelde and github-actions[bot] authored Oct 31, 2024
1 parent 9f392a7 commit 68295e8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/debug_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,11 @@ Check the type stability of the model's evaluator, warning about any potential i
This simply calls `@code_warntype` on the model's evaluator, filling in internal arguments where needed.
"""
function model_warntype(model::Model, varinfo::AbstractVarInfo=VarInfo(model), context::AbstractContext=DefaultContext())
function model_warntype(

Check warning on line 689 in src/debug_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/debug_utils.jl#L689

Added line #L689 was not covered by tests
model::Model,
varinfo::AbstractVarInfo=VarInfo(model),
context::AbstractContext=DefaultContext(),
)
args, kwargs = DynamicPPL.make_evaluate_args_and_kwargs(model, varinfo, context)
return if isempty(kwargs)
InteractiveUtils.@code_warntype model.f(args...)

Check warning on line 696 in src/debug_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/debug_utils.jl#L694-L696

Added lines #L694 - L696 were not covered by tests
Expand All @@ -702,7 +706,11 @@ Return the type inference for the model's evaluator.
This simply calls `@code_typed` on the model's evaluator, filling in internal arguments where needed.
"""
function model_typed(model::Model, varinfo::AbstractVarInfo=VarInfo(model), context::AbstractContext=DefaultContext())
function model_typed(

Check warning on line 709 in src/debug_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/debug_utils.jl#L709

Added line #L709 was not covered by tests
model::Model,
varinfo::AbstractVarInfo=VarInfo(model),
context::AbstractContext=DefaultContext(),
)
args, kwargs = DynamicPPL.make_evaluate_args_and_kwargs(model, varinfo, context)
return if isempty(kwargs)
InteractiveUtils.@code_typed model.f(args...)

Check warning on line 716 in src/debug_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/debug_utils.jl#L714-L716

Added lines #L714 - L716 were not covered by tests
Expand Down

0 comments on commit 68295e8

Please sign in to comment.