Changeset 81b1f4d in sasview for src/sas


Ignore:
Timestamp:
May 16, 2017 6:19:57 AM (7 years ago)
Author:
GitHub <noreply@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
fca1f50, 7132e49
Parents:
2f17d40 (diff), 56a282c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Adam Washington <rprospero@…> (05/16/17 06:19:57)
git-committer:
GitHub <noreply@…> (05/16/17 06:19:57)
Message:

Merge pull request #85 from rprospero/findModels_tidy

Tidy up the _findModels function

The function underwent the following simple improvements

a) renamed to the more pythonic _find_models
b) had an unused parameter removed
c) eliminated shadowing of builtin dir function
d) passed pep8 standards

Location:
src/sas
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/models.py

    ra1b8fee r81b1f4d  
    163163 
    164164 
    165 def _findModels(dir): 
     165def _find_models(): 
    166166    """ 
    167167    Find custom models 
    168168    """ 
    169169    # List of plugin objects 
    170     dir = find_plugins_dir() 
     170    directory = find_plugins_dir() 
    171171    # Go through files in plug-in directory 
    172     if not os.path.isdir(dir): 
    173         msg = "SasView couldn't locate Model plugin folder %r." % dir 
     172    if not os.path.isdir(directory): 
     173        msg = "SasView couldn't locate Model plugin folder %r." % directory 
    174174        logger.warning(msg) 
    175175        return {} 
    176176 
    177     plugin_log("looking for models in: %s" % str(dir)) 
    178     #compile_file(dir)  #always recompile the folder plugin 
    179     logger.info("plugin model dir: %s" % str(dir)) 
     177    plugin_log("looking for models in: %s" % str(directory)) 
     178    # compile_file(directory)  #always recompile the folder plugin 
     179    logger.info("plugin model dir: %s" % str(directory)) 
    180180 
    181181    plugins = {} 
    182     for filename in os.listdir(dir): 
     182    for filename in os.listdir(directory): 
    183183        name, ext = os.path.splitext(filename) 
    184184        if ext == '.py' and not name == '__init__': 
    185             path = os.path.abspath(os.path.join(dir, filename)) 
     185            path = os.path.abspath(os.path.join(directory, filename)) 
    186186            try: 
    187187                model = load_custom_model(path) 
     
    193193                plugin_log(msg) 
    194194                logger.warning("Failed to load plugin %r. See %s for details" 
    195                                 % (path, PLUGIN_LOG)) 
    196              
     195                               % (path, PLUGIN_LOG)) 
     196 
    197197    return plugins 
    198198 
     
    264264        temp = {} 
    265265        if self.is_changed(): 
    266             return  _findModels(dir) 
     266            return  _find_models() 
    267267        logger.info("plugin model : %s" % str(temp)) 
    268268        return temp 
     
    339339        """ 
    340340        self.plugins = [] 
    341         new_plugins = _findModels(dir) 
     341        new_plugins = _find_models() 
    342342        for name, plug in  new_plugins.iteritems(): 
    343343            for stored_name, stored_plug in self.stored_plugins.iteritems(): 
  • src/sas/sascalc/calculator/sas_gen.py

    r7432acb ra1b8fee  
    33SAS generic computation and sld file readers 
    44""" 
     5from __future__ import print_function 
     6 
    57import sas.sascalc.calculator.core.sld2i as mod 
    68from sas.sascalc.calculator.BaseComponent import BaseComponent 
     
    558560                            vol_pix = np.append(vol_pix, vol) 
    559561                        except: 
    560                             print "Error: set the sld of %s to zero"% atom_name 
     562                            print("Error: set the sld of %s to zero"% atom_name) 
    561563                            sld_n = np.append(sld_n, 0.0) 
    562564                        sld_mx = np.append(sld_mx, 0) 
     
    609611        Write 
    610612        """ 
    611         print "Not implemented... " 
     613        print("Not implemented... ") 
    612614 
    613615class SLDReader(object): 
     
    10441046    from mpl_toolkits.mplot3d import Axes3D 
    10451047    current_dir = os.path.abspath(os.path.curdir) 
    1046     print current_dir 
     1048    print(current_dir) 
    10471049    for i in range(6): 
    10481050        current_dir, _ = os.path.split(current_dir) 
  • src/sas/sascalc/data_util/calcthread.py

    r7432acb ra1b8fee  
    44#  \brief Abstract class for defining calculation threads. 
    55# 
     6from __future__ import print_function 
    67 
    78import thread 
     
    295296    """ 
    296297    def __init__(self, n=20000): 
    297         print thread.get_ident() 
     298        print(thread.get_ident()) 
    298299        self.starttime = clock() 
    299300        self.done = False 
     
    307308        self.work2.queue(n) 
    308309        self.work3.queue(n) 
    309         print "Expect updates from Main every second and from thread every 2.5 seconds" 
    310         print "" 
     310        print("Expect updates from Main every second and from thread every 2.5 seconds") 
     311        print("") 
    311312        self.work.ready(.5) 
    312313        while not self.done: 
    313314            sleep(1) 
    314             print "Main thread %d at %.2f" % (thread.get_ident(), 
    315                                               clock() - self.starttime) 
     315            print("Main thread %d at %.2f" % (thread.get_ident(), 
     316                                              clock() - self.starttime)) 
    316317 
    317318    def update(self, i=0): 
    318         print "Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 
    319                                                       clock() - self.starttime) 
     319        print("Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 
     320                                                      clock() - self.starttime)) 
    320321        self.work.ready(2.5) 
    321322 
    322323    def complete(self, total=0.0): 
    323         print "Complete total=%g from thread %d at %.2f" % (total, 
     324        print("Complete total=%g from thread %d at %.2f" % (total, 
    324325                                                    thread.get_ident(), 
    325                                                     clock() - self.starttime) 
     326                                                    clock() - self.starttime)) 
    326327        self.done = True 
  • src/sas/sascalc/data_util/formatnum.py

    r9a5097c ra1b8fee  
    3737formatter.compact flag. 
    3838""" 
    39 from __future__ import division 
     39from __future__ import division, print_function 
    4040 
    4141import math 
  • src/sas/sascalc/data_util/nxsunit.py

    rb699768 r8e9536f  
    136136    sld = { '10^-6 Angstrom^-2': 1e-6, 'Angstrom^-2': 1 } 
    137137    Q = { 'invA': 1, 'invAng': 1, 'invAngstroms': 1, '1/A': 1,  
    138           '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8, 
     138          '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8, '1/m': 1e-10, 
    139139          'nm^-1': 0.1, '1/nm': 0.1, 'n_m^-1': 0.1 } 
    140140 
     
    195195    _check(1,Converter('n_m^-1')(10,'invA')) # 10 nm^-1 = 1 inv Angstroms 
    196196    _check(2,Converter('mm')(2000,'m')) # 2000 mm -> 2 m 
     197    _check(2.011e10,Converter('1/A')(2.011,"1/m")) # 2.011 1/A -> 2.011 * 10^10 1/m 
    197198    _check(0.003,Converter('microseconds')(3,units='ms')) # 3 us -> 0.003 ms 
    198199    _check(45,Converter('nanokelvin')(45))  # 45 nK -> 45 nK 
  • src/sas/sascalc/data_util/qsmearing.py

    r235f514 r8938502  
    6565            raise ValueError('one or more of your dx values are negative, please check the data file!') 
    6666 
    67     if _found_sesans == True: 
    68         #Pre-compute the Hankel matrix (H) 
    69         qmax, qunits = data.sample.zacceptance 
     67    if _found_sesans: 
     68        # Pre-compute the Hankel matrix (H) 
    7069        SElength = Converter(data._xunit)(data.x, "A") 
    71         zaccept = Converter(qunits)(qmax, "1/A"), 
     70 
     71        theta_max = Converter("radians")(data.sample.zacceptance)[0] 
     72        q_max = 2 * np.pi / np.max(data.source.wavelength) * np.sin(theta_max) 
     73        zaccept = Converter("1/A")(q_max, "1/" + data.source.wavelength_unit), 
     74 
    7275        Rmax = 10000000 
    73         hankel = SesansTransform(data.x, SElength, zaccept, Rmax) 
     76        hankel = SesansTransform(data.x, SElength, 
     77                                 data.source.wavelength, 
     78                                 zaccept, Rmax) 
    7479        # Then return the actual transform, as if it were a smearing function 
    7580        return PySmear(hankel, model, offset=0) 
  • src/sas/sascalc/data_util/registry.py

    rb699768 ra1b8fee  
    66and registers the built-in file extensions. 
    77""" 
     8from __future__ import print_function 
    89 
    910import os.path 
  • src/sas/sascalc/dataloader/data_info.py

    r7432acb ra1b8fee  
    1616###################################################################### 
    1717 
     18from __future__ import print_function 
    1819 
    1920#TODO: Keep track of data manipulation in the 'process' data structure. 
  • src/sas/sascalc/dataloader/readers/IgorReader.py

    r959eb01 ra1b8fee  
    1212#copyright 2008, University of Tennessee 
    1313############################################################################# 
     14from __future__ import print_function 
     15 
    1416import os 
    1517 
  • src/sas/sascalc/dataloader/readers/associations.py

    r959eb01 ra1b8fee  
    1414#copyright 2009, University of Tennessee 
    1515############################################################################# 
     16from __future__ import print_function 
     17 
    1618import os 
    1719import sys 
     
    7173                    logger.error(msg) 
    7274    else: 
    73         print "Could not find reader association settings\n  %s [%s]" % (__file__, os.getcwd()) 
     75        print("Could not find reader association settings\n  %s [%s]" % (__file__, os.getcwd())) 
    7476          
    7577          
  • src/sas/sascalc/dataloader/readers/red2d_reader.py

    r959eb01 ra1b8fee  
    99#copyright 2008, University of Tennessee 
    1010###################################################################### 
     11from __future__ import print_function 
     12 
    1113import os 
    1214import numpy as np 
     
    8284        detector = Detector() 
    8385        if len(output.detector) > 0: 
    84             print str(output.detector[0]) 
     86            print(str(output.detector[0])) 
    8587        output.detector.append(detector) 
    8688                 
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    r9a5097c r149b8f6  
    11""" 
    22    SESANS reader (based on ASCII reader) 
    3      
     3 
    44    Reader for .ses or .sesans file format 
    5      
    6     Jurrian Bakker  
     5 
     6    Jurrian Bakker 
    77""" 
    88import numpy as np 
     
    1818_ZERO = 1e-16 
    1919 
     20 
    2021class Reader: 
    2122    """ 
    2223    Class to load sesans files (6 columns). 
    2324    """ 
    24     ## File type 
     25    # File type 
    2526    type_name = "SESANS" 
    26      
    27     ## Wildcards 
     27 
     28    # Wildcards 
    2829    type = ["SESANS files (*.ses)|*.ses", 
    2930            "SESANS files (*..sesans)|*.sesans"] 
    30     ## List of allowed extensions 
     31    # List of allowed extensions 
    3132    ext = ['.ses', '.SES', '.sesans', '.SESANS'] 
    32      
    33     ## Flag to bypass extension check 
     33 
     34    # Flag to bypass extension check 
    3435    allow_all = True 
    35      
     36 
    3637    def read(self, path): 
    37          
    38 #        print "reader triggered" 
    39          
    4038        """ 
    4139        Load data file 
    42          
     40 
    4341        :param path: file path 
    44          
     42 
    4543        :return: SESANSData1D object, or None 
    46          
     44 
    4745        :raise RuntimeError: when the file can't be opened 
    4846        :raise ValueError: when the length of the data vectors are inconsistent 
     
    5149            basename = os.path.basename(path) 
    5250            _, extension = os.path.splitext(basename) 
    53             if self.allow_all or extension.lower() in self.ext: 
    54                 try: 
    55                     # Read in binary mode since GRASP frequently has no-ascii 
    56                     # characters that brakes the open operation 
    57                     input_f = open(path,'rb') 
    58                 except: 
    59                     raise  RuntimeError, "sesans_reader: cannot open %s" % path 
    60                 buff = input_f.read() 
    61                 lines = buff.splitlines() 
    62                 x  = np.zeros(0) 
    63                 y  = np.zeros(0) 
    64                 dy = np.zeros(0) 
    65                 lam  = np.zeros(0) 
    66                 dlam = np.zeros(0) 
    67                 dx = np.zeros(0) 
    68                  
    69                #temp. space to sort data 
    70                 tx  = np.zeros(0) 
    71                 ty  = np.zeros(0) 
    72                 tdy = np.zeros(0) 
    73                 tlam  = np.zeros(0) 
    74                 tdlam = np.zeros(0) 
    75                 tdx = np.zeros(0) 
    76                 output = Data1D(x=x, y=y, lam=lam, dy=dy, dx=dx, dlam=dlam, isSesans=True) 
    77                 self.filename = output.filename = basename 
     51            if not (self.allow_all or extension.lower() in self.ext): 
     52                raise RuntimeError( 
     53                    "{} has an unrecognized file extension".format(path)) 
     54        else: 
     55            raise RuntimeError("{} is not a file".format(path)) 
     56        with open(path, 'r') as input_f: 
     57            line = input_f.readline() 
     58            params = {} 
     59            while not line.startswith("BEGIN_DATA"): 
     60                terms = line.split() 
     61                if len(terms) >= 2: 
     62                    params[terms[0]] = " ".join(terms[1:]) 
     63                line = input_f.readline() 
     64            self.params = params 
    7865 
    79                 paramnames=[] 
    80                 paramvals=[] 
    81                 zvals=[] 
    82                 dzvals=[] 
    83                 lamvals=[] 
    84                 dlamvals=[] 
    85                 Pvals=[] 
    86                 dPvals=[] 
     66            if "FileFormatVersion" not in self.params: 
     67                raise RuntimeError("SES file missing FileFormatVersion") 
     68            if float(self.params["FileFormatVersion"]) >= 2.0: 
     69                raise RuntimeError("SASView only supports SES version 1") 
    8770 
    88                 for line in lines: 
    89                     # Initial try for CSV (split on ,) 
    90                     line=line.strip() 
    91                     toks = line.split('\t') 
    92                     if len(toks)==2: 
    93                         paramnames.append(toks[0]) 
    94                         paramvals.append(toks[1]) 
    95                     if len(toks)>5: 
    96                         zvals.append(toks[0]) 
    97                         dzvals.append(toks[3]) 
    98                         lamvals.append(toks[4]) 
    99                         dlamvals.append(toks[5]) 
    100                         Pvals.append(toks[1]) 
    101                         dPvals.append(toks[2]) 
    102                     else: 
    103                         continue 
     71            if "SpinEchoLength_unit" not in self.params: 
     72                raise RuntimeError("SpinEchoLength has no units") 
     73            if "Wavelength_unit" not in self.params: 
     74                raise RuntimeError("Wavelength has no units") 
     75            if params["SpinEchoLength_unit"] != params["Wavelength_unit"]: 
     76                raise RuntimeError("The spin echo data has rudely used " 
     77                                   "different units for the spin echo length " 
     78                                   "and the wavelength.  While sasview could " 
     79                                   "handle this instance, it is a violation " 
     80                                   "of the file format and will not be " 
     81                                   "handled by other software.") 
    10482 
    105                 x=[] 
    106                 y=[] 
    107                 lam=[] 
    108                 dx=[] 
    109                 dy=[] 
    110                 dlam=[] 
    111                 lam_header = lamvals[0].split() 
    112                 data_conv_z = None 
    113                 default_z_unit = "A" 
    114                 data_conv_P = None 
    115                 default_p_unit = " " # Adjust unit for axis (L^-3) 
    116                 lam_unit = lam_header[1].replace("[","").replace("]","") 
    117                 if lam_unit == 'AA': 
    118                     lam_unit = 'A' 
    119                 varheader=[zvals[0],dzvals[0],lamvals[0],dlamvals[0],Pvals[0],dPvals[0]] 
    120                 valrange=range(1, len(zvals)) 
    121                 for i in valrange: 
    122                     x.append(float(zvals[i])) 
    123                     y.append(float(Pvals[i])) 
    124                     lam.append(float(lamvals[i])) 
    125                     dy.append(float(dPvals[i])) 
    126                     dx.append(float(dzvals[i])) 
    127                     dlam.append(float(dlamvals[i])) 
     83            headers = input_f.readline().split() 
    12884 
    129                 x,y,lam,dy,dx,dlam = [ 
    130                     np.asarray(v, 'double') 
    131                    for v in (x,y,lam,dy,dx,dlam) 
    132                 ] 
     85            self._insist_header(headers, "SpinEchoLength") 
     86            self._insist_header(headers, "Depolarisation") 
     87            self._insist_header(headers, "Depolarisation_error") 
     88            self._insist_header(headers, "Wavelength") 
    13389 
    134                 input_f.close() 
     90            data = np.loadtxt(input_f) 
    13591 
    136                 output.x, output.x_unit = self._unit_conversion(x, lam_unit, default_z_unit) 
    137                 output.y = y 
    138                 output.y_unit = r'\AA^{-2} cm^{-1}'  # output y_unit added 
    139                 output.dx, output.dx_unit = self._unit_conversion(dx, lam_unit, default_z_unit) 
    140                 output.dy = dy 
    141                 output.lam, output.lam_unit = self._unit_conversion(lam, lam_unit, default_z_unit) 
    142                 output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit) 
    143                  
    144                 output.xaxis(r"\rm{z}", output.x_unit) 
    145                 output.yaxis(r"\rm{ln(P)/(t \lambda^2)}", output.y_unit)  # Adjust label to ln P/(lam^2 t), remove lam column refs 
     92            if data.shape[1] != len(headers): 
     93                raise RuntimeError( 
     94                    "File has {} headers, but {} columns".format( 
     95                        len(headers), 
     96                        data.shape[1])) 
    14697 
    147                 # Store loading process information 
    148                 output.meta_data['loader'] = self.type_name 
    149                 #output.sample.thickness = float(paramvals[6]) 
    150                 output.sample.name = paramvals[1] 
    151                 output.sample.ID = paramvals[0] 
    152                 zaccept_unit_split = paramnames[7].split("[") 
    153                 zaccept_unit = zaccept_unit_split[1].replace("]","") 
    154                 if zaccept_unit.strip() == r'\AA^-1' or zaccept_unit.strip() == r'\A^-1': 
    155                     zaccept_unit = "1/A" 
    156                 output.sample.zacceptance=(float(paramvals[7]),zaccept_unit) 
    157                 output.vars = varheader 
     98            if not data.size: 
     99                raise RuntimeError("{} is empty".format(path)) 
     100            x = data[:, headers.index("SpinEchoLength")] 
     101            if "SpinEchoLength_error" in headers: 
     102                dx = data[:, headers.index("SpinEchoLength_error")] 
     103            else: 
     104                dx = x * 0.05 
     105            lam = data[:, headers.index("Wavelength")] 
     106            if "Wavelength_error" in headers: 
     107                dlam = data[:, headers.index("Wavelength_error")] 
     108            else: 
     109                dlam = lam * 0.05 
     110            y = data[:, headers.index("Depolarisation")] 
     111            dy = data[:, headers.index("Depolarisation_error")] 
    158112 
    159                 if len(output.x) < 1: 
    160                     raise RuntimeError, "%s is empty" % path 
    161                 return output 
     113            lam_unit = self._unit_fetch("Wavelength") 
     114            x, x_unit = self._unit_conversion(x, "A", 
     115                                              self._unit_fetch( 
     116                                                  "SpinEchoLength")) 
     117            dx, dx_unit = self._unit_conversion( 
     118                dx, lam_unit, 
     119                self._unit_fetch("SpinEchoLength")) 
     120            dlam, dlam_unit = self._unit_conversion( 
     121                dlam, lam_unit, 
     122                self._unit_fetch("Wavelength")) 
     123            y_unit = self._unit_fetch("Depolarisation") 
    162124 
    163         else: 
    164             raise RuntimeError, "%s is not a file" % path 
    165         return None 
     125            output = Data1D(x=x, y=y, lam=lam, dy=dy, dx=dx, dlam=dlam, 
     126                            isSesans=True) 
    166127 
    167     def _unit_conversion(self, value, value_unit, default_unit): 
    168         if has_converter == True and value_unit != default_unit: 
    169             data_conv_q = Converter(value_unit) 
    170             value = data_conv_q(value, units=default_unit) 
     128            output.y_unit = y_unit 
     129            output.x_unit = x_unit 
     130            output.source.wavelength_unit = lam_unit 
     131            output.source.wavelength = lam 
     132            self.filename = output.filename = basename 
     133            output.xaxis(r"\rm{z}", x_unit) 
     134            # Adjust label to ln P/(lam^2 t), remove lam column refs 
     135            output.yaxis(r"\rm{ln(P)/(t \lambda^2)}", y_unit) 
     136            # Store loading process information 
     137            output.meta_data['loader'] = self.type_name 
     138            output.sample.name = params["Sample"] 
     139            output.sample.ID = params["DataFileTitle"] 
     140            output.sample.thickness = self._unit_conversion( 
     141                float(params["Thickness"]), "cm", 
     142                self._unit_fetch("Thickness"))[0] 
     143 
     144            output.sample.zacceptance = ( 
     145                float(params["Theta_zmax"]), 
     146                self._unit_fetch("Theta_zmax")) 
     147 
     148            output.sample.yacceptance = ( 
     149                float(params["Theta_ymax"]), 
     150                self._unit_fetch("Theta_ymax")) 
     151            return output 
     152 
     153    @staticmethod 
     154    def _insist_header(headers, name): 
     155        if name not in headers: 
     156            raise RuntimeError( 
     157                "Missing {} column in spin echo data".format(name)) 
     158 
     159    @staticmethod 
     160    def _unit_conversion(value, value_unit, default_unit): 
     161        """ 
     162        Performs unit conversion on a measurement. 
     163 
     164        :param value: The magnitude of the measurement 
     165        :param value_unit: a string containing the final desired unit 
     166        :param default_unit: string with the units of the original measurement 
     167        :return: The magnitude of the measurement in the new units 
     168        """ 
     169        # (float, string, string) -> float 
     170        if has_converter and value_unit != default_unit: 
     171            data_conv_q = Converter(default_unit) 
     172            value = data_conv_q(value, units=value_unit) 
    171173            new_unit = default_unit 
    172174        else: 
    173175            new_unit = value_unit 
    174176        return value, new_unit 
     177 
     178    def _unit_fetch(self, unit): 
     179        return self.params[unit+"_unit"] 
  • src/sas/sascalc/fit/AbstractFitEngine.py

    r7432acb ra1b8fee  
     1from __future__ import print_function 
    12 
    23import  copy 
     
    627628        """ 
    628629        """ 
    629         print str(self) 
     630        print(str(self)) 
  • src/sas/sascalc/fit/Loader.py

    rac07a3a ra1b8fee  
     1from __future__ import print_function 
     2 
    13# class Loader  to load any king of file 
    24#import wx 
     
    5456                    self.dx = np.zeros(len(self.x)) 
    5557                except: 
    56                     print "READ ERROR", line 
     58                    print("READ ERROR", line) 
    5759            # Sanity check 
    5860            if not len(self.x) == len(self.dx): 
     
    8082    load = Load() 
    8183    load.set_filename("testdata_line.txt") 
    82     print load.get_filename()  
     84    print(load.get_filename())  
    8385    load.set_values() 
    84     print load.get_values() 
     86    print(load.get_values()) 
    8587     
    8688             
  • src/sas/sascalc/fit/expression.py

    r9a5097c ra1b8fee  
    4343Ideally, this interface will change 
    4444""" 
     45from __future__ import print_function 
     46 
    4547import math 
    4648import re 
  • src/sas/sascalc/pr/fit/AbstractFitEngine.py

    r7432acb ra1b8fee  
     1from __future__ import print_function 
    12 
    23import  copy 
     
    630631        """ 
    631632        """ 
    632         print str(self) 
     633        print(str(self)) 
  • src/sas/sascalc/pr/fit/Loader.py

    rac07a3a ra1b8fee  
     1from __future__ import print_function 
     2 
    13# class Loader  to load any king of file 
    24#import wx 
     
    5456                    self.dx = np.zeros(len(self.x)) 
    5557                except: 
    56                     print "READ ERROR", line 
     58                    print("READ ERROR", line) 
    5759            # Sanity check 
    5860            if not len(self.x) == len(self.dx): 
     
    8082    load = Load() 
    8183    load.set_filename("testdata_line.txt") 
    82     print load.get_filename()  
     84    print(load.get_filename())  
    8385    load.set_values() 
    84     print load.get_values() 
     86    print(load.get_values()) 
    8587     
    8688             
  • src/sas/sascalc/pr/fit/expression.py

    r9a5097c ra1b8fee  
     1from __future__ import print_function 
     2 
    13# This program is public domain 
    24""" 
  • src/sas/sascalc/pr/num_term.py

    r7432acb ra1b8fee  
     1from __future__ import print_function 
     2 
    13import math 
    24import numpy as np 
     
    197199    # Testing estimator 
    198200    est = NTermEstimator(invert) 
    199     print est.num_terms() 
     201    print(est.num_terms()) 
  • src/sas/sascalc/simulation/analmodelpy/tests/signon.py

    rd85c194 r9c3d784  
    1717    from analmodelpy import analmodelpy as analmodelpymodule 
    1818 
    19     print "copyright information:" 
    20     print "   ", analmodelpy.copyright() 
    21     print "   ", analmodelpymodule.copyright() 
     19    print("copyright information:") 
     20    print("   ", analmodelpy.copyright()) 
     21    print("   ", analmodelpymodule.copyright()) 
    2222 
    23     print 
    24     print "module information:" 
    25     print "    file:", analmodelpymodule.__file__ 
    26     print "    doc:", analmodelpymodule.__doc__ 
    27     print "    contents:", dir(analmodelpymodule) 
     23    print() 
     24    print("module information:") 
     25    print("    file:", analmodelpymodule.__file__) 
     26    print("    doc:", analmodelpymodule.__doc__) 
     27    print("    contents:", dir(analmodelpymodule)) 
    2828 
    29     print 
    30     print analmodelpymodule.hello() 
     29    print() 
     30    print(analmodelpymodule.hello()) 
    3131 
    3232# version 
  • src/sas/sascalc/simulation/analmodelpy/tests/testanal_model.py

    rd85c194 ra1b8fee  
    1111#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    1212#  
     13from __future__ import print_function 
     14 
    1315 
    1416if __name__ == "__main__": 
     
    1820    from SASsimulation import geoshapespy 
    1921 
    20     print "copyright information:" 
    21     print "   ", analmodelpymodule.copyright() 
     22    print("copyright information:") 
     23    print("   ", analmodelpymodule.copyright()) 
    2224 
    23     print 
    24     print "module information:" 
    25     print "    file:", analmodelpymodule.__file__ 
    26     print "    doc:", analmodelpymodule.__doc__ 
    27     print "    contents:", dir(analmodelpymodule) 
     25    print() 
     26    print("module information:") 
     27    print("    file:", analmodelpymodule.__file__) 
     28    print("    doc:", analmodelpymodule.__doc__) 
     29    print("    contents:", dir(analmodelpymodule)) 
    2830 
    2931    a = geoshapespy.new_sphere(1.0) 
  • src/sas/sascalc/simulation/geoshapespy/tests/testshapes.py

    rd85c194 ra1b8fee  
    1111#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    1212#  
     13from __future__ import print_function 
     14 
    1315 
    1416if __name__ == "__main__": 
     
    1618    from SASsimulation import geoshapespy 
    1719 
    18     print 
    19     print "module information:" 
    20     print "    file:", geoshapespy.__file__ 
    21     print "    doc:", geoshapespy.__doc__ 
    22     print "    contents:", dir(geoshapespy) 
     20    print() 
     21    print("module information:") 
     22    print("    file:", geoshapespy.__file__) 
     23    print("    doc:", geoshapespy.__doc__) 
     24    print("    contents:", dir(geoshapespy)) 
    2325 
    2426    sp = geoshapespy.new_sphere(10) 
  • src/sas/sascalc/simulation/iqPy/tests/signon.py

    rd85c194 ra1b8fee  
    1111#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    1212#  
     13from __future__ import print_function 
     14 
    1315 
    1416if __name__ == "__main__": 
     
    1719    from iqPy import iqPy as iqPymodule 
    1820 
    19     print "copyright information:" 
    20     print "   ", iqPy.copyright() 
    21     print "   ", iqPymodule.copyright() 
     21    print("copyright information:") 
     22    print("   ", iqPy.copyright()) 
     23    print("   ", iqPymodule.copyright()) 
    2224 
    23     print 
    24     print "module information:" 
    25     print "    file:", iqPymodule.__file__ 
    26     print "    doc:", iqPymodule.__doc__ 
    27     print "    contents:", dir(iqPymodule) 
     25    print() 
     26    print("module information:") 
     27    print("    file:", iqPymodule.__file__) 
     28    print("    doc:", iqPymodule.__doc__) 
     29    print("    contents:", dir(iqPymodule)) 
    2830 
    29     print 
     31    print() 
    3032 
    3133# version 
  • src/sas/sascalc/simulation/iqPy/tests/testiq.py

    rd85c194 r9c3d784  
    1717        iqPy.new_iq(10,0.01,0.4) 
    1818 
    19         print "pass." 
     19        print("pass.") 
    2020 
    2121# version 
  • src/sas/sascalc/simulation/pointsmodelpy/tests/signon.py

    rd85c194 ra1b8fee  
    1111#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    1212#  
     13from __future__ import print_function 
     14 
    1315 
    1416if __name__ == "__main__": 
     
    1719    from pointsmodelpy import pointsmodelpy as pointsmodelpymodule 
    1820 
    19     print "copyright information:" 
    20     print "   ", pointsmodelpy.copyright() 
    21     print "   ", pointsmodelpymodule.copyright() 
     21    print("copyright information:") 
     22    print("   ", pointsmodelpy.copyright()) 
     23    print("   ", pointsmodelpymodule.copyright()) 
    2224 
    23     print 
    24     print "module information:" 
    25     print "    file:", pointsmodelpymodule.__file__ 
    26     print "    doc:", pointsmodelpymodule.__doc__ 
    27     print "    contents:", dir(pointsmodelpymodule) 
     25    print() 
     26    print("module information:") 
     27    print("    file:", pointsmodelpymodule.__file__) 
     28    print("    doc:", pointsmodelpymodule.__doc__) 
     29    print("    contents:", dir(pointsmodelpymodule)) 
    2830 
    29     print 
    30     print pointsmodelpymodule.hello() 
     31    print() 
     32    print(pointsmodelpymodule.hello()) 
    3133 
    3234# version 
  • src/sas/sascalc/simulation/pointsmodelpy/tests/test2dui.py

    r959eb01 ra1b8fee  
    77#  Imports: 
    88#-------------------------------------------------------------------------------- 
     9from __future__ import print_function 
    910 
    1011import wx 
     
    4647 
    4748        data = ImageData(value_grid, index_vals) 
    48         print value_grid, index_vals 
     49        print(value_grid, index_vals) 
    4950         
    5051        # Create the index axes 
  • src/sas/sascalc/simulation/pointsmodelpy/tests/testcomplexmodel.py

    r959eb01 ra1b8fee  
     1from __future__ import print_function 
     2 
    13from sasModeling.pointsmodelpy import pointsmodelpy 
    24from sasModeling.iqPy import iqPy 
    35from sasModeling.geoshapespy import geoshapespy 
     6 
    47 
    58#First testing: a normal case, a lores model holds a sphere 
     
    6164  iqPy.OutputIQ(iqcomplex,"testcomplex2.iq") 
    6265 
    63   print "p(r) is saved in testcomplex2.pr" 
    64   print "I(Q) is saved in testcomplex2.iq" 
    65   print "pass" 
     66  print("p(r) is saved in testcomplex2.pr") 
     67  print("I(Q) is saved in testcomplex2.iq") 
     68  print("pass") 
    6669 
    6770#testing 3, insert one empty pdbmodel and one loresmodel 
     
    8891  iqPy.OutputIQ(iqcomplex,"testcomplex3.iq") 
    8992 
    90   print "p(r) is saved in testcomplex3.pr" 
    91   print "I(Q) is saved in testcomplex3.iq" 
    92   print "pass" 
     93  print("p(r) is saved in testcomplex3.pr") 
     94  print("I(Q) is saved in testcomplex3.iq") 
     95  print("pass") 
    9396 
    9497# Test 2D complex model 
     
    106109    pointsmodelpy.get_complexpoints(complex,vpcomplex); 
    107110  
    108     print pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.1,0.1); 
    109     print pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.01,0.1); 
     111    print(pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.1,0.1)); 
     112    print(pointsmodelpy.get_complex_iq_2D(complex,vpcomplex,0.01,0.1)); 
    110113 
    111114 
  • src/sas/sascalc/simulation/pointsmodelpy/tests/testlores.py

    r959eb01 ra1b8fee  
     1from __future__ import print_function 
     2 
     3 
    14if __name__ == "__main__": 
    25 
     
    1013#    print "   ", pointsmodelpymodule.copyright() 
    1114 
    12     print 
    13     print "module information:" 
    14     print "    file:", pointsmodelpy.__file__ 
    15     print "    doc:", pointsmodelpy.__doc__ 
    16     print "    contents:", dir(pointsmodelpy) 
    17     print "    contents:", dir(geoshapespy) 
     15    print() 
     16    print("module information:") 
     17    print("    file:", pointsmodelpy.__file__) 
     18    print("    doc:", pointsmodelpy.__doc__) 
     19    print("    contents:", dir(pointsmodelpy)) 
     20    print("    contents:", dir(geoshapespy)) 
    1821 
    1922#    a = geoshapespy.new_singlehelix(10,2,30,2) 
     
    4649    pointsmodelpy.outputPDB(lm,vp,"modelpy.pseudo.pdb") 
    4750 
    48     print "calculating distance distribution" 
     51    print("calculating distance distribution") 
    4952    rmax = pointsmodelpy.get_lores_pr(lm,vp) 
    50     print "finish calculating get_lores_pr, and rmax is:", rmax 
     53    print("finish calculating get_lores_pr, and rmax is:", rmax) 
    5154    pointsmodelpy.outputPR(lm,"testlores.pr") 
    5255    pointsmodelpy.get_lores_iq(lm,iq) 
     
    5457    iqPy.OutputIQ(iq, "testlores.iq") 
    5558 
    56     print "Testing get I from a single q" 
     59    print("Testing get I from a single q") 
    5760    result = pointsmodelpy.get_lores_i(lm,0.1) 
    58     print "The I(0.1) is: %s" % str(result)  
     61    print("The I(0.1) is: %s" % str(result))  
    5962 
    6063# version 
  • src/sas/sascalc/simulation/pointsmodelpy/tests/testlores2d.py

    r959eb01 ra1b8fee  
     1from __future__ import print_function 
     2 
     3 
    14def test_lores2d(phi): 
    25  from sasModeling.pointsmodelpy import pointsmodelpy  
     
    4548  value_grid = zeros((100,100),Float) 
    4649  width, height = value_grid.shape 
    47   print width,height 
     50  print(width,height) 
    4851 
    4952  I = pointsmodelpy.calculateI_Qxy(lm,0.00001,0.000002) 
    50   print I 
     53  print(I) 
    5154 
    5255  Imax = 0 
     
    8689  value_grid = zeros((100,100),Float) 
    8790  width, height = value_grid.shape 
    88   print width,height 
     91  print(width,height) 
    8992 
    9093  I = pointsmodelpy.calculateI_Qxy(lm,0.00001,0.000002) 
    91   print I 
     94  print(I) 
    9295 
    9396  Imax = 0 
     
    109112if __name__ == "__main__": 
    110113 
    111   print "start to test lores 2D" 
     114  print("start to test lores 2D") 
    112115#  test_lores2d(10) 
    113116  value_grid = get2d_2() 
    114   print value_grid 
    115   print "pass" 
     117  print(value_grid) 
     118  print("pass") 
  • src/sas/sasgui/guiframe/config.py

    rea45bfe ra1b8fee  
    22    Application settings 
    33""" 
     4from __future__ import print_function 
     5 
    46import time 
    57import os 
     
    150152        :TODO - Need method doc string 
    151153        """ 
    152         print "%g:  %s" % (time.clock(), message) 
     154        print("%g:  %s" % (time.clock(), message)) 
    153155 
    154156        if __EVT_DEBUG_2_FILE__: 
  • src/sas/sasgui/guiframe/data_panel.py

    r959eb01 ra1b8fee  
    1111This module provides Graphic interface for the data_manager module. 
    1212""" 
     13from __future__ import print_function 
     14 
    1315import wx 
    1416from wx.build import build_options 
     
    514516                self.parent.save_data2d(data, default_name) 
    515517            else: 
    516                 print "unable to save this type of data" 
     518                print("unable to save this type of data") 
    517519 
    518520    def layout_data_list(self): 
     
    14971499    except: 
    14981500        # raise 
    1499         print "error", sys.exc_value 
     1501        print("error", sys.exc_value) 
    15001502 
    15011503    app.MainLoop() 
  • src/sas/sasgui/guiframe/data_processor.py

    r7432acb ra1b8fee  
    1818 
    1919""" 
     20from __future__ import print_function 
     21 
    2022import os 
    2123import sys 
     
    20352037        frame.Show(True) 
    20362038    except: 
    2037         print sys.exc_value 
     2039        print(sys.exc_value) 
    20382040 
    20392041    app.MainLoop() 
  • src/sas/sasgui/guiframe/dummyapp.py

    r959eb01 ra1b8fee  
    33Allows the user to set an external data manager 
    44""" 
     5from __future__ import print_function 
     6 
    57import sas.sasgui.guiframe.gui_manager as gui_manager 
    68 
     
    3234        plug_menu.Append(id, '&Do something') 
    3335        def _on_do_something(event): 
    34             print "Do something" 
     36            print("Do something") 
    3537        wx.EVT_MENU(self.parent, id, _on_do_something) 
    3638     
  • src/sas/sasgui/guiframe/gui_manager.py

    r49165488 r2f22db9  
    7777    # clean all these module variables and put them into a config class 
    7878    # that can be passed by sasview.py. 
    79     logger.info(sys.executable) 
    80     logger.info(str(sys.argv)) 
     79    logger.debug(sys.executable) 
     80    logger.debug(str(sys.argv)) 
    8181    from sas import sasview as sasview 
    8282    app_path = os.path.dirname(sasview.__file__) 
    83     logger.info("Using application path: %s", app_path) 
     83    logger.debug("Using application path: %s", app_path) 
    8484    return app_path 
    8585 
     
    109109        if fObj is not None: 
    110110            fObj.close() 
    111     logger.info("GuiManager loaded %s/%s" % (path, file)) 
     111    logger.debug("GuiManager loaded %s/%s" % (path, file)) 
    112112    return config_module 
    113113 
     
    126126        # Didn't find local config, load the default 
    127127        import sas.sasgui.guiframe.config as config 
    128         logger.info("using default local_config") 
     128        logger.debug("using default local_config") 
    129129    else: 
    130         logger.info("found local_config in %s" % os.getcwd()) 
     130        logger.debug("found local_config in %s" % os.getcwd()) 
    131131else: 
    132     logger.info("found local_config in %s" % PATH_APP) 
     132    logger.debug("found local_config in %s" % PATH_APP) 
    133133 
    134134from sas.sasgui.guiframe.customdir import SetupCustom 
     
    139139    if custom_config is None: 
    140140        msgConfig = "Custom_config file was not imported" 
    141         logger.info(msgConfig) 
     141        logger.debug(msgConfig) 
    142142    else: 
    143         logger.info("using custom_config in %s" % os.getcwd()) 
     143        logger.debug("using custom_config in %s" % os.getcwd()) 
    144144else: 
    145     logger.info("using custom_config from %s" % c_conf_dir) 
     145    logger.debug("using custom_config from %s" % c_conf_dir) 
    146146 
    147147# read some constants from config 
     
    21292129                if "SAS_OPENCL" in line: 
    21302130                    if sas_opencl: 
    2131                         new_config_lines.append("SAS_OPENCL = \""+sas_opencl+"\"") 
     2131                        new_config_lines.append("SAS_OPENCL = \"" + sas_opencl 
     2132                                                + "\"\n") 
    21322133                    else: 
    2133                         new_config_lines.append("SAS_OPENCL = None") 
     2134                        new_config_lines.append("SAS_OPENCL = \"None\"\n") 
    21342135                else: 
    21352136                    new_config_lines.append(line) 
     
    21562157        if response is not None: 
    21572158            try: 
    2158                 #  
    21592159                content = response.read().strip() 
    2160                 logger.info("Connected to www.sasview.org. Latest version: %s" 
    2161                              % (content)) 
     2160                logger.info("Connected to www.sasview.org. Latest version: %s", content) 
    21622161                version_info = json.loads(content) 
    21632162            except: 
  • src/sas/sasgui/guiframe/gui_style.py

    r959eb01 ra1b8fee  
    33Provide the style for guiframe 
    44""" 
     5from __future__ import print_function 
     6 
    57import wx 
    68import os 
     
    7981if __name__ == "__main__": 
    8082   
    81     print GUIFRAME.DEFAULT_STYLE 
    82     print GUIFRAME.FLOATING_PANEL 
    83     print GUIFRAME.SINGLE_APPLICATION 
     83    print(GUIFRAME.DEFAULT_STYLE) 
     84    print(GUIFRAME.FLOATING_PANEL) 
     85    print(GUIFRAME.SINGLE_APPLICATION) 
    8486    style = GUIFRAME.MULTIPLE_APPLICATIONS 
    8587    style &= GUIFRAME.PLOTTING_ON 
    86     print style == GUIFRAME.PLOTTING_ON 
     88    print(style == GUIFRAME.PLOTTING_ON) 
    8789    style1 = GUIFRAME.MULTIPLE_APPLICATIONS 
    8890    style1 &= (~GUIFRAME.MANAGER_ON) 
    89     print style1 == GUIFRAME.DEFAULT_STYLE 
    90     print style1 
     91    print(style1 == GUIFRAME.DEFAULT_STYLE) 
     92    print(style1) 
  • src/sas/sasgui/guiframe/proxy.py

    r463e7ffc ra1b8fee  
    11#!/usr/bin/env python 
    22# -*- coding: utf-8 -*- 
     3from __future__ import print_function 
     4 
    35import urllib2 
    46import sys 
     
    157159    response = c.connect() 
    158160    if response is not None: 
    159         print 50 * '-' 
     161        print(50 * '-') 
    160162        content = json.loads(response.read().strip()) 
    161163        pprint(content) 
  • src/sas/sasgui/perspectives/calculator/detector_editor.py

    r959eb01 ra1b8fee  
     1from __future__ import print_function 
    12 
    23import wx 
     
    3435            self.set_values() 
    3536        except: 
    36             print "error", sys.exc_value 
     37            print("error", sys.exc_value) 
    3738 
    3839    def _define_structure(self): 
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    r7432acb ra1b8fee  
    33This module relies on guiframe manager. 
    44""" 
     5from __future__ import print_function 
    56 
    67import wx 
     
    19981999            self.panel.set_volume_ctl_val(str(val)) 
    19992000        except: 
    2000             print "self.panel is not initialized yet" 
     2001            print("self.panel is not initialized yet") 
    20012002 
    20022003    def set_omfpanel_default_shap(self, shape): 
  • src/sas/sasgui/perspectives/calculator/image_viewer.py

    r7432acb ra1b8fee  
     1from __future__ import print_function 
     2 
    13import os 
    24import sys 
     
    7880                wx.PostEvent(parent, StatusEvent(status=err_msg, info="error")) 
    7981            else: 
    80                 print err_msg 
     82                print(err_msg) 
    8183 
    8284    def choose_data_file(self, location=None): 
     
    301303                                                    info="error")) 
    302304            else: 
    303                 print err_msg 
     305                print(err_msg) 
    304306        return flag 
    305307 
     
    332334                                                    info="error")) 
    333335            else: 
    334                 print err_msg 
     336                print(err_msg) 
    335337        return flag 
    336338 
     
    361363                                                    info="error")) 
    362364            else: 
    363                 print err_msg 
     365                print(err_msg) 
    364366 
    365367        self.OnClose(event) 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    r7432acb ra1b8fee  
    2323#copyright 2009, University of Tennessee 
    2424################################################################################ 
     25from __future__ import print_function 
     26 
    2527import wx 
    2628import sys 
     
    871873        # Put the cursor at appropriate position 
    872874        length = len(label) 
    873         print length 
     875        print(length) 
    874876        if label[length-1] == ')': 
    875877            length -= 1 
  • src/sas/sasgui/perspectives/calculator/sld_panel.py

    r7432acb r2d220dd  
    6060        # Object that receive status event 
    6161        self.base = base 
    62         self.wavelength = WAVELENGTH 
     62        self.neutron_wavelength = WAVELENGTH 
     63        self.xray_source_input = WAVELENGTH 
    6364        self.parent = parent 
    6465        #layout attribute 
     
    6768        self.compound = "" 
    6869        self.density = "" 
    69         self.wavelength_ctl = None 
     70        self.neutron_wavelength_ctl = None 
     71        self.xray_source_input_ctl = None 
     72        self.xray_cbox = None 
    7073        self.neutron_sld_real_ctl = None 
    7174        self.neutron_sld_im_ctl = None 
    72         self.mo_ka_sld_real_ctl = None 
    73         self.mo_ka_sld_im_ctl = None 
    74         self.cu_ka_sld_real_ctl = None 
    75         self.cu_ka_sld_im_ctl = None 
     75        self.xray_sld_real_ctl = None 
     76        self.xray_sld_im_ctl = None 
    7677        self.neutron_abs_ctl = None 
    7778        self.neutron_inc_ctl = None 
    7879        self.neutron_length_ctl = None 
    7980        self.button_calculate = None 
     81        self.xray_source = None 
    8082        #Draw the panel 
    8183        self._do_layout() 
    8284        self.SetAutoLayout(True) 
    8385        self.Layout() 
     86        self.fill_xray_cbox() 
    8487 
    8588    def _do_layout(self): 
     
    108111        self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1)) 
    109112        unit_density_txt = wx.StaticText(self, -1, unit_density) 
    110         wavelength_txt = wx.StaticText(self, -1, 'Wavelength ') 
    111         self.wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1)) 
    112         self.wavelength_ctl.SetValue(str(self.wavelength)) 
    113         unit_a_txt = wx.StaticText(self, -1, unit_a) 
     113        neutron_wavelength_txt = wx.StaticText(self, -1, 'Neutron wavelength') 
     114        self.neutron_wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1)) 
     115        self.neutron_wavelength_ctl.SetValue(str(self.neutron_wavelength)) 
     116        self.xray_source_input_txt = wx.StaticText(self, -1, 'X-ray wavelength') 
     117        self.xray_source_input_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1)) 
     118        self.xray_source_input_ctl.SetValue(str(self.xray_source_input)) 
     119        neutron_unit_a_txt = wx.StaticText(self, -1, unit_a) 
     120 
     121        self.xray_cbox = wx.ComboBox(self, -1, size=(70, 20), style=wx.CB_READONLY) 
     122        xray_cbox_tip = "Select an element, wavelength or energy" 
     123        self.xray_cbox.SetToolTipString(xray_cbox_tip) 
     124        wx.EVT_COMBOBOX(self.xray_cbox, -1, self.on_select_xray) 
     125 
    114126        iy = 0 
    115127        ix = 0 
     
    131143        iy += 1 
    132144        ix = 0 
    133         sizer_input.Add(wavelength_txt, (iy, ix), (1, 1), 
    134                              wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    135         ix += 1 
    136         sizer_input.Add(self.wavelength_ctl, (iy, ix), (1, 1), 
    137                             wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    138         ix += 1 
    139         sizer_input.Add(unit_a_txt, (iy, ix), (1, 1), 
     145        sizer_input.Add(neutron_wavelength_txt, (iy, ix), (1, 1), 
     146                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     147        ix += 1 
     148        sizer_input.Add(self.neutron_wavelength_ctl, (iy, ix), (1, 1), 
     149                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     150        ix += 1 
     151        sizer_input.Add(neutron_unit_a_txt, (iy, ix), (1, 1), 
     152                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     153        iy += 1 
     154        ix = 0 
     155        sizer_input.Add(self.xray_source_input_txt, (iy, ix), (1, 1), 
     156                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     157        ix += 1 
     158        sizer_input.Add(self.xray_source_input_ctl, (iy, ix), (1, 1), 
     159                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     160        ix += 1 
     161        sizer_input.Add(self.xray_cbox, (iy, ix), (1, 1), 
    140162                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    141163        boxsizer1.Add(sizer_input) 
     
    151173                                                 size=(_BOX_WIDTH, -1)) 
    152174        self.neutron_sld_real_ctl.SetEditable(False) 
    153         self.neutron_sld_real_ctl.SetToolTipString("Neutron SLD real.") 
     175        self.neutron_sld_real_ctl.SetToolTipString("Neutron SLD real") 
    154176        self.neutron_sld_im_ctl = wx.TextCtrl(self, -1, 
    155177                                              size=(_BOX_WIDTH, -1)) 
    156178        self.neutron_sld_im_ctl.SetEditable(False) 
    157         self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary.") 
     179        self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary") 
    158180        neutron_sld_units_txt = wx.StaticText(self, -1, unit_sld) 
    159181 
    160         cu_ka_sld_txt = wx.StaticText(self, -1, 'Cu Ka SLD') 
    161         self.cu_ka_sld_real_ctl = wx.TextCtrl(self, -1, 
     182        xray_sld_txt = wx.StaticText(self, -1, 'X-ray SLD') 
     183        self.xray_sld_real_ctl = wx.TextCtrl(self, -1, 
    162184                                               size=(_BOX_WIDTH, -1)) 
    163         self.cu_ka_sld_real_ctl.SetEditable(False) 
    164         self.cu_ka_sld_real_ctl.SetToolTipString("Cu Ka SLD real.") 
    165         self.cu_ka_sld_im_ctl = wx.TextCtrl(self, -1, 
     185        self.xray_sld_real_ctl.SetEditable(False) 
     186        self.xray_sld_real_ctl.SetToolTipString("X-ray SLD real") 
     187        self.xray_sld_im_ctl = wx.TextCtrl(self, -1, 
    166188                                            size=(_BOX_WIDTH, -1)) 
    167         self.cu_ka_sld_im_ctl.SetEditable(False) 
    168         self.cu_ka_sld_im_ctl.SetToolTipString("Cu Ka SLD imaginary.") 
    169         cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld) 
    170  
    171         mo_ka_sld_txt = wx.StaticText(self, -1, 'Mo Ka SLD') 
    172         self.mo_ka_sld_real_ctl = wx.TextCtrl(self, -1, 
    173                                                size=(_BOX_WIDTH, -1)) 
    174         self.mo_ka_sld_real_ctl.SetEditable(False) 
    175         self.mo_ka_sld_real_ctl.SetToolTipString("Mo Ka SLD real.") 
    176         self.mo_ka_sld_im_ctl = wx.TextCtrl(self, -1, 
    177                                              size=(_BOX_WIDTH, -1)) 
    178         self.mo_ka_sld_im_ctl.SetEditable(False) 
    179         self.mo_ka_sld_im_ctl.SetToolTipString("Mo Ka SLD imaginary.") 
    180         mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld) 
     189        self.xray_sld_im_ctl.SetEditable(False) 
     190        self.xray_sld_im_ctl.SetToolTipString("X-ray SLD imaginary") 
     191        xray_sld_units_txt = wx.StaticText(self, -1, unit_sld) 
    181192 
    182193        neutron_inc_txt = wx.StaticText(self, -1, 'Neutron Inc. Xs') 
     
    219230        iy += 1 
    220231        ix = 0 
    221         sizer_output.Add(cu_ka_sld_txt, (iy, ix), (1, 1), 
    222                              wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    223         ix += 1 
    224         sizer_output.Add(self.cu_ka_sld_real_ctl, (iy, ix), (1, 1), 
     232        sizer_output.Add(xray_sld_txt, (iy, ix), (1, 1), 
     233                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     234        ix += 1 
     235        sizer_output.Add(self.xray_sld_real_ctl, (iy, ix), (1, 1), 
    225236                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    226237        ix += 1 
     
    228239                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    229240        ix += 1 
    230         sizer_output.Add(self.cu_ka_sld_im_ctl, 
     241        sizer_output.Add(self.xray_sld_im_ctl, 
    231242                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    232243        ix += 1 
    233         sizer_output.Add(cu_ka_sld_units_txt, 
    234                          (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    235         iy += 1 
    236         ix = 0 
    237         sizer_output.Add(mo_ka_sld_txt, (iy, ix), (1, 1), 
    238                              wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    239         ix += 1 
    240         sizer_output.Add(self.mo_ka_sld_real_ctl, (iy, ix), (1, 1), 
    241                             wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    242         ix += 1 
    243         sizer_output.Add(wx.StaticText(self, -1, i_complex), 
    244                          (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    245         ix += 1 
    246         sizer_output.Add(self.mo_ka_sld_im_ctl, 
    247                          (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    248         ix += 1 
    249         sizer_output.Add(mo_ka_sld_units_txt, 
     244        sizer_output.Add(xray_sld_units_txt, 
    250245                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    251246        iy += 1 
     
    310305        self.SetSizer(vbox) 
    311306 
     307    def fill_xray_cbox(self): 
     308        """ 
     309        fill the x-ray combobox with the sources 
     310        """ 
     311        source_list = ['[A]', '[keV]', 'Element'] 
     312        for source in source_list: 
     313            pos = self.xray_cbox.Append(str(source)) 
     314            self.xray_cbox.SetClientData(pos, str(source.strip())) 
     315        self.xray_cbox.SetSelection(0) 
     316        self.xray_source = source_list[0] 
     317 
     318    def on_select_xray(self, event=None): 
     319        """ 
     320        On Selecting a source 
     321        """ 
     322        item = event.GetEventObject() 
     323        self.xray_source = item.GetValue().strip() 
     324 
     325        if self.xray_source == "[A]": 
     326            self.xray_source_input_txt.SetLabel("X-ray wavelength") 
     327        elif self.xray_source == "[keV]": 
     328            self.xray_source_input_txt.SetLabel("X-ray energy") 
     329        elif self.xray_source == "Element": 
     330            self.xray_source_input_txt.SetLabel("X-ray source") 
     331 
    312332    def on_help(self, event): 
    313333        """ 
     
    363383            msg += "Error for Density value :expect float" 
    364384 
    365         self.wavelength = self.wavelength_ctl.GetValue() 
    366         if str(self.wavelength).lstrip().rstrip() == "": 
    367             self.wavelength = WAVELENGTH 
    368             self.wavelength_ctl.SetValue(str(WAVELENGTH)) 
    369             self.wavelength_ctl.SetBackgroundColour(wx.WHITE) 
    370             self.wavelength_ctl.Refresh() 
     385        self.neutron_wavelength = self.neutron_wavelength_ctl.GetValue() 
     386        self.xray_source_input = self.xray_source_input_ctl.GetValue() 
     387 
     388        if str(self.neutron_wavelength).lstrip().rstrip() == "": 
     389            self.neutron_wavelength = WAVELENGTH 
     390            self.neutron_wavelength_ctl.SetValue(str(WAVELENGTH)) 
     391            self.neutron_wavelength_ctl.SetBackgroundColour(wx.WHITE) 
     392            self.neutron_wavelength_ctl.Refresh() 
    371393            msg += "Default value for wavelength is 6.0" 
    372394        else: 
    373             if check_float(self.wavelength_ctl): 
    374                 self.wavelength = float(self.wavelength) 
     395            if check_float(self.neutron_wavelength_ctl): 
     396                self.neutron_wavelength = float(self.neutron_wavelength) 
    375397            else: 
    376398                flag = False 
    377399                msg += "Error for wavelength value :expect float" 
     400 
     401        if str(self.xray_source_input).lstrip().rstrip() == "": 
     402            self.xray_source_input = WAVELENGTH 
     403            self.xray_source_input_ctl.SetValue(str(WAVELENGTH)) 
     404            self.xray_source_input_ctl.SetBackgroundColour(wx.WHITE) 
     405            self.xray_source_input_ctl.Refresh() 
     406            msg += "Default value for wavelength is 6.0" 
     407        else: 
     408            if (self.xray_source == '[A]') or (self.xray_source == '[keV]'): 
     409                if check_float(self.xray_source_input_ctl): 
     410                    self.xray_source_input = float(self.xray_source_input) 
     411                else: 
     412                    flag = False 
     413                    msg += "Error for wavelength value :expect float" 
     414            elif (self.xray_source == 'Element'): 
     415                try: 
     416                    import periodictable 
     417                    exec("periodictable." + self.xray_source_input) 
     418                except AttributeError: 
     419                    flag = False 
     420                    msg += "X-ray element supplied isn't in the database" 
     421 
     422 
    378423 
    379424        self.compound = self.compound_ctl.GetValue().lstrip().rstrip() 
     
    410455        return xray_sld_from_atoms(atom, density=density, energy=energy) 
    411456 
    412  
    413457    def calculateSld(self, event): 
    414458        """ 
     
    430474                        length = neutron_scattering(compound=self.compound, 
    431475                                   density=self.density, 
    432                                    wavelength=self.wavelength) 
    433             cu_real, cu_im = self.calculate_sld_helper(element="Cu", 
    434                                                  density=self.density, 
    435                                         molecule_formula=self.sld_formula) 
    436             mo_real, mo_im = self.calculate_sld_helper(element="Mo", 
    437                                                        density=self.density, 
    438                                      molecule_formula=self.sld_formula) 
     476                                   wavelength=self.neutron_wavelength) 
     477            if self.xray_source == "[A]": 
     478                energy = xray_energy(self.xray_source_input) 
     479                xray_real, xray_im = xray_sld_from_atoms(self.sld_formula.atoms, 
     480                                                         density=self.density, 
     481                                                         energy=energy) 
     482            elif self.xray_source == "[keV]": 
     483                xray_real, xray_im = xray_sld_from_atoms(self.sld_formula.atoms, 
     484                                                         density=self.density, 
     485                                                         energy=self.xray_source_input) 
     486            elif self.xray_source == "Element": 
     487                xray_real, xray_im = self.calculate_sld_helper(element=self.xray_source_input, 
     488                                                               density=self.density, 
     489                                                               molecule_formula=self.sld_formula) 
    439490            # set neutron sld values 
    440491            val = format_number(sld_real * _SCALE) 
     
    443494            self.neutron_sld_im_ctl.SetValue(val) 
    444495            # Compute the Cu SLD 
    445             self.cu_ka_sld_real_ctl.SetValue(format_number(cu_real * _SCALE)) 
    446             val = format_number(math.fabs(cu_im) * _SCALE) 
    447             self.cu_ka_sld_im_ctl.SetValue(val) 
    448             # Compute the Mo SLD 
    449             self.mo_ka_sld_real_ctl.SetValue(format_number(mo_real * _SCALE)) 
    450             val = format_number(math.fabs(mo_im) * _SCALE) 
    451             self.mo_ka_sld_im_ctl.SetValue(val) 
     496            self.xray_sld_real_ctl.SetValue(format_number(xray_real * _SCALE)) 
     497            val = format_number(math.fabs(xray_im) * _SCALE) 
     498            self.xray_sld_im_ctl.SetValue(val) 
    452499            # set incoherence and absorption 
    453500            self.neutron_inc_ctl.SetValue(format_number(incoh)) 
     
    456503            self.neutron_length_ctl.SetValue(format_number(length)) 
    457504            # display wavelength 
    458             self.wavelength_ctl.SetValue(str(self.wavelength)) 
     505            #self.wavelength_ctl.SetValue(str(self.wavelength)) 
     506            #self.wavelength_ctl.SetValue(str(self.wavelength)) 
    459507        except: 
    460508            if self.base is not None: 
     
    470518        self.neutron_sld_real_ctl.SetValue("") 
    471519        self.neutron_sld_im_ctl.SetValue("") 
    472         self.mo_ka_sld_real_ctl.SetValue("") 
    473         self.mo_ka_sld_im_ctl.SetValue("") 
    474         self.cu_ka_sld_real_ctl.SetValue("") 
    475         self.cu_ka_sld_im_ctl.SetValue("") 
     520        self.xray_sld_real_ctl.SetValue("") 
     521        self.xray_sld_im_ctl.SetValue("") 
    476522        self.neutron_abs_ctl.SetValue("") 
    477523        self.neutron_inc_ctl.SetValue("") 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r9c0f3c17 ra1b8fee  
    22Base Page for fitting 
    33""" 
     4from __future__ import print_function 
     5 
    46import sys 
    57import os 
     
    657659        # It seems MAC needs wxCallAfter 
    658660        if event.GetId() == GUIFRAME_ID.COPYEX_ID: 
    659             print "copy excel" 
     661            print("copy excel") 
    660662            wx.CallAfter(self.get_copy_excel) 
    661663        elif event.GetId() == GUIFRAME_ID.COPYLAT_ID: 
    662             print "copy latex" 
     664            print("copy latex") 
    663665            wx.CallAfter(self.get_copy_latex) 
    664666        else: 
     
    33683370        except Exception: 
    33693371            logger.error(traceback.format_exc()) 
    3370             print "Error in BasePage._paste_poly_help: %s" % \ 
    3371                   sys.exc_info()[1] 
     3372            print("Error in BasePage._paste_poly_help: %s" % \ 
     3373                  sys.exc_info()[1]) 
    33723374 
    33733375    def _set_disp_cb(self, isarray, item): 
     
    33983400            Moveit; This method doesn't belong here 
    33993401        """ 
    3400         print "BasicPage.update_pinhole_smear was called: skipping" 
     3402        print("BasicPage.update_pinhole_smear was called: skipping") 
    34013403        return 
    34023404 
     
    35743576        # check model type to show sizer 
    35753577        if self.model is not None: 
    3576             print "_set_model_sizer_selection: disabled." 
     3578            print("_set_model_sizer_selection: disabled.") 
    35773579            # self._set_model_sizer_selection(self.model) 
    35783580 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r7432acb ra1b8fee  
    1111#copyright 2009, University of Tennessee 
    1212################################################################################ 
     13from __future__ import print_function 
     14 
    1315import re 
    1416import sys 
     
    12531255        """ 
    12541256        """ 
    1255         print "update_fit result", result 
     1257        print("update_fit result", result) 
    12561258 
    12571259    def _batch_fit_complete(self, result, pars, page_id, 
     
    20462048            res = (fn - gn) / en 
    20472049        except ValueError: 
    2048             print "Unmatch lengths %s, %s, %s" % (len(fn), len(gn), len(en)) 
     2050            print("Unmatch lengths %s, %s, %s" % (len(fn), len(gn), len(en))) 
    20492051            return 
    20502052 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    r984f3fc r72100ee  
    538538    sin, cos, tan, asin, acos, atan: 
    539539        Trigonometry functions and inverses, operating on radians. 
    540     sinh, cos, tanh, asinh, acosh, atanh: 
     540    sinh, cosh, tanh, asinh, acosh, atanh: 
    541541        Hyperbolic trigonometry functions. 
    542542    atan2(y,x): 
  • src/sas/sasgui/perspectives/pr/pr.py

    r7432acb ra1b8fee  
    1515# Make sure the option of saving each curve is available 
    1616# Use the I(q) curve as input and compare the output to P(r) 
     17from __future__ import print_function 
    1718 
    1819import sys 
     
    230231        out, cov = pr.pr_fit() 
    231232        for i in range(len(out)): 
    232             print "%g +- %g" % (out[i], math.sqrt(cov[i][i])) 
     233            print("%g +- %g" % (out[i], math.sqrt(cov[i][i]))) 
    233234 
    234235        # Show input P(r) 
     
    318319            except: 
    319320                err[i] = 1.0 
    320                 print "Error getting error", value, x[i] 
     321                print("Error getting error", value, x[i]) 
    321322 
    322323        new_plot = Data1D(x, y) 
  • src/sas/sasgui/perspectives/simulation/ShapeParameters.py

    rd85c194 ra1b8fee  
    88copyright 2009, University of Tennessee 
    99""" 
     10from __future__ import print_function 
     11 
    1012import wx 
    1113import sys 
     
    312314            self.parent.GetSizer().Layout() 
    313315        except: 
    314             print "TODO: move the Layout call of editShape up to the caller" 
     316            print("TODO: move the Layout call of editShape up to the caller") 
    315317 
    316318    def _readCtrlFloat(self, ctrl): 
     
    392394                    self.current_shape.params[item[0]] = tmp  
    393395        except: 
    394             print "Could not create" 
    395             print sys.exc_value 
     396            print("Could not create") 
     397            print(sys.exc_value) 
    396398                 
    397399    def _onCreate(self, evt): 
     
    485487        indices = self.shape_listbox.GetSelections() 
    486488        if len(indices)>0: 
    487             print "NOT YET IMPLMENTED" 
    488             print "renaming", self.shape_listbox.GetString(indices[0]) 
    489                  
     489            print("NOT YET IMPLMENTED") 
     490            print("renaming", self.shape_listbox.GetString(indices[0])) 
     491                 
  • src/sas/sasgui/plottools/PlotPanel.py

    r7432acb ra1b8fee  
    22    Plot panel. 
    33""" 
     4from __future__ import print_function 
     5 
    46import logging 
    57import traceback 
     
    3840def show_tree(obj, d=0): 
    3941    """Handy function for displaying a tree of graph objects""" 
    40     print "%s%s" % ("-"*d, obj.__class__.__name__) 
     42    print("%s%s" % ("-"*d, obj.__class__.__name__)) 
    4143    if 'get_children' in dir(obj): 
    4244        for a in obj.get_children(): show_tree(a, d + 1) 
     
    20142016            self.toolbar.copy_figure(self.canvas) 
    20152017        except: 
    2016             print "Error in copy Image" 
     2018            print("Error in copy Image") 
    20172019 
    20182020 
  • src/sas/sasgui/plottools/binder.py

    r463e7ffc ra1b8fee  
    22Extension to MPL to support the binding of artists to key/mouse events. 
    33""" 
     4from __future__ import print_function 
     5 
    46import sys 
    57import logging 
     
    6365            ] 
    6466        except: 
    65             print "bypassing scroll_event: wrong matplotlib version" 
     67            print("bypassing scroll_event: wrong matplotlib version") 
    6668            self._connections = [ 
    6769                canvas.mpl_connect('motion_notify_event', self._onMotion), 
  • src/sas/sasgui/plottools/convert_units.py

    r959eb01 ra1b8fee  
    33    This is a cleaned up version of unitConverter.py 
    44""" 
     5from __future__ import print_function 
     6 
    57import re 
    68import string 
     
    6870    unit8 = "m/s^{4}"  #         x^2               (m/s^{4})^{2} 
    6971 
    70     print "this unit1 %s ,its powerer %s , and value %s" % (unit1, 1, convert_unit(1, unit1)) 
    71     print "this unit2 %s ,its powerer %s , and value %s" % (unit2, 1, convert_unit(1, unit2)) 
    72     print "this unit3 %s ,its powerer %s , and value %s" % (unit3, 2, convert_unit(2, unit3)) 
    73     print "this unit4 %s ,its powerer %s , and value %s" % (unit4, -1, convert_unit(-1, unit4)) 
    74     print "this unit5 %s ,its powerer %s , and value %s" % (unit5, 2, convert_unit(2, unit5)) 
    75     print "this unit6 %s ,its powerer %s , and value %s" % (unit6, 2, convert_unit(2, unit6)) 
    76     print "this unit7 %s ,its powerer %s , and value %s" % (unit7, -1, convert_unit(-1, unit7)) 
    77     print "this unit8 %s ,its powerer %s , and value %s" % (unit8, 2, convert_unit(2, unit8)) 
    78     print "this unit9 %s ,its powerer %s , and value %s" % (unit9, 2, convert_unit(2, unit9)) 
     72    print("this unit1 %s ,its powerer %s , and value %s" % (unit1, 1, convert_unit(1, unit1))) 
     73    print("this unit2 %s ,its powerer %s , and value %s" % (unit2, 1, convert_unit(1, unit2))) 
     74    print("this unit3 %s ,its powerer %s , and value %s" % (unit3, 2, convert_unit(2, unit3))) 
     75    print("this unit4 %s ,its powerer %s , and value %s" % (unit4, -1, convert_unit(-1, unit4))) 
     76    print("this unit5 %s ,its powerer %s , and value %s" % (unit5, 2, convert_unit(2, unit5))) 
     77    print("this unit6 %s ,its powerer %s , and value %s" % (unit6, 2, convert_unit(2, unit6))) 
     78    print("this unit7 %s ,its powerer %s , and value %s" % (unit7, -1, convert_unit(-1, unit7))) 
     79    print("this unit8 %s ,its powerer %s , and value %s" % (unit8, 2, convert_unit(2, unit8))) 
     80    print("this unit9 %s ,its powerer %s , and value %s" % (unit9, 2, convert_unit(2, unit9))) 
  • src/sas/sasgui/plottools/fittings.py

    rac07a3a ra1b8fee  
    1414 
    1515""" 
     16from __future__ import print_function 
     17 
    1618from scipy import optimize 
    1719 
     
    106108    chisqr, out, cov = sasfit(line, [cstA, cstB], event.x, y, 0) 
    107109    # print "Output parameters:", out 
    108     print "The right answer is [70.0, 1.0]" 
    109     print chisqr, out, cov 
     110    print("The right answer is [70.0, 1.0]") 
     111    print(chisqr, out, cov) 
  • src/sas/sasgui/plottools/plottable_interactor.py

    r45dffa69 ra1b8fee  
    22    This module allows more interaction with the plot 
    33""" 
     4from __future__ import print_function 
     5 
    46from BaseInteractor import _BaseInteractor 
     7 
    58 
    69class PointInteractor(_BaseInteractor): 
     
    156159 
    157160    def clear(self): 
    158         print "plottable_interactor.clear()" 
     161        print("plottable_interactor.clear()") 
    159162 
    160163    def _on_click(self, evt): 
Note: See TracChangeset for help on using the changeset viewer.