Add random seeds to examples for reproducible results#5312
Merged
Conversation
- Add Random.seed!(1234) to all examples that use random functions - Include explanatory comments for consistency - Ensures reproducible results across runs for testing and educational purposes Files modified: - examples/baroclinic_adjustment.jl - examples/convecting_plankton.jl - examples/kelvin_helmholtz_instability.jl - examples/langmuir_turbulence.jl - examples/ocean_wind_mixing_and_convection.jl - examples/shallow_water_Bickley_jet.jl - examples/spherical_baroclinic_instability.jl - examples/tilted_bottom_boundary_layer.jl - examples/two_dimensional_turbulence.jl Co-authored-by: Cursor <[email protected]>
Member
|
can we use more fun numbers than 1234 |
Member
Author
Not sure what you mean by fun, but feel free to change the numbers! |
Member
Author
|
Also, should we try to find a way to have docs fail if one of the examples blows up? At the moment this is a silent failure and we only find out when someone notices it on the docs (like I did for the tilted BBL). |
Member
|
fun numbers: 42, 314, Oceananigans birthday, your birthday, other cool numbers, years, dates, things that have meaning (1234 does not) |
tomchor
commented
Feb 20, 2026
navidcy
reviewed
Feb 28, 2026
navidcy
approved these changes
Feb 28, 2026
glwagner
reviewed
Feb 28, 2026
| using CUDA | ||
| using Random | ||
|
|
||
| Random.seed!(1337) # for reproducible results |
Member
There was a problem hiding this comment.
Suggested change
| Random.seed!(1337) # for reproducible results | |
| Random.seed!(2021) # for reproducible results |
the year wagner et al was published!
glwagner
reviewed
Feb 28, 2026
Member
Author
|
It seems CI is failing because something is going on with distributed tests. Since it seems to be unrelated to this PR, I'm merging. |
briochemc
added a commit
to briochemc/Oceananigans.jl
that referenced
this pull request
Mar 1, 2026
* glw/prescribed-free-surface: Fix reduced FieldTimeSeries indexing to collapse reduced dimensions Add random seeds to examples for reproducible results (CliMA#5312)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5299
Files modified: