Skip to content

Problem in shuffle docstring #4853

Closed

Description

@1RyanK

Describe the bug
Within the docstring for shuffle in numpy/random/generator.py, it has

        >>> import arkouda as ak
        >>> rng = ak.random.default_rng(18)
        >>> pda = ak.arange(10)
        >>> pda
        array([0 1 2 3 4 5 6 7 8 9])
        >>> rng.shuffle(pda, method="FisherYates")
        >>> pda
        array([0 8 2 7 9 4 6 3 5 1])
        >>> rng.shuffle(pda, method="MergeShuffle")
        >>> pda
        array([5 6 9 3 8 2 7 0 4 1])

This is correct for 1 locale, but when running the server for different numbers of locales this doesn't work.

To Reproduce
Steps to reproduce the behavior:

  1. Start a server with one locale, connect to it and run the lines above and the output matches.
  2. Start a server with two locales, connect to it and run the lines above and instead get array([4 7 9 0 6 3 1 8 5 2]). Uh-oh...

Expected behavior
It'd be nice if it always came back the same, but failing that, the docstring test needs to be disabled.

Error Message

arkouda.numpy.random.generator.Generator.shuffle
Failed example:
    pda
Expected:
    array([5 6 9 3 8 2 7 0 4 1])
Got:
    array([4 7 9 0 6 3 1 8 5 2])

Is this a Blocking Issue

  • Causes problems in doctest.

Activity

  1. added
    bug
    on Sep 4, 2025
  2. added a commit that references this issue on Sep 4, 2025
    a20bd2d
  3. added a commit that references this issue on Sep 4, 2025
    abd8fea
  4. self-assigned this
    on Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions