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

Fix bug that does not correctly set the dtype of determinsitic variab… #6425

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

jessegrabowski
Copy link
Member

@jessegrabowski jessegrabowski commented Jan 2, 2023

What is this PR about?

Closes #6424 by setting the dtype of combined observed/interpolated deterministic generated by model.make_obs_var to be the same as the underling RV being interpolated.

Checklist

Major / Breaking Changes

  • None

New features

  • None

Bugfixes

  • Allow indexing by discrete RVs with missing data

Documentation

  • ...

Maintenance

  • ...

@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Merging #6425 (a37ec86) into main (c3b8ff4) will increase coverage by 16.52%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #6425       +/-   ##
===========================================
+ Coverage   78.24%   94.77%   +16.52%     
===========================================
  Files         148      148               
  Lines       27731    27731               
===========================================
+ Hits        21698    26281     +4583     
+ Misses       6033     1450     -4583     
Impacted Files Coverage Δ
pymc/model.py 89.83% <100.00%> (ø)
pymc/distributions/shape_utils.py 97.88% <0.00%> (+0.42%) ⬆️
pymc/math.py 70.04% <0.00%> (+0.48%) ⬆️
pymc/tests/distributions/util.py 90.86% <0.00%> (+2.96%) ⬆️
pymc/logprob/cumsum.py 100.00% <0.00%> (+3.12%) ⬆️
pymc/tests/logprob/utils.py 50.00% <0.00%> (+3.65%) ⬆️
pymc/logprob/rewriting.py 97.05% <0.00%> (+5.88%) ⬆️
pymc/logprob/abstract.py 97.56% <0.00%> (+6.09%) ⬆️
pymc/distributions/dist_math.py 87.42% <0.00%> (+6.85%) ⬆️
pymc/distributions/transforms.py 99.36% <0.00%> (+13.29%) ⬆️
... and 24 more

pymc/model.py Outdated Show resolved Hide resolved
@ricardoV94 ricardoV94 added the bug label Jan 2, 2023
@michaelosthege
Copy link
Member

one of these test failures may be flaky, but the test_missing_data one is about an integer dtype?

@michaelosthege
Copy link
Member

I'll take a look at the failing tests later today unless someone else beats me to it

@@ -356,6 +356,9 @@ def test_missing_data(self):

assert m["x2_missing"].type == gf._extra_vars_shared["x2_missing"].type

# The dtype of the merged observed/missing deterministic should match the RV dtype
assert m.deterministics[0].type.dtype == str(X.dtype)
Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry @michaelosthege, I've been busy with school stuff. My guess is that is line is what causes the test to fail?

jessegrabowski and others added 2 commits January 12, 2023 18:16
…ng vector

Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
@michaelosthege michaelosthege merged commit 6c4d4eb into pymc-devs:main Jan 12, 2023
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.

BUG: Datatype of Discrete RVs is changed to float64 when observed data has missing values
3 participants