Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Random seeding #1337

Closed
jbarr444 opened this issue Jun 8, 2024 · 1 comment
Closed

Random seeding #1337

jbarr444 opened this issue Jun 8, 2024 · 1 comment

Comments

@jbarr444
Copy link

jbarr444 commented Jun 8, 2024

Hi,

I am trying to run the Shipway_and_Hill_2012 example multiple times to examine random behavior. I have basically just put cell 3 in the notebook example inside a for loop. This produces a bunch of identical simulations, but when rerun, produces a (slightly) different set of identical simulations. What's going on here? Can it be made so that each simulation is independent of the others?

@slayoo
Copy link
Member

slayoo commented Jun 8, 2024

@jbarr444 thank you for trying PySDM out and for reporting feedback!
PySDM sets the default random seed on package import (https://github.com/open-atmos/PySDM/blob/main/PySDM/physics/constants.py#L49-L53). So, unless a different random seed is provided manually (through Formulae class ctor), rerunning the simulations in the same Python/Jupyter session will produce exactly the same results. However, restarting a notebook will reimport PySDM, and hence set a new random seed.

In fact, we already have an issue reported suggesting to change this behaviour: #1180

@open-atmos open-atmos locked and limited conversation to collaborators Jun 8, 2024
@slayoo slayoo converted this issue into discussion #1338 Jun 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants