Skip to content

Commit 53ca427

Browse files
committed
mutate code fix
1 parent c481b6c commit 53ca427

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

chromax/simulator.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def cross(self, parents: Parents["n"]) -> Population["n"]:
236236
>>> f2.shape
237237
(3, 9839, 2)
238238
"""
239-
self.random_key, random_key = jax.random.split(self.random_key)
240-
return functional.cross(parents, self.recombination_vec, random_key, self.mutation)
239+
self.random_key, split_key = jax.random.split(self.random_key)
240+
return functional.cross(parents, self.recombination_vec, split_key, self.mutation)
241241

242242
@property
243243
def differentiable_cross_func(self) -> Callable:
@@ -315,9 +315,9 @@ def double_haploid(
315315
>>> dh.shape
316316
(371, 10, 9839, 2)
317317
"""
318-
self.random_key, random_key = jax.random.split(self.random_key)
318+
self.random_key, split_key = jax.random.split(self.random_key)
319319
dh = functional.double_haploid(
320-
population, n_offspring, self.recombination_vec, random_key, self.mutation
320+
population, n_offspring, self.recombination_vec, split_key, self.mutation
321321
)
322322

323323
if n_offspring == 1:

0 commit comments

Comments
 (0)