Skip to content

ak.rand to respect global seed. #4777

Closed

Description

@ajpotts

The behavior should match NumPy:

In [39]: np.random.rand(3)
Out[39]: array([0.55131477, 0.71946897, 0.42310646])

In [40]: np.random.seed(123)

In [41]: np.random.rand(3)
Out[41]: array([0.69646919, 0.28613933, 0.22685145])

In [42]: np.random.seed(123)

In [43]: np.random.rand(3)
Out[43]: array([0.69646919, 0.28613933, 0.22685145])

In [44]: np.random.rand(3)
Out[44]: array([0.55131477, 0.71946897, 0.42310646])

In [45]: np.random.rand(3)
Out[45]: array([0.9807642 , 0.68482974, 0.4809319 ])

Activity

  1. added this to the Numpy Alignment milestone on Aug 11, 2025
  2. self-assigned this
    on Aug 12, 2025
  3. drculhane commented on Aug 14, 2025

    @drculhane
    Contributor

    For what it's worth, the first challenge I see here is that, as far as I can tell, chapel randomStreams can't be reseeded once created.

  4. added a commit that references this issue on Sep 10, 2025
    274c24b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions