Changeset 895e7359 in sasview


Ignore:
Timestamp:
Oct 27, 2017 1:42:57 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
99ea1b0
Parents:
b0b09b9
Message:

Converted more syntax not covered by 2to3

Location:
src/sas
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • src/sas/logger_config.py

    rf4a1433 r895e7359  
    4949        ''' 
    5050        for handler in logger.handlers or logger.parent.handlers: 
    51             handler.setLevel(logging.DEBUG) 
     51            #handler.setLevel(logging.DEBUG) 
     52            handler.setLevel(logging.WARNING) 
    5253        for name, _ in logging.Logger.manager.loggerDict.items(): 
    53             logging.getLogger(name).setLevel(logging.DEBUG) 
     54            #logging.getLogger(name).setLevel(logging.DEBUG) 
     55            logging.getLogger(name).setLevel(logging.WARNING) 
    5456 
    5557    def _find_config_file(self, filename="logging.ini"): 
  • src/sas/qtgui/Calculators/DataOperationUtilityPanel.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    158158        """ Prepare datasets to be added to DataExplorer and DataManager """ 
    159159        new_item = GuiUtils.createModelItemWithPlot( 
    160             QtCore.QVariant(self.output), 
     160            self.output, 
    161161            name=self.txtOutputData.text()) 
    162162 
  • src/sas/qtgui/MainWindow/GuiManager.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    308308                self.communicate.statusBarUpdateSignal.emit(msg) 
    309309 
    310             elif cmp(version, LocalConfig.__version__) > 0: 
     310            elif version.__gt__(LocalConfig.__version__): 
    311311                msg = "Version %s is available! " % str(version) 
    312312                if "download_url" in version_info: 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    156156    """ 
    157157    for i, item in enumerate(model_header_captions): 
    158         #model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 
    159158        model.setHeaderData(i, QtCore.Qt.Horizontal, item) 
    160159 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    989989        if not dict: 
    990990            return 
     991        if self._model_model.rowCount() == 0: 
     992            return 
    991993 
    992994        def iterateOverMagnetModel(func): 
     
    10001002            # Utility function for main model update 
    10011003            # internal so can use closure for param_dict 
     1004            if self._magnet_model.item(row, 0) is None: 
     1005                return 
    10021006            param_name = str(self._magnet_model.item(row, 0).text()) 
    10031007            if param_name not in list(param_dict.keys()): 
  • src/sas/qtgui/Perspectives/Fitting/ModelThread.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    5353        self.starttime = time.time() 
    5454        # Determine appropriate q range 
    55         if self.qmin == None: 
     55        if self.qmin is None: 
    5656            self.qmin = 0 
    57         if self.qmax == None: 
    58             if self.data != None: 
     57        if self.qmax is None: 
     58            if self.data is not None: 
    5959                newx = math.pow(max(math.fabs(self.data.xmax), 
    6060                                   math.fabs(self.data.xmin)), 2) 
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    297297 
    298298            # Add the plot to the model item 
    299             # variant_item = QtCore.QVariant(self._plotter) 
    300             variant_item = QtCore.QVariant(extrapolated_data) 
    301  
    302299            # This needs to run in the main thread 
    303300            reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
    304                     self._model_item, variant_item, title) 
     301                    self._model_item, extrapolated_data, title) 
    305302 
    306303        if self._high_extrapolate: 
     
    322319 
    323320            # Add the plot to the model item 
    324             # variant_item = QtCore.QVariant(self._plotter) 
    325             variant_item = QtCore.QVariant(high_out_data) 
    326321            # This needs to run in the main thread 
    327322            reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
    328                     self._model_item, variant_item, title) 
     323                    self._model_item, high_out_data, title) 
    329324 
    330325        item = QtGui.QStandardItem(str(float('%.5g'% volume_fraction))) 
     
    561556        # Extract data on 1st child - this is the Data1D/2D component 
    562557        data = GuiUtils.dataFromItem(self._model_item) 
    563         self.model.item(WIDGETS.W_FILENAME).setData(QtCore.QVariant(self._model_item.text())) 
     558        self.model.item(WIDGETS.W_FILENAME).setData(self._model_item.text()) 
    564559 
    565560        ##### DEBUG #### 
  • src/sas/qtgui/Plotting/Arrow3D.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    2929        self.base = base 
    3030 
    31         if base != None: 
     31        if base is not None: 
    3232            # To turn the updating off during dragging 
    3333            base.canvas.mpl_connect('button_press_event', self.on_left_down) 
  • src/sas/qtgui/Plotting/Binder.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    233233        """ 
    234234        # TODO: sort by zorder of axes then by zorder within axes 
    235         self._artists.sort(cmp=lambda x, y: cmp(y.zorder, x.zorder)) 
     235        #self._artists.sort(cmp=lambda x, y: cmp(y.zorder, x.zorder)) 
     236        #self._artists.sort(cmp=lambda x, y: y.zorder.__gt__(x.zorder)) 
    236237        found = Selection() 
    237238        for artist in self._artists: 
  • src/sas/qtgui/Plotting/ConvertUnits.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    44""" 
    55import re 
    6 import string 
    76 
    87def convertUnit(power, unit): 
     
    1110    """ 
    1211    if power != 0: 
    13         if string.find(unit, "^") != -1:  # if the unit contains a powerer ^ 
     12        if unit.find("^") != -1:  # if the unit contains a powerer ^ 
    1413            toks = re.split("\^", unit) 
    15             if string.find(toks[0], "/") != -1 or \ 
    16                 string.find(toks[0], "-") != -1: 
     14            if toks[0].find("/") != -1 or \ 
     15                toks[0].find("-") != -1: 
    1716                if power == 1: 
    1817                    unit = unit 
     
    2019                    unit = "(" + unit + ")" + "^{" + str(power) + "}" 
    2120            else: 
    22                 if string.find(toks[1], "{") != -1:  # if found a { 
     21                if toks[1].find("{") != -1:  # if found a { 
    2322                    find_power_toks = re.split("{", toks[1]) 
    24                     if string.find(find_power_toks[1], "}") != -1:  # found } 
     23                    if find_power_toks[1].find("}") != -1:  # found } 
    2524                        unit_toks = re.split("}", find_power_toks[1]) 
    26                         if string.find(unit_toks[0], ".") != -1: 
     25                        if unit_toks[0].find(".") != -1: 
    2726                            powerer = float(unit_toks[0]) * power 
    28                         elif string.find(unit_toks[0], "/") != -1: 
     27                        elif unit_toks[0].find("/") != -1: 
    2928                            power_toks = re.split("/", unit_toks[0]) 
    3029                            powerer = power * int(power_toks[0])\ 
  • src/sas/qtgui/Plotting/DataTransform.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    162162 
    163163    """ 
    164     if dx == None: 
     164    if dx is None: 
    165165        dx = 0 
    166166    return dx 
     
    175175 
    176176    """ 
    177     if dx == None: 
     177    if dx is None: 
    178178        dx = 0 
    179179    return dx 
     
    188188 
    189189    """ 
    190     if  dx != None: 
     190    if  dx is not None: 
    191191        err = 2 * x * dx 
    192192        return math.fabs(err) 
     
    204204    """ 
    205205    if x > 0: 
    206         if dx != None: 
     206        if dx is not None: 
    207207            err = dx / (2 * math.sqrt(x)) 
    208208        else: 
     
    222222 
    223223    """ 
    224     if dx != None: 
     224    if dx is not None: 
    225225        err = 4 * math.pow(x, 3) * dx 
    226226        return math.fabs(err) 
     
    238238    """ 
    239239    if x > 0: 
    240         if dx != None: 
     240        if dx is not None: 
    241241            err = dx / (4 * math.pow(x, 3 / 4)) 
    242242        else: 
     
    256256 
    257257    """ 
    258     if dx == None: 
     258    if dx is None: 
    259259        dx = 0 
    260260 
     
    280280 
    281281    """ 
    282     if dx == None: 
     282    if dx is None: 
    283283        dx = 0 
    284284 
     
    294294    """ 
    295295    """ 
    296     if dx == None: 
    297         dx = 0 
    298     if dy == None: 
     296    if dx is None: 
     297        dx = 0 
     298    if dy is None: 
    299299        dy = 0 
    300300    err = math.sqrt((2 * x * y * dx) ** 2 + ((x ** 2) * dy) ** 2) 
     
    314314        raise ValueError(msg) 
    315315    if x != 0 and y != 0: 
    316         if dx == None: 
     316        if dx is None: 
    317317            dx = 0 
    318         if dy == None: 
     318        if dy is None: 
    319319            dy = 0 
    320320        err = (dx / x) ** 2 + (dy / y) ** 2 
     
    337337        raise ValueError(msg) 
    338338    if x > 0 and y > 0: 
    339         if dx == None: 
     339        if dx is None: 
    340340            dx = 0 
    341         if dy == None: 
     341        if dy is None: 
    342342            dy = 0 
    343343        err = (2.0 * dx / x) ** 2 + (dy / y) ** 2 
     
    353353    """ 
    354354    if x != 0: 
    355         if dx == None: 
     355        if dx is None: 
    356356            dx = 0 
    357357        err = dx / x ** 2 
     
    367367    """ 
    368368    if x > 0: 
    369         if dx == None: 
     369        if dx is None: 
    370370            dx = 0 
    371371        err = -1 / 2 * math.pow(x, -3.0 / 2.0) * dx 
     
    388388        msg += " that are consistent with zero." 
    389389        raise ValueError(msg) 
    390     if dx == None: 
    391         dx = 0 
    392     if dy == None: 
     390    if dx is None: 
     391        dx = 0 
     392    if dy is None: 
    393393        dy = 0 
    394394    err = math.sqrt((4.0 * dx / x) ** 2 + (dy / y) ** 2) 
     
    406406    # within errors 
    407407 
    408     if dx == None: 
    409         dx = 0 
    410     if dy == None: 
     408    if dx is None: 
     409        dx = 0 
     410    if dy is None: 
    411411        dy = 0 
    412412    err = math.sqrt((dy * pow(x, 4)) ** 2 + (4 * y * dx * math.pow(x, 3)) ** 2) 
  • src/sas/qtgui/Plotting/Fittings.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    2222        self.model = model 
    2323        self.name = name 
    24         if not value == None: 
     24        if value is not None: 
    2525            self.model.setParam(self.name, value) 
    2626 
  • src/sas/qtgui/Plotting/PlotUtilities.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    161161    """ 
    162162    # No image matrix given 
    163     if image == None or numpy.ndim(image) != 2 \ 
     163    if image is None or numpy.ndim(image) != 2 \ 
    164164            or numpy.isfinite(image).all() \ 
    165             or weights == None: 
     165            or weights is None: 
    166166        return image 
    167167    # Get bin size in y and x directions 
  • src/sas/qtgui/Plotting/Plottables.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    227227            if p.hidden == True: 
    228228                continue 
    229             if not p.x == None: 
     229            if not p.x is None: 
    230230                for x_i in p.x: 
    231                     if min_value == None or x_i < min_value: 
     231                    if min_value is None or x_i < min_value: 
    232232                        min_value = x_i 
    233                     if max_value == None or x_i > max_value: 
     233                    if max_value is None or x_i > max_value: 
    234234                        max_value = x_i 
    235235        return min_value, max_value 
     
    560560        Returns True if there is no data stored in the plottable 
    561561        """ 
    562         if not self.x == None and len(self.x) == 0 \ 
    563             and not self.y == None and len(self.y) == 0: 
     562        if not self.x is None and len(self.x) == 0 \ 
     563            and not self.y is None and len(self.y) == 0: 
    564564            return True 
    565565        return False 
     
    795795        tempy = [] 
    796796        tempdy = [] 
    797         if self.dx == None: 
     797        if self.dx is None: 
    798798            self.dx = numpy.zeros(len(self.x)) 
    799         if self.dy == None: 
     799        if self.dy is None: 
    800800            self.dy = numpy.zeros(len(self.y)) 
    801801        if self.xLabel == "log10(x)": 
     
    825825        tempy = [] 
    826826        tempdy = [] 
    827         if self.dx == None: 
     827        if self.dx is None: 
    828828            self.dx = numpy.zeros(len(self.x)) 
    829         if self.dy == None: 
     829        if self.dy is None: 
    830830            self.dy = numpy.zeros(len(self.y)) 
    831831        if self.yLabel == "log10(y)": 
     
    858858        tempy = [] 
    859859        tempdy = [] 
    860         if self.dx == None: 
     860        if self.dx is None: 
    861861            self.dx = numpy.zeros(len(self.x)) 
    862         if self.dy == None: 
     862        if self.dy is None: 
    863863            self.dy = numpy.zeros(len(self.y)) 
    864         if xmin != None and xmax != None: 
     864        if xmin is not None and xmax is not None: 
    865865            for i in range(len(self.x)): 
    866866                if self.x[i] >= xmin and self.x[i] <= xmax: 
     
    12021202        """ 
    12031203        """ 
    1204         if  self._chisq == None: 
     1204        if  self._chisq is None: 
    12051205            chisqTxt = r'$\chi^2=$' 
    12061206        else: 
  • src/sas/qtgui/Plotting/Plotter.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    614614        """ 
    615615        ax = event.inaxes 
    616         if ax == None: 
     616        if ax is None: 
    617617            return 
    618618        # Event occurred inside a plotting area 
     
    649649        step = event.step 
    650650 
    651         if ax != None: 
     651        if ax is not None: 
    652652            # Event occurred inside a plotting area 
    653653            lo, hi = ax.get_xlim() 
  • src/sas/qtgui/Plotting/Plotter2D.py

    rf4a1433 r895e7359  
    281281        new_plot.id = "Circ avg " + self.data.name 
    282282        new_plot.is_data = True 
    283         variant_plot = QtCore.QVariant(new_plot) 
    284         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     283        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    285284        self.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    286285 
  • src/sas/qtgui/Plotting/PlotterData.py

    • Property mode changed from 100755 to 100644
    rfef38e8 r895e7359  
    7171        result.clone_without_data(length=len(self.x), clone=self) 
    7272        result.copy_from_datainfo(data1d=self) 
    73         if self.dxw == None: 
     73        if self.dxw is None: 
    7474            result.dxw = None 
    7575        else: 
    7676            result.dxw = numpy.zeros(len(self.x)) 
    77         if self.dxl == None: 
     77        if self.dxl is None: 
    7878            result.dxl = None 
    7979        else: 
     
    118118        tot_length = len(self.x) + len(other.x) 
    119119        result = self.clone_without_data(length=tot_length, clone=result) 
    120         if self.dy == None or other.dy is None: 
     120        if self.dy is None or other.dy is None: 
    121121            result.dy = None 
    122122        else: 
    123123            result.dy = numpy.zeros(tot_length) 
    124         if self.dx == None or other.dx is None: 
     124        if self.dx is None or other.dx is None: 
    125125            result.dx = None 
    126126        else: 
    127127            result.dx = numpy.zeros(tot_length) 
    128         if self.dxw == None or other.dxw is None: 
     128        if self.dxw is None or other.dxw is None: 
    129129            result.dxw = None 
    130130        else: 
    131131            result.dxw = numpy.zeros(tot_length) 
    132         if self.dxl == None or other.dxl is None: 
     132        if self.dxl is None or other.dxl is None: 
    133133            result.dxl = None 
    134134        else: 
     
    141141        result.y = numpy.append(self.y, other.y) 
    142142        result.y = result.y[ind] 
    143         if result.dy != None: 
     143        if result.dy is not None: 
    144144            result.dy = numpy.append(self.dy, other.dy) 
    145145            result.dy = result.dy[ind] 
     
    238238        result.ymin = self.ymin 
    239239        result.ymax = self.ymax 
    240         if self.dqx_data == None or self.dqy_data == None: 
     240        if self.dqx_data is None or self.dqy_data is None: 
    241241            result.dqx_data = None 
    242242            result.dqy_data = None 
     
    301301        result.ymin = self.ymin 
    302302        result.ymax = self.ymax 
    303         if self.dqx_data == None or self.dqy_data == None or \ 
    304                 other.dqx_data == None or other.dqy_data == None : 
     303        if self.dqx_data is None or self.dqy_data is None or \ 
     304                other.dqx_data is None or other.dqy_data is None : 
    305305            result.dqx_data = None 
    306306            result.dqy_data = None 
  • src/sas/qtgui/Plotting/SlicerModel.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    2323            item2 = QtGui.QStandardItem(GuiUtils.formatNumber(parameters[parameter])) 
    2424            self._model.appendRow([item1, item2]) 
    25         self._model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) 
    26         self._model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Value")) 
     25        self._model.setHeaderData(0, QtCore.Qt.Horizontal, "Parameter") 
     26        self._model.setHeaderData(1, QtCore.Qt.Horizontal, "Value") 
    2727 
    2828    def setParamsFromModel(self, item): 
  • src/sas/qtgui/Plotting/Slicers/AnnulusSlicer.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    145145        new_plot.xtransform = "x" 
    146146        new_plot.ytransform = "y" 
    147         variant_plot = QtCore.QVariant(new_plot) 
    148         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     147        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    149148        self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    150149 
  • src/sas/qtgui/Plotting/Slicers/Arc.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    7070        x = [] 
    7171        y = [] 
    72         if theta1 != None: 
     72        if theta1 is not None: 
    7373            self.theta1 = theta1 
    74         if theta2 != None: 
     74        if theta2 is not None: 
    7575            self.theta2 = theta2 
    7676        while self.theta2 < self.theta1: 
     
    8080        npts = int((self.theta2 - self.theta1) / (math.pi / 120)) 
    8181 
    82         if r == None: 
     82        if r is None: 
    8383            self.radius = math.sqrt(math.pow(self._mouse_x, 2) + \ 
    8484                                     math.pow(self._mouse_y, 2)) 
  • src/sas/qtgui/Plotting/Slicers/BoxSlicer.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    190190        new_plot.id = (self.averager.__name__) + self.base.data.name 
    191191        new_plot.is_data = True 
    192         variant_plot = QtCore.QVariant(new_plot) 
    193         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     192        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    194193 
    195194        if self.update_model: 
  • src/sas/qtgui/Plotting/Slicers/BoxSum.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    110110        parameters = self.getParams() 
    111111        # Crete/overwrite model items 
    112         self._model.setData(self._model.index(0, 0), 
    113                     QtCore.QVariant(formatNumber(parameters['Height']))) 
    114         self._model.setData(self._model.index(0, 1), 
    115                     QtCore.QVariant(formatNumber(parameters['Width']))) 
    116         self._model.setData(self._model.index(0, 2), 
    117                     QtCore.QVariant(formatNumber(parameters['center_x']))) 
    118         self._model.setData(self._model.index(0, 3), 
    119                     QtCore.QVariant(formatNumber(parameters['center_y']))) 
     112        self._model.setData(self._model.index(0, 0), formatNumber(parameters['Height'])) 
     113        self._model.setData(self._model.index(0, 1), formatNumber(parameters['Width'])) 
     114        self._model.setData(self._model.index(0, 2), formatNumber(parameters['center_x'])) 
     115        self._model.setData(self._model.index(0, 3), formatNumber(parameters['center_y'])) 
    120116 
    121117        self.setReadOnlyParametersFromModel() 
     
    130126        """ 
    131127        parameters = self.getParams() 
    132         self._model.setData(self._model.index(0, 4), 
    133                     QtCore.QVariant(formatNumber(parameters['avg']))) 
    134         self._model.setData(self._model.index(0, 5), 
    135                     QtCore.QVariant(formatNumber(parameters['avg_error']))) 
    136         self._model.setData(self._model.index(0, 6), 
    137                     QtCore.QVariant(formatNumber(parameters['sum']))) 
    138         self._model.setData(self._model.index(0, 7), 
    139                     QtCore.QVariant(formatNumber(parameters['sum_error']))) 
    140         self._model.setData(self._model.index(0, 8), 
    141                     QtCore.QVariant(formatNumber(parameters['num_points']))) 
     128        self._model.setData(self._model.index(0, 4), formatNumber(parameters['avg'])) 
     129        self._model.setData(self._model.index(0, 5), formatNumber(parameters['avg_error'])) 
     130        self._model.setData(self._model.index(0, 6), formatNumber(parameters['sum'])) 
     131        self._model.setData(self._model.index(0, 7), formatNumber(parameters['sum_error'])) 
     132        self._model.setData(self._model.index(0, 8), formatNumber(parameters['num_points'])) 
    142133 
    143134    def setParamsFromModel(self): 
     
    362353        Draw the new roughness on the graph. 
    363354        """ 
    364         if center_x != None: 
     355        if center_x is not None: 
    365356            self.x = center_x 
    366         if center_y != None: 
     357        if center_y is not None: 
    367358            self.y = center_y 
    368359        self.center_marker.set(xdata=[self.x], ydata=[self.y]) 
  • src/sas/qtgui/Plotting/Slicers/SectorSlicer.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    125125        data = self.base.data 
    126126        # If we have no data, just return 
    127         if data == None: 
     127        if data is None: 
    128128            return 
    129129        # Averaging 
     
    132132        phimin = -self.left_line.phi + self.main_line.theta 
    133133        phimax = self.left_line.phi + self.main_line.theta 
    134         if nbins == None: 
     134        if nbins is None: 
    135135            nbins = 20 
    136136        sect = SectorQ(r_min=0.0, r_max=radius, 
     
    168168        new_plot.id = "SectorQ" + self.base.data.name 
    169169        new_plot.is_data = True 
    170         variant_plot = QtCore.QVariant(new_plot) 
    171         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     170        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    172171        self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    173172 
     
    349348        self.left_moving = left 
    350349        theta3 = 0 
    351         if phi != None: 
     350        if phi is not None: 
    352351            self.phi = phi 
    353         if delta == None: 
     352        if delta is None: 
    354353            delta = 0 
    355354        if  right: 
     
    361360            self.theta = mline.theta + self.phi 
    362361 
    363         if mline != None: 
     362        if mline is not None: 
    364363            if delta != 0: 
    365364                self.theta2 = mline + delta 
     
    509508        """ 
    510509 
    511         if theta != None: 
     510        if theta is not None: 
    512511            self.theta = theta 
    513512        x1 = self.radius * numpy.cos(self.theta) 
  • src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py

    r464cd07 r895e7359  
    2323        parameters = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] 
    2424        for index, parameter in enumerate(parameters): 
    25             model.setData(model.index(0, index), 
    26                     QtCore.QVariant(parameter)) 
     25            model.setData(model.index(0, index),parameter) 
    2726        self.widget = BoxSum(None, model=model) 
    2827 
  • src/sas/qtgui/UnitTesting/TestUtils.py

    r092a3d9 r895e7359  
    5454 
    5555    def signal(self, index=None): 
    56         if index == None: 
     56        if index is None: 
    5757            return self._signal 
    5858        else: 
  • src/sas/qtgui/Utilities/CategoryInstaller.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    129129 
    130130        serialized_file = None 
    131         if homedir == None: 
     131        if homedir is None: 
    132132            serialized_file = CategoryInstaller.get_user_file() 
    133133        else: 
  • src/sas/qtgui/Utilities/GuiUtils.py

    • Property mode changed from 100755 to 100644
    rb0b09b9 r895e7359  
    239239    """ 
    240240    Adds a checkboxed row named "name" to QStandardItem 
    241     Adds QVariant 'update_data' to that row. 
     241    Adds 'update_data' to that row. 
    242242    """ 
    243243    assert isinstance(item, QtGui.QStandardItem) 
    244     #assert isinstance(update_data, QtCore.QVariant) 
    245     #py_update_data = update_data.toPyObject() 
    246244    py_update_data = update_data 
    247245 
     
    269267    """ 
    270268    Creates a checkboxed QStandardItem named "name" 
    271     Adds QVariant 'update_data' to that row. 
     269    Adds 'update_data' to that row. 
    272270    """ 
    273271    #assert isinstance(update_data, QtCore.QVariant) 
     
    532530    with open(path,'w') as out: 
    533531        has_errors = True 
    534         if data.dy == None or data.dy == []: 
     532        if data.dy is None or data.dy == []: 
    535533            has_errors = False 
    536534        # Sanity check 
     
    552550            if has_errors: 
    553551                if data.dx is not None and data.dx != []: 
    554                     if  data.dx[i] != None: 
     552                    if  data.dx[i] is not None: 
    555553                        out.write("%g  %g  %g  %g\n" % (data.x[i], 
    556554                                                        data.y[i], 
  • src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py

    rf4a1433 r895e7359  
    102102        test_item = QtGui.QStandardItem() 
    103103        test_list = ['aa','11'] 
    104         update_data = QtCore.QVariant(test_list) 
     104        update_data = test_list 
    105105        name = "Black Sabbath" 
    106106 
     
    133133        checkbox_item.setCheckState(QtCore.Qt.Checked) 
    134134        test_item0 = QtGui.QStandardItem() 
    135         test_item0.setData(QtCore.QVariant(test_list0)) 
     135        test_item0.setData(test_list0) 
    136136 
    137137        # Checked item 1 
     
    140140        test_item1.setCheckState(QtCore.Qt.Checked) 
    141141        object_item = QtGui.QStandardItem() 
    142         object_item.setData(QtCore.QVariant(test_list1)) 
     142        object_item.setData(test_list1) 
    143143        test_item1.setChild(0, object_item) 
    144144 
     
    151151        test_item2.setCheckState(QtCore.Qt.Unchecked) 
    152152        object_item = QtGui.QStandardItem() 
    153         object_item.setData(QtCore.QVariant(test_list2)) 
     153        object_item.setData(test_list2) 
    154154        test_item2.setChild(0, object_item) 
    155155        checkbox_item.appendRow(test_item2) 
  • src/sas/sascalc/dataloader/readers/danse_reader.py

    raf3e9f5 r895e7359  
    191191        x_vals = np.tile(x_vals, (size_y, 1)).flatten() 
    192192        y_vals = np.tile(y_vals, (size_x, 1)).T.flatten() 
    193         if (np.all(self.current_dataset.err_data == None) 
     193        if (np.all(self.current_dataset.err_data is None) 
    194194                or np.any(self.current_dataset.err_data <= 0)): 
    195195            new_err_data = np.sqrt(np.abs(self.current_dataset.data)) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py

    r83eb5208 r895e7359  
    147147        new_plot.xtransform = "x" 
    148148        new_plot.ytransform = "y" 
    149         variant_plot = QtCore.QVariant(new_plot) 
    150         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     149        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    151150        self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    152151 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py

    rc416a17 r895e7359  
    126126        data = self.base.data 
    127127        # If we have no data, just return 
    128         if data == None: 
     128        if data is None: 
    129129            return 
    130130        # Averaging 
     
    133133        phimin = -self.left_line.phi + self.main_line.theta 
    134134        phimax = self.left_line.phi + self.main_line.theta 
    135         if nbins == None: 
     135        if nbins is None: 
    136136            nbins = 20 
    137137        sect = SectorQ(r_min=0.0, r_max=radius, 
     
    169169        new_plot.id = "SectorQ" + self.base.data.name 
    170170        new_plot.is_data = True 
    171         variant_plot = QtCore.QVariant(new_plot) 
    172         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     171        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    173172        self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    174173 
     
    356355        if phi != None: 
    357356            self.phi = phi 
    358         if delta == None: 
     357        if delta is None: 
    359358            delta = 0 
    360359        if  right: 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py

    r83eb5208 r895e7359  
    190190        new_plot.id = (self.averager.__name__) + self.base.data.name 
    191191        new_plot.is_data = True 
    192         variant_plot = QtCore.QVariant(new_plot) 
    193         GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
     192        GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 
    194193 
    195194        if self.update_model: 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py

    rc416a17 r895e7359  
    110110        parameters = self.getParams() 
    111111        # Crete/overwrite model items 
    112         self._model.setData(self._model.index(0, 0), 
    113                     QtCore.QVariant(formatNumber(parameters['Height']))) 
    114         self._model.setData(self._model.index(0, 1), 
    115                     QtCore.QVariant(formatNumber(parameters['Width']))) 
    116         self._model.setData(self._model.index(0, 2), 
    117                     QtCore.QVariant(formatNumber(parameters['center_x']))) 
    118         self._model.setData(self._model.index(0, 3), 
    119                     QtCore.QVariant(formatNumber(parameters['center_y']))) 
     112        self._model.setData(self._model.index(0, 0), formatNumber(parameters['Height'])) 
     113        self._model.setData(self._model.index(0, 1), formatNumber(parameters['Width'])) 
     114        self._model.setData(self._model.index(0, 2), formatNumber(parameters['center_x'])) 
     115        self._model.setData(self._model.index(0, 3), formatNumber(parameters['center_y'])) 
    120116 
    121117        self.setReadOnlyParametersFromModel() 
     
    130126        """ 
    131127        parameters = self.getParams() 
    132         self._model.setData(self._model.index(0, 4), 
    133                     QtCore.QVariant(formatNumber(parameters['avg']))) 
    134         self._model.setData(self._model.index(0, 5), 
    135                     QtCore.QVariant(formatNumber(parameters['avg_error']))) 
    136         self._model.setData(self._model.index(0, 6), 
    137                     QtCore.QVariant(formatNumber(parameters['sum']))) 
    138         self._model.setData(self._model.index(0, 7), 
    139                     QtCore.QVariant(formatNumber(parameters['sum_error']))) 
    140         self._model.setData(self._model.index(0, 8), 
    141                     QtCore.QVariant(formatNumber(parameters['num_points']))) 
     128        self._model.setData(self._model.index(0, 4), formatNumber(parameters['avg'])) 
     129        self._model.setData(self._model.index(0, 5), formatNumber(parameters['avg_error'])) 
     130        self._model.setData(self._model.index(0, 6), formatNumber(parameters['sum'])) 
     131        self._model.setData(self._model.index(0, 7), formatNumber(parameters['sum_error'])) 
     132        self._model.setData(self._model.index(0, 8), formatNumber(parameters['num_points'])) 
    142133 
    143134    def setParamsFromModel(self): 
Note: See TracChangeset for help on using the changeset viewer.