-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Convert a test to use Hypothesis #1507
base: main
Are you sure you want to change the base?
Conversation
This is a proof of concept for Hypothesis tests. I selected a test that was easy to convert and replaced the existing test with hard-coded values with a few tests that use Hypothesis. Since it was pretty easy to do, I also added tests for complex inputs. One thing I discovered is that cscalar doesn't work for any of the numpy functions. Hypothesis inevitably finds a value that can't be represented precisely and the test fails. All the functions work with zscalar. see: aesara-devs#197
This looks great, thanks! Will review shortly. |
Remove unused imports and fix one formatting issue.
Sounds good. Let me know what you think. It looks like I missed a few Black issues, so I fixed them (I hope) with this commit: fa832d4 |
@@ -56,6 +56,7 @@ dependencies = [ | |||
"cons", | |||
"typing_extensions", | |||
"setuptools >=48.0.0", | |||
"hypothesis", |
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.
You might need to add this to the test set up script (i.e. here).
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.
I added it. I'm not sure how to test it, as I'm a little fuzzy on what this script is used for, but I guess we'll find out when something happens on GitHub. :^)
Add Hypothesis installation to test.yaml in the GitHub workflow.
This is a proof of concept for Hypothesis tests. I selected a test that was easy to convert and replaced the existing test with hard-coded values with a few tests that use Hypothesis.
Since it was pretty easy to do, I also added tests for complex inputs. One thing I discovered is that cscalar doesn't work for any of the numpy functions. Hypothesis inevitably finds a value that can't be represented precisely and the test fails. All the functions work with zscalar.
see: #197
Thank you for opening a PR!
Here are a few important guidelines and requirements to check before your PR can be merged:
pre-commit
is installed and set up.Don't worry, your PR doesn't need to be in perfect order to submit it. As development progresses and/or reviewers request changes, you can always rewrite the history of your feature/PR branches.
If your PR is an ongoing effort and you would like to involve us in the process, simply make it a draft PR.