Open elbeejay opened 3 years ago
They would only be the same if there have been no timesteps since saving. Can you verify that is the case with only runnning two timesteps?
I think so, they have the same "time" attribute since the assertion
# final time should be the same
assert ModelA['time'][-1].data == ModelB['time'][-1].data
is not throwing an error.
In this test case with 2 timesteps, one model is saving after both, so it does timestep 1 - save - timestep 2 - save, while the other model only saves after 2 timesteps, so it does timestep 1 - timestep 2 - save
Not sure if this is something I should have known, but I have recently been surprised to see that different
save_dt
parameter values produce different results even when the seed is fixed. I think this is a bug (only RNG seed should control model values). Below is a test I think could be added to the test classTestModelIsReproducible
withintest_consistent_outputs.py
that demonstrates the issue I have run into. The final assertion, which checks to see if the final topography grids are the same, fails. The test can be seen actively failing here.If a similar test is run with a
seed
matrix that has the same value twice (save_dt
is the same between the two runs), then it passes and the runs are identical. This suggests to me thatsave_dt
is the culprit and is somehow causing runs with identical random seeds to diverge. Passing test shown below.