-
Notifications
You must be signed in to change notification settings - Fork 721
implemented possibility of chosing random seed #917
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
|
Thank you Marek, |
|
@Ericgig sorry about that, I just added the argument, I'm also planning adding some tests but I haven't yet figured out what would be best way to do it, any suggestions welcome! |
|
How about instead of checking if it is Hermitian, we could put a seed parameter and check if the output is exactly equal (or close) to given hardcoded matrix? qutip/qutip/tests/test_rand.py Line 57 in d91a4c9
|
|
Hardcoded matrix will cause problem in later modification of the code. (Or if numpy update it's random number generator, etc.) You check that random Qobj are reproducible using a seed and work as expected when not. |
|
@Ericgig good idea about the tests, I'll implement them in this way now there seems to be some problem with continuous integration, it fails on I attempted to fix it by installing travis-ci/travis-ci#4816 (comment) I don't want to mess up too much with continous integration as it takes long time to rebuild it, any suggestions on that? |
|
Do worry about the failing python2.7 tests, it's a common error on all recent checks. Your pull should not affect them. |
…vironment" This reverts commit 1d28411.
|
@Ericgig tests implemented and passing, please code review if you can. |
|
As it is in your code, if no seed is given, then np.random.seed(None) is called. np.random.seed(None) reset the seed based on the computer time. It would be better if you did: |
|
@Ericgig thanks for suggestion weird, my local tests all passed, let me examine the problem |
|
It seems to be caused by a new version of cython which affect which files are used for tests by nose. I made a patch. |
|
Thats great, thanks @Ericgig If any other modifications requested don't hesitate to let me know. Looking forward to have my changes merged! |
|
I marked a few spot where the seed was applied more than once. |
|
@Ericgig I marked your remarks as resolved and made some new changes. If anything more required don't hesitate to ping me. |
No description provided.