Ignore:
Timestamp:
Nov 9, 2017 8:41:54 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:
cee5c78
Parents:
749b715
git-author:
Piotr Rozyczko <rozyczko@…> (10/26/17 03:13:05)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 08:41:54)
Message:

Initial changes to make SasView? run with python3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plottables.py

    rdc5ef15 rb3e8629  
    239239        selected_color = None 
    240240        selected_plottable = None 
    241         for p in self.plottables.keys(): 
     241        for p in list(self.plottables.keys()): 
    242242            if plottable.id == p.id: 
    243243                selected_plottable = p 
     
    384384 
    385385        """ 
    386         raise NotImplemented, "Not a valid transform" 
     386        raise NotImplemented("Not a valid transform") 
    387387 
    388388    # Related issues 
     
    512512                label_dict[collection[0]] = basename 
    513513            else: 
    514                 for i in xrange(len(collection)): 
     514                for i in range(len(collection)): 
    515515                    label_dict[collection[i]] = "%s %d" % (basename, i) 
    516516        return label_dict 
     
    684684                msg = "Plottable.View: Given x and dx are not" 
    685685                msg += " of the same length" 
    686                 raise ValueError, msg 
     686                raise ValueError(msg) 
    687687            # Check length of y array 
    688688            if not len(y) == len(x): 
    689689                msg = "Plottable.View: Given y " 
    690690                msg += "and x are not of the same length" 
    691                 raise ValueError, msg 
     691                raise ValueError(msg) 
    692692 
    693693            if not dy is None and not len(dy) == 0 and not len(y) == len(dy): 
    694694                msg = "Plottable.View: Given y and dy are not of the same " 
    695695                msg += "length: len(y)=%s, len(dy)=%s" % (len(y), len(dy)) 
    696                 raise ValueError, msg 
     696                raise ValueError(msg) 
    697697            self.x = [] 
    698698            self.y = [] 
     
    729729                msg = "Plottable.View: transformed x " 
    730730                msg += "and y are not of the same length" 
    731                 raise ValueError, msg 
     731                raise ValueError(msg) 
    732732            if has_err_x and not (len(self.x) == len(self.dx)): 
    733733                msg = "Plottable.View: transformed x and dx" 
    734734                msg += " are not of the same length" 
    735                 raise ValueError, msg 
     735                raise ValueError(msg) 
    736736            if has_err_y and not (len(self.y) == len(self.dy)): 
    737737                msg = "Plottable.View: transformed y" 
    738738                msg += " and dy are not of the same length" 
    739                 raise ValueError, msg 
     739                raise ValueError(msg) 
    740740            # Check that negative values are not plot on x and y axis for 
    741741            # log10 transformation 
     
    809809                except: 
    810810                    logging.error("check_data_logX: skipping point x %g", self.x[i]) 
    811                     logging.error(sys.exc_value) 
     811                    logging.error(sys.exc_info()[1]) 
    812812            self.x = tempx 
    813813            self.y = tempy 
     
    839839                except: 
    840840                    logging.error("check_data_logY: skipping point %g", self.y[i]) 
    841                     logging.error(sys.exc_value) 
     841                    logging.error(sys.exc_info()[1]) 
    842842 
    843843            self.x = tempx 
     
    11011101        Plottable.__init__(self) 
    11021102        msg = "Theory1D is no longer supported, please use Data1D and change symbol.\n" 
    1103         raise DeprecationWarning, msg 
     1103        raise DeprecationWarning(msg) 
    11041104 
    11051105class PlottableFit1D(Plottable): 
Note: See TracChangeset for help on using the changeset viewer.