Skip to content

Commit 076aee5

Browse files
committed
expanded docstring for model_warntype and model_codetyped and
added to docs
1 parent b60aaec commit 076aee5

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

docs/src/api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ And some which might be useful to determine certain properties of the model base
212212
DynamicPPL.has_static_constraints
213213
```
214214

215+
For determining whether one might have type instabilities in the model, the following can be useful
216+
217+
```@docs
218+
DynamicPPL.DebugUtils.model_warntype
219+
DynamicPPL.DebugUtils.model_codetyped
220+
```
221+
215222
## Advanced
216223

217224
### Variable names

src/debug_utils.jl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,14 @@ end
685685
Check the type stability of the model's evaluator, warning about any potential issues.
686686
687687
This simply calls `@code_warntype` on the model's evaluator, filling in internal arguments where needed.
688+
689+
# Arguments
690+
- `model::Model`: The model to check.
691+
- `varinfo::AbstractVarInfo`: The varinfo to use when evaluating the model. Default: `VarInfo(model)`.
692+
- `context::AbstractContext`: The context to use when evaluating the model. Default: [`DefaultContext`](@ref).
693+
694+
# Keyword Arguments
695+
- `optimize::Bool`: Whether to generate optimized code. Default: `false`.
688696
"""
689697
function model_warntype(
690698
model::Model,
@@ -701,13 +709,21 @@ function model_warntype(
701709
end
702710

703711
"""
704-
model_typed(model[, varinfo, context]; optimize=true)
712+
model_codetyped(model[, varinfo, context]; optimize=true)
705713
706714
Return the type inference for the model's evaluator.
707715
708716
This simply calls `@code_typed` on the model's evaluator, filling in internal arguments where needed.
717+
718+
# Arguments
719+
- `model::Model`: The model to check.
720+
- `varinfo::AbstractVarInfo`: The varinfo to use when evaluating the model. Default: `VarInfo(model)`.
721+
- `context::AbstractContext`: The context to use when evaluating the model. Default: [`DefaultContext`](@ref).
722+
723+
# Keyword Arguments
724+
- `optimize::Bool`: Whether to generate optimized code. Default: `true`.
709725
"""
710-
function model_typed(
726+
function model_codetyped(
711727
model::Model,
712728
varinfo::AbstractVarInfo=VarInfo(model),
713729
context::AbstractContext=DefaultContext();

0 commit comments

Comments
 (0)