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

Remove the prob and logprob macros #604

Merged
merged 8 commits into from
May 15, 2024
Merged

Remove the prob and logprob macros #604

merged 8 commits into from
May 15, 2024

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented May 10, 2024

Fix #356.

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

@coveralls
Copy link

coveralls commented May 10, 2024

Pull Request Test Coverage Report for Build 9099057865

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 38 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.9%) to 77.599%

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%
Totals Coverage Status
Change from base Build 9062140401: -0.9%
Covered Lines: 2650
Relevant Lines: 3415

💛 - Coveralls

Copy link
Member

@yebai yebai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a depreciation message to these macros and inform users to look at alternative APIs?

@sunxd3
Copy link
Member Author

sunxd3 commented May 10, 2024

@sunxd3
Copy link
Member Author

sunxd3 commented May 10, 2024

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

@yebai
Copy link
Member

yebai commented May 13, 2024

@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.

src/prob_macro.jl Outdated Show resolved Hide resolved
src/prob_macro.jl Outdated Show resolved Hide resolved
sunxd3 and others added 2 commits May 13, 2024 17:16
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sunxd3
Copy link
Member Author

sunxd3 commented May 13, 2024

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

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

❗ 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
@@            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     

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

@@ -1,244 +1,11 @@
macro logprob_str(str)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; maybe rename this file to depreciated.jl?

Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO if we can't deprecate properly, then either a) remove completely, or b) raise an error rather than @warn and do nothing (this will just warn and immediately throw an error somewhere unrelated in the code since now prob"..." doesn't do what it used to do).

@sunxd3
Copy link
Member Author

sunxd3 commented May 14, 2024

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
Copy link
Member

yebai commented May 15, 2024

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.

src/DynamicPPL.jl Outdated Show resolved Hide resolved
src/DynamicPPL.jl Outdated Show resolved Hide resolved
@yebai yebai enabled auto-merge May 15, 2024 16:08
@yebai yebai added this pull request to the merge queue May 15, 2024
Merged via the queue into master with commit 0c76bf2 May 15, 2024
11 of 12 checks passed
@yebai yebai deleted the sunxd/remove_prob_macro branch May 15, 2024 17:00
@torfjelde
Copy link
Member

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.

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.

Replace prob macro with SimpleVarInfo
4 participants