@@ -537,11 +537,9 @@ def get_x_dim(self, data_var_key=None):
537537 return dims [0 ]
538538
539539 else :
540- l = list (self ['ST' ].dims )
541- return next (l .remove (self .get_time_dim ()))
542-
543-
544-
540+ time_dim = self .get_time_dim ()
541+ l = list (self ['ST' ].dims ) # noqa: E741
542+ return next (l .remove (time_dim ))
545543
546544 def variance_stokes (
547545 self ,
@@ -1029,7 +1027,6 @@ def calibration_single_ended(
10291027
10301028 check_dims (self , [st_label , ast_label ], correct_dims = (x_dim , time_dim ))
10311029
1032-
10331030 if method == 'ols' :
10341031 nt , z , p_val = calibration_single_ended_ols (
10351032 self , st_label , ast_label )
@@ -1289,8 +1286,9 @@ def calibration_double_ended(
12891286
12901287 if store_p_val and (method == 'wls' or method == 'external' ):
12911288 # TODO: add params1 dimension
1292- if 'params1' in self .coords :
1293- if self .coords ['params1' ].size != p_val .size :
1289+
1290+ if store_p_val in self :
1291+ if self [store_p_val ].size != p_val .size :
12941292 if store_p_val in self :
12951293 del self [store_p_val ]
12961294 if store_p_cov in self :
@@ -1307,8 +1305,8 @@ def calibration_double_ended(
13071305 if store_p_cov and (method == 'wls' or method == 'external' ):
13081306 # TODO: add params1 dimension
13091307 # TODO: add params2 dimension
1310- if 'params1' in self . coords :
1311- if self . coords [ 'params1' ].size != p_val .size :
1308+ if store_p_cov in self :
1309+ if self [ store_p_cov ].size != p_cov .size :
13121310 if store_p_val in self :
13131311 del self [store_p_val ]
13141312 if store_p_cov in self :
0 commit comments