pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.67k stars 2k forks source link

Suggest `var_names` when using deprecated API for partial traces #7289

Closed lancechua closed 5 months ago

lancechua commented 5 months ago

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


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

welcome[bot] commented 5 months ago

Thank You Banner] :sparkling_heart: Thanks for opening this pull request! :sparkling_heart: 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 commented 5 months ago

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

ricardoV94 commented 5 months ago

Thanks @lancechua, this seems fine

welcome[bot] commented 5 months ago

Congratulations Banner] Congrats on merging your first pull request! :tada: We here at PyMC are proud of you! :sparkling_heart: Thank you so much for your contribution :gift: