-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add check for variables in step samplers #6524
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
Add check for variables in step samplers #6524
Conversation
contains feature requested in Issue #6511 |
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.
Looks good. I suggest a more informative error message. And we need a test, you can simplify the original issue on discourse and use that as test case.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6524 +/- ##
=======================================
Coverage 91.96% 91.96%
=======================================
Files 89 89
Lines 14932 14935 +3
=======================================
+ Hits 13732 13735 +3
Misses 1200 1200
|
@ricardoV94, I've noticed that most of the time the 'docs/readthedocs.org:pymc' test is failing, and the steps executed in it usually have very little to do with the PR's themselves. Have you considered splitting it into smaller steps or maybe increasing the time limit? |
I don't think we have control over the time limit, it all happens on the ReadTheDocs side |
This PR needs a new test to show the check is working as expected |
Is there something else that I should do here? If not then I could close the corresponding issue |
Yes, you need to add a test that shows the new check is working as expected. That's always a requirement of pull requests, as it will help not changing the behavior inadvertently in the future. |
@ricardoV94 So I have an idea to create the test in this way you can see in the commit, I'm not feeling very good with pytensor operations yet, so in case I'm misunderstanding anything please let me know. I'm not sure if the way I'd like to introduce a variable that's not in the model is correct, the test passes when I execute it locally. Feel free to suggest any changes! |
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.
Looks good, some small tweak suggestions
3a3280b
to
5983eca
Compare
5983eca
to
0849de9
Compare
@michaelraczycki I rebase on latest main (the tests moved). It looks like you committed with your I edited the commit authors to the autogenerated GitHub user email.. Best update your |
What is this PR about?
Added safety check to prevent incorrect step assignment with custom step functions.
Nów assign_step_method from mcmc.py before assigning variables from step to
assigned_var, checks if they can be found in model.value_vars.
Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance