Skip to content

Commit 6811835

Browse files
committed
fix: ensure errors are raised for random permutations
1 parent 0b366de commit 6811835

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

jax_galsim/random.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,10 @@ def __str__(self):
746746
)
747747
def permute(rng, *args):
748748
rng = BaseDeviate(rng)
749+
if len(args) == 0:
750+
raise TypeError(
751+
f"`galsim.random.permute` must be called with at least one array. Got {args!r}"
752+
)
749753
arrs = []
750754
for arr in args:
751755
arrs.append(jrandom.permutation(rng._key, arr))

tests/GalSim

0 commit comments

Comments
 (0)