Skip to content

Fix bug in random function of HalfStudent #6658

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 3 commits into from
Apr 13, 2023

Conversation

Dhruvanshu-Joshi
Copy link
Member

@Dhruvanshu-Joshi Dhruvanshu-Joshi commented Apr 7, 2023

What is this PR about?
In this PR, we aim to solve the issue 6657. Originally what was passed as sigma is now passed by keyword as scale.

Checklist

Major / Breaking Changes

  • ...

New features

  • ...

Bugfixes

Documentation

  • ...

Maintenance

  • ...

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

@ricardoV94
Copy link
Member

ricardoV94 commented Apr 8, 2023

Oops #6654 seems to not be working, the changes in this PR should have triggered the tests.

@ricardoV94 ricardoV94 changed the title Scale parameter added for HalfStudent Fix bug in random function of HalfStudent Apr 8, 2023
@ricardoV94
Copy link
Member

The tests not being triggered should be fixed once #6659 is merged

@ricardoV94
Copy link
Member

@Dhruvanshu-Joshi If you rebase from main and push again the tests should run

@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Merging #6658 (9c9c686) into main (5d68bf3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6658      +/-   ##
==========================================
+ Coverage   91.97%   91.98%   +0.01%     
==========================================
  Files          94       94              
  Lines       15942    15942              
==========================================
+ Hits        14663    14665       +2     
+ Misses       1279     1277       -2     
Impacted Files Coverage Δ
pymc/distributions/continuous.py 97.70% <100.00%> (ø)

... and 2 files with indirect coverage changes

@ricardoV94
Copy link
Member

No test failed which means we need to tweak the HalfStudentT random test to cover the change (it should fail if the change hadn't been done or reverted)

@ricardoV94
Copy link
Member

Since this is blocking a release I went ahead and added a test.

Apparently the HalfSTudentT random method was not being tested at all!

@Dhruvanshu-Joshi
Copy link
Member Author

Hey @ricardoV94 . I was working on the test but was trying a different approach wherein I tried to generate the sample using pm.HalfStudentT rv and compare the mean and std of the sample with the theoretical mean and std. I am still pretty naive at generating tests and will go through the codebase again to have a better grasp and be quick to complete the task so the it does not block any future release. Thank You for your help.

@ricardoV94
Copy link
Member

ricardoV94 commented Apr 13, 2023

@Dhruvanshu-Joshi There was absolutely nothing wrong with the time you were taking!

In the end the test solution was easy: just use the framework we have in place to test the random methods.

I assumed this was already being used for the current RV but it didn't! I didn't give you the proper advice.

If anything it was my fault :)

@ricardoV94 ricardoV94 merged commit fa82fef into pymc-devs:main Apr 13, 2023
@Dhruvanshu-Joshi
Copy link
Member Author

Thanks @ricardoV94 . I'll go through the framework to better improve my understanding🙂

@ricardoV94
Copy link
Member

ricardoV94 commented Apr 13, 2023

@ricardoV94 ricardoV94 added the bug label Apr 14, 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.

2 participants