-
Notifications
You must be signed in to change notification settings - Fork 35
Add show_context_stack(::AbstractContext)
#909
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #909 +/- ##
==========================================
- Coverage 82.92% 82.81% -0.11%
==========================================
Files 36 36
Lines 3964 3969 +5
==========================================
Hits 3287 3287
- Misses 677 682 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull Request Test Coverage Report for Build 14815463313Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 14815463313Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the docstring has an example, could that be a doctest?
I wonder if this should be a show(::AbstractContext, ::MIME"text/plain")
method. Maybe it omits too much, and the ->
thing is too non-standard?
Happy to release this with a patch bump or wait for the next release.
I think making this the default show method is a bit too dangerous, it's sometimes useful to see e.g. the sampler in SamplingContext or the values in Condition/FixedContext. |
show_stack(::AbstractContext)
show_context_stack(::AbstractContext)
Benchmark Report for Commit 00a4b6bComputer Information
Benchmark Results
|
I kind of thought about it a bit more, and I'm not sure if this belongs in DPPL proper. I feel like it's a useful function to define for docs, and it was useful for debugging, but it just feels a bit too much like a personal-utility thing to put in here. :/ Feel free to reopen and review again if you disagree, @mhauru as it's in a mergeable state (I added doctests) |
The docstring says it all. Basically this is a method I've been wanting for ages and I finally decided to implement it after realising that
GibbsContext
contains a complete VarInfo inside it and it's impossible to parse the output of@show context
. Obviously I could just run this myself every time I needed it, but I thought it might be useful enough to be added to DynamicPPL itself, hence the PR.Not even sure if this warrants a patch bump + release, opinions are welcome.