Skip to content

Fix seed for numpy and random module in tests#25

Merged
fehiepsi merged 1 commit intomasterfrom
fix-seed
Mar 7, 2019
Merged

Fix seed for numpy and random module in tests#25
fehiepsi merged 1 commit intomasterfrom
fix-seed

Conversation

@neerajprad
Copy link
Member

@neerajprad neerajprad commented Mar 6, 2019

  • Changed atol for one of the tests in test_util which was barely failing.
  • Added set_rng_seed function which is call for each pytest item to fix numpy and python random module seeds for replicable test results.

@neerajprad neerajprad requested a review from fehiepsi March 6, 2019 23:55
q_i, p_i = get_final_state(model, args.step_size, args.num_steps, q_f, p_reverse)
for node in args.q_i:
assert_allclose(q_i[node], args.q_i[node], atol=1e-5)
assert_allclose(q_i[node], args.q_i[node], atol=1e-4)
Copy link
Member

Choose a reason for hiding this comment

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

@neerajprad Just curious, I think this is a deterministic function. Does this issue come from different systems?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you said this is barely failing. Maybe that is a little bit imprecision accumulated through many velocity_verlet steps.

@fehiepsi fehiepsi merged commit b6e10f0 into master Mar 7, 2019
@neerajprad neerajprad deleted the fix-seed branch November 19, 2019 19:03
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