Changes in src/sas/sasgui/perspectives/pr/pr.py [7432acb:959eb01] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
r7432acb r959eb01 291 291 """ 292 292 qtemp = pr.x 293 if q is notNone:293 if not q == None: 294 294 qtemp = q 295 295 … … 303 303 304 304 # Check for user min/max 305 if pr.q_min is notNone:305 if not pr.q_min == None: 306 306 minq = pr.q_min 307 if pr.q_max is notNone:307 if not pr.q_max == None: 308 308 maxq = pr.q_max 309 309 … … 393 393 394 394 for i in range(len(x)): 395 if cov2 isNone:395 if cov2 == None: 396 396 value = pr.pr(out, x[i]) 397 397 else: … … 412 412 dy = dy / pmax 413 413 414 if cov2 isNone:414 if cov2 == None: 415 415 new_plot = Data1D(x, y) 416 416 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM … … 487 487 scale = None 488 488 min_err = 0.0 489 if path is notNone:489 if not path == None: 490 490 input_f = open(path, 'r') 491 491 buff = input_f.read() … … 499 499 err = float(toks[2]) 500 500 else: 501 if scale isNone:501 if scale == None: 502 502 scale = 0.05 * math.sqrt(y) 503 503 #scale = 0.05/math.sqrt(y) … … 512 512 logger.error(sys.exc_value) 513 513 514 if scale is notNone:514 if not scale == None: 515 515 message = "The loaded file had no error bars, statistical errors are assumed." 516 516 wx.PostEvent(self.parent, StatusEvent(status=message)) … … 537 537 538 538 data_started = False 539 if path is notNone:539 if not path == None: 540 540 input_f = open(path, 'r') 541 541 buff = input_f.read() … … 550 550 err = float(toks[2]) 551 551 else: 552 if scale isNone:552 if scale == None: 553 553 scale = 0.05 * math.sqrt(y) 554 554 #scale = 0.05/math.sqrt(y) … … 565 565 data_started = True 566 566 567 if scale is notNone:567 if not scale == None: 568 568 message = "The loaded file had no error bars, statistical errors are assumed." 569 569 wx.PostEvent(self.parent, StatusEvent(status=message)) … … 721 721 722 722 # If a thread is already started, stop it 723 if self.calc_thread is notNone and self.calc_thread.isrunning():723 if self.calc_thread != None and self.calc_thread.isrunning(): 724 724 self.calc_thread.stop() 725 725 ## stop just raises the flag -- the thread is supposed to … … 761 761 self.elapsed = elapsed 762 762 self.control_panel.alpha_estimate = alpha 763 if message is notNone:763 if not message == None: 764 764 wx.PostEvent(self.parent, StatusEvent(status=str(message))) 765 765 self.perform_estimateNT() … … 779 779 self.control_panel.nterms_estimate = nterms 780 780 self.control_panel.alpha_estimate = alpha 781 if message is notNone:781 if not message == None: 782 782 wx.PostEvent(self.parent, StatusEvent(status=str(message))) 783 783 … … 858 858 859 859 # Make a plot of I(q) data 860 if self.pr.err isNone:860 if self.pr.err == None: 861 861 new_plot = Data1D(self.pr.x, self.pr.y) 862 862 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM … … 921 921 try: 922 922 pr = self._create_plot_pr() 923 if pr is notNone:923 if not pr == None: 924 924 self.pr = pr 925 925 self.perform_inversion() … … 944 944 try: 945 945 pr = self._create_plot_pr() 946 if pr is notNone:946 if not pr == None: 947 947 self.pr = pr 948 948 self.perform_estimate() … … 983 983 err = self.current_plottable.dy 984 984 all_zeros = True 985 if err isNone:985 if err == None: 986 986 err = np.zeros(len(pr.y)) 987 987 else: … … 995 995 for i in range(len(pr.y)): 996 996 # Scale the error so that we can fit over several decades of Q 997 if scale isNone:997 if scale == None: 998 998 scale = 0.05 * math.sqrt(pr.y[i]) 999 999 min_err = 0.01 * pr.y[i] … … 1024 1024 try: 1025 1025 pr = self._create_file_pr(data) 1026 if pr is notNone:1026 if not pr == None: 1027 1027 self.pr = pr 1028 1028 self.perform_inversion() … … 1090 1090 # If we have not errors, add statistical errors 1091 1091 if y is not None: 1092 if err isNone or np.all(err) == 0:1092 if err == None or np.all(err) == 0: 1093 1093 err = np.zeros(len(y)) 1094 1094 scale = None … … 1096 1096 for i in range(len(y)): 1097 1097 # Scale the error so that we can fit over several decades of Q 1098 if scale isNone:1098 if scale == None: 1099 1099 scale = 0.05 * math.sqrt(y[i]) 1100 1100 min_err = 0.01 * y[i] … … 1129 1129 1130 1130 # If a thread is already started, stop it 1131 if self.estimation_thread is notNone and \1131 if self.estimation_thread != None and \ 1132 1132 self.estimation_thread.isrunning(): 1133 1133 self.estimation_thread.stop() … … 1159 1159 1160 1160 # If a thread is already started, stop it 1161 if self.estimation_thread is notNone and self.estimation_thread.isrunning():1161 if self.estimation_thread != None and self.estimation_thread.isrunning(): 1162 1162 self.estimation_thread.stop() 1163 1163 ## stop just raises the flag -- the thread is supposed to
Note: See TracChangeset
for help on using the changeset viewer.