Skip to content

Fix fgraph_from_model with multivariate transformed variables #6924

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

Merged
merged 2 commits into from
Sep 23, 2023

Conversation

ferrine
Copy link
Member

@ferrine ferrine commented Sep 22, 2023

def test_do_transformed():
    """There was a bug when the shape check compared value vars
    with actual rv type which can have different shapes"""
    with pm.Model() as m:
        pm.ConstantData("data_std", 1)
        # value var has different number of dimensions
        pm.LKJCorr("c", 4, 1.0)
        # value var has different shape
        pm.Dirichlet("d", [1, 2])
    m2 = do(m, {"data_std": 2})
    assert m2["data_std"].eval() == 2

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

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Merging #6924 (b05c04b) into main (9227827) will increase coverage by 0.01%.
Report is 4 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6924      +/-   ##
==========================================
+ Coverage   92.16%   92.17%   +0.01%     
==========================================
  Files         100      100              
  Lines       16839    16839              
==========================================
+ Hits        15519    15522       +3     
+ Misses       1320     1317       -3     
Files Changed Coverage Δ
pymc/model/fgraph.py 96.90% <100.00%> (ø)

... and 1 file with indirect coverage changes

@ricardoV94 ricardoV94 changed the title fix do or condition with transformed variables Fix fgraph_from_model with multivariate transformed variables Sep 22, 2023
@ferrine ferrine merged commit bc4b51d into main Sep 23, 2023
@ferrine ferrine deleted the do-condition-shapes branch September 23, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants