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

Make rvs_to_values work with non-RandomVariables #6101

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Sep 5, 2022

What is this PR about?
Cleanup some logic that assumed only RandomVariables can be valued

Related to #6072
Related to aesara-devs/aeppl#174

Checklist

Major / Breaking Changes

  • ...

Bugfixes / New features

  • rvs_to_values now works with non-RandomVariables and unvalued RandomVariables

Docs / Maintenance

  • ...

@ricardoV94 ricardoV94 marked this pull request as ready for review September 5, 2022 14:31
@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #6101 (29500af) into main (761f77d) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6101      +/-   ##
==========================================
+ Coverage   92.08%   92.10%   +0.02%     
==========================================
  Files          86       86              
  Lines       17861    17848      -13     
==========================================
- Hits        16447    16439       -8     
+ Misses       1414     1409       -5     
Impacted Files Coverage Δ
pymc/aesaraf.py 93.45% <100.00%> (+0.54%) ⬆️
pymc/gp/util.py 96.55% <100.00%> (ø)
pymc/model.py 88.23% <100.00%> (ø)
pymc/step_methods/metropolis.py 83.40% <100.00%> (ø)
pymc/tests/distributions/test_logprob.py 100.00% <100.00%> (ø)
pymc/variational/opvi.py 87.04% <100.00%> (ø)
pymc/step_methods/hmc/base_hmc.py 89.76% <0.00%> (-0.79%) ⬇️
pymc/distributions/censored.py 100.00% <0.00%> (+7.50%) ⬆️

Copy link
Contributor

@lucianopaz lucianopaz left a comment

Choose a reason for hiding this comment

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

Looks ok @ricardoV94 . I’m entirely sure about how the model graphs are walked and the replacements are being set. But I think it’s just that I’m tired and I’ll have to review it a second time. Anyway, I wanted to ask you to change a type hint that I think is wrong and maybe also explain why you don’t raise an exception instead of returning Nones

pymc/aesaraf.py Outdated Show resolved Hide resolved
pymc/aesaraf.py Outdated Show resolved Hide resolved
No longer returns replacements dict from `rvs_to_values` as the keys will be the cloned `rvs` which are not useful to the caller.
@twiecki twiecki merged commit c6e5a92 into pymc-devs:main Sep 9, 2022
@ricardoV94 ricardoV94 deleted the rvs_to_values branch June 6, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants