TuringLang / DynamicPPL.jl

Implementation of domain-specific language (DSL) for dynamic probabilistic programming
https://turinglang.org/DynamicPPL.jl/
MIT License
157 stars 26 forks source link

Remove the `prob` and `logprob` macros #604

Closed sunxd3 closed 4 months ago

sunxd3 commented 4 months ago

Fix https://github.com/TuringLang/DynamicPPL.jl/issues/356.

With DynamicPPL's logjoint, logprior and loglikelihood, the macro based query functions are not needed anymore.

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9099057865

Details


Files with Coverage Reduction New Missed Lines %
src/model.jl 2 88.24%
src/utils.jl 5 76.81%
src/varinfo.jl 5 86.1%
src/context_implementations.jl 10 58.63%
src/threadsafe.jl 16 48.25%
<!-- Total: 38 -->
Totals Coverage Status
Change from base Build 9062140401: -0.9%
Covered Lines: 2650
Relevant Lines: 3415

💛 - Coveralls
sunxd3 commented 4 months ago

Will do that and modify https://github.com/TuringLang/TuringTutorials/blob/master/tutorials/docs-12-using-turing-guide/using-turing-guide.jmd

sunxd3 commented 4 months ago

@devmotion @torfjelde @yebai any suggestions on how to properly deprecate a macro?

yebai commented 4 months ago

@sunxd3 I am not aware of a way to depreciate a macro properly. One simple heuristic is to print an informational message and guide the user to the new APIs regardless of the input arguments to the macro.

sunxd3 commented 4 months ago

Put back the macros, but now they return a warning command, not sure this is a good solution.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.95%. Comparing base (5b53be7) to head (41f5d47). Report is 1 commits behind head on master.

:exclamation: Current head 41f5d47 differs from pull request most recent head deafe64. Consider uploading reports for the commit deafe64 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #604 +/- ## ========================================== - Coverage 76.93% 75.95% -0.98% ========================================== Files 30 29 -1 Lines 3572 3435 -137 ========================================== - Hits 2748 2609 -139 - Misses 824 826 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sunxd3 commented 4 months ago

I lean more to just delete them. It is not a core functionality that external code will likely rely on, so smaller chance or breaking behavior and surprises.

yebai commented 4 months ago

I lean more to just delete them. It is not a core functionality that external code will likely rely on, so smaller chance or breaking behavior and surprises.

I'm happy to delete these and add a release message to guide the users to new APIs.

torfjelde commented 3 months ago

When merging changes like this: a) make sure to update Project.toml, and b) make the breaking release afterwards and subsequently update the downstream projects that require it. Otherwise the next person who comes along and wants to contribute a simple bugfix will have to carry the full burden of this, which isn't great.

I would also gently remind people that we should generally let reviewers with "requested changes" reviews to respond before merging PRs.