Skip to content

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

Merged
merged 2 commits into from
Oct 14, 2020
Merged

Conversation

samir-nasibli
Copy link

@samir-nasibli samir-nasibli commented Oct 12, 2020

TODO:

  • add scipy dependency into test build

@codecov
Copy link

codecov bot commented Oct 12, 2020

Codecov Report

Merging #135 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          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     
Impacted Files Coverage Δ
dpnp/linalg/linalg_iface.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68815e3...90c2a97. Read the comment docs.

@samir-nasibli samir-nasibli force-pushed the samir-nasibli/test/random_module branch from c1f8f08 to cfc78db Compare October 12, 2020 02:19
@samir-nasibli samir-nasibli requested a review from shssf October 12, 2020 02:21
* added test_randn_normal_distribution

* added test_radnom_seed

* skipped tests

* scipy import under the coment currently : TODO
@samir-nasibli samir-nasibli force-pushed the samir-nasibli/test/random_module branch from cfc78db to 2c31c2b Compare October 12, 2020 02:25
alpha = 0.05
dpnp.random.seed(28041990)
x = dpnp.random.randn(pts)
_, p = stats.normaltest(x)
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

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

Added comments

a1 = func(args)
dpnp.random.seed(seed)
a2 = func(args)
assert_array_equal(a1, a2)
Copy link
Contributor

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:

numpy.testing.assert_allclose(dpnp_val, np_val, rtol=1e-05, atol=1e-05)

Copy link
Contributor

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.

Copy link
Contributor

@shssf shssf left a 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
@shssf shssf merged commit 729592c into master Oct 14, 2020
@shssf shssf deleted the samir-nasibli/test/random_module branch October 14, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants