-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactoring the ChiSquared distribution #4695
Conversation
Thanks for taking this on @larryshamalama! |
@larryshamalama Thanks for taking on this one. Unfortunately it seems the chisquare RandomVariable should go on our aesara library , as it is offered by numpy. Would you like to open a PR there? It would look similar to this one: https://github.com/pymc-devs/aesara/pull/363/files, but including just the Then we can come back to this PR and import the op from |
Thanks so much for the suggestions @ricardoV94, I can do just that and then edit this PR accordingly. |
Using aesara's op now. Still unsure if I am properly inheriting from Edit: jobs seem to be failing... |
Even after fixing the errors, the tests will still fail until a new version of Aesara is released. You should test that it passes locally for the time being |
The latest Aesara version was released, you should be able to install it (version |
Hi @larryshamalama, any progress on this PR? |
Hi @ricardoV94, so sorry for the delay, this PR sat on my back burner due to organizing an upcoming conference. Let me revisit this today. |
There is no rush, just wanted to know what was the status :) |
Embarrassing question... do you mind explaining how to check this? I'm new to testing in general and was not able to successfully run some test functions by copy pasting into a notebook (see here). Do you have any suggestions or tips? |
There is nothing embarrassing about it. First of all, the tests should now work here as we have already updated the aesara version we are using. In any case it's very important to get comfortable running tests locally. Ideally you would run your tests from the terminal by calling Alternatively you can use some IDEs like pycharm that allow you to run tests from the interface. Copying tests to a separate notebook should only be a last resort thing (if ever advisable) because it's much more difficult to setup, and not easy to use debugging tools that you'll need when you can't easily figure out why a test is failing. |
You should also install You can read our wiki to learn how to install and run it: https://github.com/pymc-devs/pymc3/wiki/PyMC3-Python-Code-Style This way it will catch this sort of errors automatically (and fix them if it can) when you try to make a commit, saving you some time. |
so I spent some time looking into testing and the library... My newly created tests are failing but I have no idea how to fix them. Checking
I checked my ChiSquare class in |
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 to me. Let's see if the tests pass :)
Thanks @larryshamalama! |
Was this merged into |
Damn, my bad. @ricardoV94 can you fix that? |
I don't think I would have realized it in time either. How can it be fixed, other than opening a new PR with the same content? |
Oh no, was this supposed to be merged into another branch? |
* Refactoring ChiSquared distribution * Refactoring ChiSquared (minor edit) * Refactoring Chisquared (another one-line change) * Trying to rebase/merge my branch with updated upstream v4 * Using aesara chisquare op (r.f. PR pymc-devs#414) and renamed ChiSquared to ChiSquare * Added logpdf & logcdf to the ChiSquare class * Corrected function name * Updating branch * Refactoring ChiSquared: bug fixed, tests work locally * Minor fix: removed float32 specification * ☀️ underflow to -inf seems normal in float32 * Minor fix in documentation
* Refactoring ChiSquared distribution * Refactoring ChiSquared (minor edit) * Refactoring Chisquared (another one-line change) * Trying to rebase/merge my branch with updated upstream v4 * Using aesara chisquare op (r.f. PR #414) and renamed ChiSquared to ChiSquare * Added logpdf & logcdf to the ChiSquare class * Corrected function name * Updating branch * Refactoring ChiSquared: bug fixed, tests work locally * Minor fix: removed float32 specification * ☀️ underflow to -inf seems normal in float32 * Minor fix in documentation
This PR further addresses the ongoing issue 4686
I don't fully understand the process of creating tests, but I try to follow the previously mentioned template. If my edits are good (please let me know if I need to correct anything), my questions are:
seeded_numpy_distribution_builder
orseeded_scipy_distribution_builder
vs. creating my own function?tests_to_run
?If there are other PRs or documentation that addresses my questions, I am happy to be pointed to them.
Thanks!