Changeset 5e66738 in sasview for src/sas/qtgui/Perspectives


Ignore:
Timestamp:
Jan 30, 2018 9:20:14 AM (7 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:
14ec91c5
Parents:
da9a0722
Message:

Code review cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/MultiConstraint.py

    re147ce2 r5e66738  
    33""" 
    44import os 
     5import webbrowser 
     6 
     7# numpy methods required for the validator! Don't remove. 
     8# pylint: disable=unused-import,unused-wildcard-import,redefined-builtin 
    59from numpy import * 
    610 
    7 from PyQt5 import QtCore 
    8 from PyQt5 import QtGui 
    911from PyQt5 import QtWidgets 
    10 import webbrowser 
    1112 
    1213import sas.qtgui.Utilities.GuiUtils as GuiUtils 
     
    1617 
    1718class MultiConstraint(QtWidgets.QDialog, Ui_MultiConstraintUI): 
     19    """ 
     20    Logic class for interacting with MultiConstrainedUI view 
     21    """ 
    1822    def __init__(self, parent=None, params=None): 
     23        """ 
     24        parent: ConstraintWidget object 
     25        params: tuple of strings describing model parameters 
     26        """ 
    1927        super(MultiConstraint, self).__init__() 
    2028 
     
    2331        self.setModal(True) 
    2432        self.params = params 
     33        self.parent = parent 
    2534 
    2635        self.setupLabels() 
     
    3746    def revert(self): 
    3847        """ 
    39         switch M1 <-> M2 
     48        Swap parameters in the view 
    4049        """ 
    4150        # Switch parameters 
     
    103112        # 3. parameter name should be a separate word, but can have "()[]*+-/ " around 
    104113        valid_neighbours = "()[]*+-/ " 
    105         has_only_parameter = False 
    106114        start_loc = parameter_string_start -1 
    107115        end_loc = parameter_string_end 
    108         if not any([constraint_text[start_loc] == char for char in valid_neighbours]): 
     116        if not any([constraint_text[start_loc] == ch for ch in valid_neighbours]): 
    109117            return False 
    110118        if end_loc < len(constraint_text): 
    111             if not any([constraint_text[end_loc] == char for char in valid_neighbours]): 
     119            if not any([constraint_text[end_loc] == ch for ch in valid_neighbours]): 
    112120                return False 
    113121 
Note: See TracChangeset for help on using the changeset viewer.