Skip to content

Seeding the user guide and tutorials #337

Description

@colleenjg

There is randomness used in the user guide, for example in Meet the Data Objects:

>>> behavior = RegularTimeSeries(
...     sampling_rate=100.0,  # in Hz
...     hand_vel=np.random.randn(1000, 2),
...     eye_pos=np.random.randn(1000, 2),
...     pupil_size=np.random.randn(1000),
... )

Occasionally, the output of a random process is shown, e.g.

>>> sliced.pupil_size
array([-0.07094018,  1.1442879 ,  1.26022563,  1.57259098, ..., ])

Should we consider adding a seeding step for code that uses randomness (either with a global np.random.seed(10) or by instantiating an RNG with rng = np.random.RandomState(10)) ? My reasoning is that this can be useful particularly for more beginner users who may feel more confident if they see the same outputs when they run the code locally as what is shown in the guide. (Keeping in mind that seeding potentially different numpy versions on different setups does not guarantee reproducibility.)

Activity

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions