Skip to content

Commit

Permalink
Add test for using int seed in clugen()
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofachada committed Jan 23, 2024
1 parent 763ac91 commit 2cb8493
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ def test_clugen_optional_direct(
)


def test_clugen_reproducibility(seed, ndims):
@pytest.mark.parametrize("use_rng", [True, False])
def test_clugen_reproducibility(seed, ndims, use_rng):
"""Test that clugen() provides reproducible results."""
# This line can't be blank

def run_clugen(seed, ndims):

# Initialize a pseudo-random generator with the specified seed
prng = Generator(Philox(seed))

Expand All @@ -286,7 +288,7 @@ def run_clugen(seed, ndims):
prng.random(), # Line length average
prng.random(), # Line length dispersion
prng.random(), # Lateral dispersion
rng=prng,
rng=prng if use_rng else seed,
)

# Run clugen with specified seed and get results
Expand Down

0 comments on commit 2cb8493

Please sign in to comment.