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

Suggest var_names when using deprecated API for partial traces #7289

Merged
merged 3 commits into from
May 5, 2024

Conversation

lancechua
Copy link
Contributor

@lancechua lancechua commented Apr 28, 2024

Description

Sampling a partial trace was first done in #271, with the trace kwarg.
Then, it subsequently removed in #6269 raising DeprecationWarning error.
Partial trace was added back with the var_names kwarg in #7206.

This PR updates the error message to reference the new var_names kwarg instead, as trace may still be suggested by coding LLMs.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7289.org.readthedocs.build/en/7289/

Copy link

welcome bot commented Apr 28, 2024

Thank You Banner]
💖 Thanks for opening this pull request! 💖 The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.

@lancechua
Copy link
Contributor Author

An alternative is var_names = trace if isinstance(trace, list) else var_names, but that would violate the one-way-to-do-it "rule"...

pymc/sampling/mcmc.py Outdated Show resolved Hide resolved
@ricardoV94
Copy link
Member

Thanks @lancechua, this seems fine

@ricardoV94 ricardoV94 changed the title Update error message sampling partial trace using trace keyword argument Suggest var_names when using deprecated API for partial traces Apr 28, 2024
Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
@lancechua lancechua marked this pull request as ready for review April 28, 2024 18:57
@michaelosthege michaelosthege added the trace-backend Traces and ArviZ stuff label May 5, 2024
Copy link
Member

@michaelosthege michaelosthege left a comment

Choose a reason for hiding this comment

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

Thanks @lancechua !

@michaelosthege michaelosthege merged commit 881030a into pymc-devs:main May 5, 2024
20 checks passed
Copy link

welcome bot commented May 5, 2024

Congratulations Banner]
Congrats on merging your first pull request! 🎉 We here at PyMC are proud of you! 💖 Thank you so much for your contribution 🎁

mkusnetsov added a commit to mkusnetsov/pymc that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance trace-backend Traces and ArviZ stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants