-
Notifications
You must be signed in to change notification settings - Fork 22
tests: more tests for random funcs #135
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #135 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 19 19
Lines 1240 1262 +22
Branches 329 335 +6
======================================
- Misses 1240 1261 +21
- Partials 0 1 +1
Continue to review full report at Codecov.
|
c1f8f08
to
cfc78db
Compare
* added test_randn_normal_distribution * added test_radnom_seed * skipped tests * scipy import under the coment currently : TODO
cfc78db
to
2c31c2b
Compare
alpha = 0.05 | ||
dpnp.random.seed(28041990) | ||
x = dpnp.random.randn(pts) | ||
_, p = stats.normaltest(x) |
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.
How it is works is stats
commented out above?
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.
Added comments
tests/test_random.py
Outdated
a1 = func(args) | ||
dpnp.random.seed(seed) | ||
a2 = func(args) | ||
assert_array_equal(a1, a2) |
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'm not sure this function is suitable to compare floating point arrays. I think assert_allclose
function should be used
Example:
Line 59 in b26d624
numpy.testing.assert_allclose(dpnp_val, np_val, rtol=1e-05, atol=1e-05) |
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.
rtol=1e-05
is suitable for float
datatype. For double
it should be much stronger.
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.
LGTM in general. Minor changes might be done
* added comments for test_randn_normal_distribution * using assert_allclose in test_radnom_seed
test_randn_normal_distribution
. See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.normaltest.htmltest_radnom_seed
TODO:
scipy
dependency into test build