@@ -14239,19 +14239,19 @@ def loadbackground(self, filename:str) -> None:
1423914239 f.close()
1424014240 profile = deserialize(filename)
1424114241 self.plusAddPath(profile, filename)
14242- self.qmc.backgroundprofile = cast('ProfileData',profile)
14243- tb = profile['timex']
14244- t1 = profile['temp1']
14245- t2 = profile['temp2']
14242+ self.qmc.backgroundprofile = cast('ProfileData', profile)
14243+ tb:list[float] = profile['timex']
14244+ t1:list[float] = profile['temp1']
14245+ t2:list[float] = profile['temp2']
1424614246 # ensure that timex, temp1 and temp2 are all of the same (minimal-)length
1424714247 data_len:int = min(len(tb), len(t1), len(t2))
1424814248 tb = tb[:data_len]
1424914249 t1 = t1[:data_len]
1425014250 t2 = t2[:data_len]
1425114251
14252- timex = profile['extratimex']
14253- t1x = profile['extratemp1']
14254- t2x = profile['extratemp2']
14252+ timex:list[list[float]] = profile['extratimex']
14253+ t1x:list[list[float]] = profile['extratemp1']
14254+ t2x:list[list[float]] = profile['extratemp2']
1425514255 # ensure that number of extra device data is consistent
1425614256 number_extra_devices = min(len(timex), len(t1x), len(t2x))
1425714257 timex = timex[:number_extra_devices]
@@ -14265,9 +14265,9 @@ def loadbackground(self, filename:str) -> None:
1426514265 if len(timex[c]) != data_len:
1426614266 timex[c] = tb[:]
1426714267 if len(t1x[c]) != data_len:
14268- t1x[c] = [-1]*data_len
14268+ t1x[c] = [-1. ]*data_len
1426914269 if len(t2x[c]) != data_len:
14270- t2x[c] = [-1]*data_len
14270+ t2x[c] = [-1. ]*data_len
1427114271
1427214272
1427314273 # reset the movebackground cache:
@@ -14300,7 +14300,7 @@ def loadbackground(self, filename:str) -> None:
1430014300
1430114301 names1x = [decodeLocalStrict(x) for x in profile['extraname1']]
1430214302 names2x = [decodeLocalStrict(x) for x in profile['extraname2']]
14303- self.qmc.temp1B,self.qmc.temp2B,self.qmc.timeB, self.qmc.temp1BX, self.qmc.temp2BX = t1,t2,tb,t1x, t2x
14303+ self.qmc.temp1B,self.qmc.temp2B,self.qmc.timeB, self.qmc.temp1BX, self.qmc.temp2BX = t1,t2,tb,[numpy.array(tx) for tx in t1x],[numpy.array(tx) for tx in t2x]
1430414304 self.qmc.abs_timeB = tb.copy() #invariant copy of timeB
1430514305 self.qmc.extratimexB = timex
1430614306
@@ -14325,7 +14325,7 @@ def loadbackground(self, filename:str) -> None:
1432514325
1432614326 # we resample the temperatures to regular interval timestamps
1432714327 tb_lin:numpy.ndarray[tuple[Literal[1]],numpy.dtype[numpy.double]]|None = None
14328- if tb is not None and tb :
14328+ if tb:
1432914329 tb_lin = cast(numpy.ndarray[tuple[Literal[1]]], numpy.linspace(tb[0],tb[-1],len(tb)))
1433014330 decay_smoothing_p = not self.qmc.optimalSmoothing
1433114331 b1 = self.qmc.smooth_list(tb,t1,window_len=self.qmc.curvefilter,decay_smoothing=decay_smoothing_p,a_lin=tb_lin)
@@ -14344,7 +14344,7 @@ def loadbackground(self, filename:str) -> None:
1434414344 if (self.qmc.xtcurveidx > 0 and n3 == i) or (self.qmc.ytcurveidx > 0 and n4 == i): # this is the 3rd or 4th background curve to be drawn, we smooth it
1434514345 tx=timex[i]
1434614346 tx_lin:numpy.ndarray[tuple[Literal[1]],numpy.dtype[numpy.double]]|None = None
14347- if tx is not None and tx :
14347+ if tx:
1434814348 tx_lin = cast(numpy.ndarray[tuple[Literal[1]],numpy.dtype[numpy.double]], numpy.linspace(tx[0],tx[-1],len(tx)))
1434914349 if (self.qmc.xtcurveidx > 0 and n3 == i and self.qmc.xtcurveidx % 2) or (self.qmc.ytcurveidx > 0 and n4 == i and self.qmc.ytcurveidx % 2):
1435014350 b1x.append(self.qmc.smooth_list(tx,t1x[i],window_len=self.qmc.curvefilter,decay_smoothing=decay_smoothing_p,a_lin=tx_lin))
0 commit comments