shuffle\_states =============== Randomly permute the order of a pool's state space, optionally with a fixed seed for deterministic shuffling, while leaving the sequences themselves unchanged. .. code-block:: python import poolparty as pp pp.init() ---- Parameters ---------- .. list-table:: :widths: auto :header-rows: 1 * - Parameter - Type - Default - Description * - ``pool`` - ``Pool`` - *(required)* - Input pool whose state order will be shuffled. * - ``seed`` - ``int | None`` - ``None`` - Random seed for deterministic shuffling. ``None`` uses a random seed. * - ``permutation`` - ``list[int] | None`` - ``None`` - Explicit permutation of state indices. Overrides ``seed`` when provided. * - ``prefix`` - ``str | None`` - ``None`` - Prefix for the operation node name in the pool graph. * - ``iter_order`` - ``float | None`` - ``None`` - Enumeration order when combined with other pools. ---- .. note:: Only the most commonly used parameters are shown above. For the full parameter list, see :func:`~poolparty.state_shuffle` in the :doc:`API Reference `. Examples -------- Shuffle All 16 2-mer States with a Fixed Seed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reorder the 16 2-mers produced by ``get_kmers`` using ``seed=0`` so that the permutation is deterministic and reproducible. .. code-block:: python kmers = pp.get_kmers(length=2, mode="sequential") shuffled = pp.state_shuffle(kmers, seed=0) shuffled.print_library() .. raw:: html