From bbacb383cdddb2e1e6f55a0d078109acf7e48b7e Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> Date: Wed, 18 Jan 2023 14:04:41 +0100 Subject: [PATCH] allowing to pass additiinal args to pool.deplete when using user specified maxtrix_func --- openmc/deplete/pool.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openmc/deplete/pool.py b/openmc/deplete/pool.py index a3d37f79f..40e870daf 100644 --- a/openmc/deplete/pool.py +++ b/openmc/deplete/pool.py @@ -15,7 +15,7 @@ USE_MULTIPROCESSING = True NUM_PROCESSES = None -def deplete(func, chain, x, rates, dt, matrix_func=None): +def deplete(func, chain, x, rates, dt, matrix_func=None, **func_args): """Deplete materials using given reaction rates for a specified time Parameters @@ -37,6 +37,8 @@ def deplete(func, chain, x, rates, dt, matrix_func=None): ``fission_yields = {parent: {product: yield_frac}}`` Expected to return the depletion matrix required by ``func`` + func_args : dict + Remaining keyword arguments passed to the matrix_func Returns ------- @@ -57,7 +59,8 @@ def deplete(func, chain, x, rates, dt, matrix_func=None): if matrix_func is None: matrices = map(chain.form_matrix, rates, fission_yields) else: - matrices = map(matrix_func, repeat(chain), rates, fission_yields) + matrices = map(matrix_func, repeat(chain), rates, fission_yields, + **func_args) inputs = zip(matrices, x, repeat(dt))