From 61643fb6a7e6c113141bde381ea03c1ee5265081 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Thu, 30 Oct 2025 14:44:53 +0000 Subject: [PATCH] Write NaN to other H-factor table if calculation fails --- process/physics.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index 8960b84888..0a86b2a5b5 100644 --- a/process/physics.py +++ b/process/physics.py @@ -6775,10 +6775,15 @@ def output_confinement_comparison(self, istell: int) -> None: physics_variables.zeff, ) - # Calculate the H-factor for the same confinement time in other scalings - physics_variables.hfac[i_confinement_time - 1] = self.find_other_h_factors( - i_confinement_time - ) + try: + # Calculate the H-factor for the same confinement time in other scalings + physics_variables.hfac[i_confinement_time - 1] = ( + self.find_other_h_factors(i_confinement_time) + ) + except ValueError: + # This is only used for a table in the OUT.DAT so if it fails + # just write a NaN--its not worth crashing PROCESS over. + physics_variables.hfac[i_confinement_time - 1] = np.nan po.ocmmnt( self.outfile,