From 8db64f8c4721a045b3c4040b7a7f4ba3d8303efd Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 28 Jul 2026 14:50:38 +0100 Subject: [PATCH 01/13] Rename `IPNVARS` to `N_ITERATION_VARIABLES_MAX` for consistency with style guide --- process/core/input.py | 4 +-- process/data_structure/numerics.py | 50 +++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 93886b8a16..d03a87c9b2 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -15,7 +15,7 @@ ) from process.core.solver.constraints import ConstraintManager from process.data_structure.impurity_radiation_variables import N_IMPURITIES -from process.data_structure.numerics import IPNVARS +from process.data_structure.numerics import N_ITERATION_VARIABLES_MAX from process.data_structure.pfcoil_variables import N_PF_GROUPS_MAX from process.data_structure.physics_variables import N_CONFINEMENT_SCALINGS from process.data_structure.scan_variables import IPNSCNS, IPNSCNV @@ -1160,7 +1160,7 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]: "ixc": InputVariable( None, int, - range=(1, IPNVARS), + range=(1, N_ITERATION_VARIABLES_MAX), additional_actions=_ixc_additional_actions, set_variable=False, ), diff --git a/process/data_structure/numerics.py b/process/data_structure/numerics.py index 57505f1c39..6ebbd72e05 100644 --- a/process/data_structure/numerics.py +++ b/process/data_structure/numerics.py @@ -135,7 +135,7 @@ def description(self): return self._description_ -IPNVARS = max(ITERATION_VARIABLES.keys()) +N_ITERATION_VARIABLES_MAX = max(ITERATION_VARIABLES.keys()) """total number of variables available for iteration""" # Set to a really large number so that it should never need to be changed @@ -391,12 +391,14 @@ class NumericsData: * (92) D/T/He3 ratio in fuel sums to 1 """ - ixc: list[int] = field(default_factory=lambda: np.array([0] * IPNVARS)) + ixc: list[int] = field( + default_factory=lambda: np.array([0] * N_ITERATION_VARIABLES_MAX) + ) """Array defining which iteration variables to activate (see lablxc for descriptions) """ - lablxc: list[str] = field(default_factory=lambda: [""] * IPNVARS) + lablxc: list[str] = field(default_factory=lambda: [""] * N_ITERATION_VARIABLES_MAX) """Labels describing iteration variables