Skip to content
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

[joss-reviews#2974] A note on reproducibility #19

Closed
chkoar opened this issue Feb 11, 2021 · 3 comments · Fixed by #29
Closed

[joss-reviews#2974] A note on reproducibility #19

chkoar opened this issue Feb 11, 2021 · 3 comments · Fixed by #29

Comments

@chkoar
Copy link
Contributor

chkoar commented Feb 11, 2021

Related: openjournals/joss-reviews#2974

I cannot see a way of controlling the seed on a class level. I suppose that the intention is to control the seed globally via the built-in or the numpy random modules since you use both of them in the package. Although, this is not documented in the docstrings or/and in the documentation.

Some things to consider:

  1. Control the seed on class level by passing a seed number or a random state generator object. Document it in the docstrings.
  2. Control the seed globally using a single entry point. Make a note in the documentation.
geoffreyp added a commit that referenced this issue Feb 12, 2021
@geoffreyp
Copy link
Contributor

We currently control the seed globally in our projects based on the framework. I add a note in the documentation:
https://moead-framework.github.io/framework/html/tuto.html#manage-the-reproducibility-of-results

@sjvrijn
Copy link
Contributor

sjvrijn commented Mar 21, 2021

I strongly agree with @chkoar 's 2nd point that a single point of entry would be better. E.g. adding a set_seed function to your moead_framework.tool subpackage:

import random
import numpy as np

def set_seed(seed):
    random.seed(seed)
    np.random.seed(seed)

This would allow you to easily switch random implementations later without bothering the user, for example if you switch everything to numpy using the new recommended np.random.Generator interface.

@geoffreyp
Copy link
Contributor

The function is added with the PR #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants