Changeset 914c49d5 in sasview for src/sas


Ignore:
Timestamp:
May 2, 2017 6:05:48 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
8e15dce
Parents:
6e6dd4c (diff), 658dd57 (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.
Message:

Merge branch 'master' into batch_slicer

Location:
src/sas
Files:
1 added
1 deleted
48 edited
1 moved

Legend:

Unmodified
Added
Removed
  • 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/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/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_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/fitting/basepage.py

    rac0578c r914c49d5  
    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/fitting/models.py

    r463e7ffc ra1b8fee  
    22    Utilities to manage models 
    33""" 
     4from __future__ import print_function 
     5 
    46import traceback 
    57import os 
     
    141143        type, value, tb = sys.exc_info() 
    142144        if type is not None and issubclass(type, py_compile.PyCompileError): 
    143             print "Problem with", repr(value) 
     145            print("Problem with", repr(value)) 
    144146            raise type, value, tb 
    145147        return 1 
  • 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): 
  • src/sas/sascalc/dataloader/manipulations.py

    r7432acb r3e5648b  
    430430            z_max = max(data2D.q_data) 
    431431            z_min = min(data2D.q_data) 
    432             x_max = data2D.dqx_data[data2D.q_data[z_max]] 
    433             x_min = data2D.dqx_data[data2D.q_data[z_min]] 
    434             y_max = data2D.dqy_data[data2D.q_data[z_max]] 
    435             y_min = data2D.dqy_data[data2D.q_data[z_min]] 
     432            x_max = data2D.dqx_data[numpy.where(data2D.q_data == z_max)] 
     433            x_min = data2D.dqx_data[numpy.where(data2D.q_data == z_min)] 
     434            y_max = data2D.dqy_data[numpy.where(data2D.q_data == z_max)] 
     435            y_min = data2D.dqy_data[numpy.where(data2D.q_data == z_min)] 
    436436            # Find qdx at q = 0 
    437437            dq_overlap_x = (x_min * z_max - x_max * z_min) / (z_max - z_min) 
     
    785785            z_max = max(data2D.q_data) 
    786786            z_min = min(data2D.q_data) 
    787             x_max = data2D.dqx_data[data2D.q_data[z_max]] 
    788             x_min = data2D.dqx_data[data2D.q_data[z_min]] 
    789             y_max = data2D.dqy_data[data2D.q_data[z_max]] 
    790             y_min = data2D.dqy_data[data2D.q_data[z_min]] 
     787            x_max = data2D.dqx_data[numpy.where(data2D.q_data == z_max)] 
     788            x_min = data2D.dqx_data[numpy.where(data2D.q_data == z_min)] 
     789            y_max = data2D.dqy_data[numpy.where(data2D.q_data == z_max)] 
     790            y_min = data2D.dqy_data[numpy.where(data2D.q_data == z_min)] 
    791791            # Find qdx at q = 0 
    792792            dq_overlap_x = (x_min * z_max - x_max * z_min) / (z_max - z_min) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r7432acb r3e5648b  
    361361                if self.slicer.__class__.__name__ != "BoxSum": 
    362362                    wx_id = ids.next() 
    363                     slicerpop.Append(wx_id, '&Edit Slicer Parameters') 
     363                    name = '&Edit Slicer Parameters and Batch Slicing' 
     364                    slicerpop.Append(wx_id, name) 
    364365                    wx.EVT_MENU(self, wx_id, self._onEditSlicer) 
    365366            slicerpop.AppendSeparator() 
     
    532533 
    533534        """ 
    534         ## Clear current slicer 
     535        # Clear current slicer 
    535536        if self.slicer is not None: 
    536537            self.slicer.clear() 
    537         ## Create a new slicer 
     538        # Create a new slicer 
    538539        self.slicer_z += 1 
    539540        self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 
    540541        self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 
    541542        self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 
    542         ## Draw slicer 
     543        # Draw slicer 
    543544        self.update() 
    544545        self.slicer.update() 
     
    572573        npt = math.floor(npt) 
    573574        from sas.sascalc.dataloader.manipulations import CircularAverage 
    574         ## compute the maximum radius of data2D 
     575        # compute the maximum radius of data2D 
    575576        self.qmax = max(math.fabs(self.data2D.xmax), 
    576577                        math.fabs(self.data2D.xmin)) 
     
    578579                        math.fabs(self.data2D.ymin)) 
    579580        self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 
    580         ##Compute beam width 
     581        # Compute beam width 
    581582        bin_width = (self.qmax + self.qmax) / npt 
    582         ## Create data1D circular average of data2D 
     583        # Create data1D circular average of data2D 
    583584        Circle = CircularAverage(r_min=0, r_max=self.radius, 
    584585                                 bin_width=bin_width) 
     
    599600        new_plot.name = "Circ avg " + self.data2D.name 
    600601        new_plot.source = self.data2D.source 
    601         #new_plot.info = self.data2D.info 
     602        # new_plot.info = self.data2D.info 
    602603        new_plot.interactive = True 
    603604        new_plot.detector = self.data2D.detector 
    604605 
    605         ## If the data file does not tell us what the axes are, just assume... 
     606        # If the data file does not tell us what the axes are, just assume... 
    606607        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
    607608        if hasattr(self.data2D, "scale") and \ 
     
    615616        new_plot.id = "Circ avg " + self.data2D.name 
    616617        new_plot.is_data = True 
    617         self.parent.update_theory(data_id=self.data2D.id, \ 
    618                                        theory=new_plot) 
     618        self.parent.update_theory(data_id=self.data2D.id, theory=new_plot) 
    619619        wx.PostEvent(self.parent, 
    620620                     NewPlotEvent(plot=new_plot, title=new_plot.name)) 
     
    630630        """ 
    631631        if self.slicer is not None: 
    632             from SlicerParameters import SlicerParameterPanel 
     632            from parameters_panel_slicer import SlicerParameterPanel 
    633633            dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 
    634634            dialog.set_slicer(self.slicer.__class__.__name__, 
     
    668668        params = self.slicer.get_params() 
    669669        ## Create a new panel to display results of summation of Data2D 
    670         from slicerpanel import SlicerPanel 
     670        from parameters_panel_boxsum import SlicerPanel 
    671671        win = MDIFrame(self.parent, None, 'None', (100, 200)) 
    672672        new_panel = SlicerPanel(parent=win, id=-1, 
     
    758758        if default_name.count('.') > 0: 
    759759            default_name = default_name.split('.')[0] 
    760         #default_name += "_out" 
    761760        if self.parent is not None: 
    762761            self.parent.show_data2d(data, default_name) 
    763762 
    764763    def modifyGraphAppearance(self, e): 
    765         self.graphApp = graphAppearance(self, 'Modify graph appearance', legend=False) 
     764        self.graphApp = graphAppearance(self, 'Modify graph appearance', 
     765                                        legend=False) 
    766766        self.graphApp.setDefaults(self.grid_on, self.legend_on, 
    767767                                  self.xaxis_label, self.yaxis_label, 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py

    r7432acb r37d461c  
    11import wx 
    22import wx.lib.newevent 
    3 #from copy import deepcopy 
     3from parameters_panel_slicer import SlicerParameterPanel 
    44from sas.sasgui.guiframe.utils import format_number 
    5 from sas.sasgui.guiframe.events import SlicerParameterEvent 
    6 from sas.sasgui.guiframe.events import EVT_SLICER_PARS 
    7 from sas.sasgui.guiframe.events import EVT_SLICER 
     5from sas.sasgui.guiframe.panel_base import PanelBase 
     6from sas.sasgui.guiframe.events import (SlicerParameterEvent, EVT_SLICER_PARS, 
     7                                        EVT_SLICER) 
    88 
    9 from sas.sasgui.guiframe.panel_base import PanelBase 
    109 
    1110class SlicerPanel(wx.Panel, PanelBase): 
     
    1312    Panel class to show the slicer parameters 
    1413    """ 
    15     #TODO: show units 
    16     #TODO: order parameters properly 
    17     ## Internal name for the AUI manager 
     14    # Internal name for the AUI manager 
    1815    window_name = "Slicer panel" 
    19     ## Title to appear on top of the window 
     16    # Title to appear on top of the window 
    2017    window_caption = "Slicer Panel" 
    2118    CENTER_PANE = False 
     
    2522        wx.Panel.__init__(self, parent, id, *args, **kwargs) 
    2623        PanelBase.__init__(self) 
    27         ## Initialization of the class 
     24        # Initialization of the class 
    2825        self.base = base 
    2926        if params is None: 
     
    4441        else: 
    4542            self.set_slicer(type, params) 
    46         ## Bindings 
    47         self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
    48         self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) 
    49  
    50     def onEVT_SLICER(self, event): 
    51         """ 
    52         Process EVT_SLICER events 
    53         When the slicer changes, update the panel 
    54  
    55         :param event: EVT_SLICER event 
    56  
    57         """ 
    58         event.Skip() 
    59         if event.obj_class is None: 
    60             self.set_slicer(None, None) 
    61         else: 
    62             self.set_slicer(event.type, event.params) 
     43        # Bindings 
     44        self.parent.Bind(EVT_SLICER, SlicerParameterPanel.on_evt_slicer) 
     45        self.parent.Bind(EVT_SLICER_PARS, SlicerParameterPanel.on_param_change) 
    6346 
    6447    def set_slicer(self, type, params): 
     
    8467            keys.sort() 
    8568            for item in keys: 
    86                 if not item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]: 
     69                if not item.lower() in ["num_points", "avg", "avg_error", "sum", 
     70                                        "sum_error"]: 
    8771                    n += 1 
    8872                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 
    8973                    self.bck.Add(text, (n - 1, 0), 
    90                                  flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15) 
     74                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
     75                                 border=15) 
    9176                    ctl = wx.TextCtrl(self, -1, size=(80, 20), 
    9277                                      style=wx.TE_PROCESS_ENTER) 
     
    9580                    ctl.SetToolTipString(hint_msg) 
    9681                    ctl.SetValue(str(format_number(params[item]))) 
    97                     self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter) 
    98                     ctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 
    99                     ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter) 
     82                    self.Bind(wx.EVT_TEXT_ENTER, self.on_text_enter) 
     83                    ctl.Bind(wx.EVT_SET_FOCUS, self.on_set_focus) 
     84                    ctl.Bind(wx.EVT_KILL_FOCUS, self.on_text_enter) 
    10085                    self.parameters.append([item, ctl]) 
    101                     self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0) 
     86                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, 
     87                                 border=0) 
    10288            for item in keys: 
    103                 if  item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]: 
     89                if item.lower() in ["num_points", "avg", "avg_error", "sum", 
     90                                    "sum_error"]: 
    10491                    n += 1 
    105                     text = wx.StaticText(self, -1, item + ": ", style=wx.ALIGN_LEFT) 
    106                     self.bck.Add(text, (n - 1, 0), flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
     92                    text = wx.StaticText(self, -1, item + ": ", 
     93                                         style=wx.ALIGN_LEFT) 
     94                    self.bck.Add(text, (n - 1, 0), 
     95                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 
    10796                                 border=15) 
    10897                    ctl = wx.StaticText(self, -1, 
     
    11099                                        style=wx.ALIGN_LEFT) 
    111100                    ctl.SetToolTipString("Result %s" % item) 
    112                     self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0) 
     101                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, 
     102                                 border=0) 
    113103        self.bck.Layout() 
    114104        self.Layout() 
    115         psizer = self.parent.GetSizer() 
    116         if psizer is not None: 
    117             psizer.Layout() 
     105        p_sizer = self.parent.GetSizer() 
     106        if p_sizer is not None: 
     107            p_sizer.Layout() 
    118108 
    119     def onSetFocus(self, evt): 
     109    def on_set_focus(self, evt): 
    120110        """ 
    121111        Highlight the txtcrtl 
     
    126116        # Select the whole control, after this event resolves 
    127117        wx.CallAfter(widget.SetSelection, -1, -1) 
    128         return 
    129118 
    130     def onParamChange(self, evt): 
    131         """ 
    132         Receive and event and reset the text field contained in self.parameters 
    133  
    134         """ 
    135         evt.Skip() 
    136         for item in self.parameters: 
    137             if item[0] in evt.params: 
    138                 item[1].SetValue(format_number(evt.params[item[0]])) 
    139                 item[1].Refresh() 
    140  
    141     def onTextEnter(self, evt): 
     119    def on_text_enter(self, evt): 
    142120        """ 
    143121        Parameters have changed 
     
    149127            try: 
    150128                params[item[0]] = float(item[1].GetValue()) 
    151                 item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
     129                item[1].SetBackgroundColour(wx.SystemSettings_GetColour( 
     130                    wx.SYS_COLOUR_WINDOW)) 
    152131                item[1].Refresh() 
    153132            except: 
     
    155134                item[1].SetBackgroundColour("pink") 
    156135                item[1].Refresh() 
    157  
    158         if has_error == False: 
     136        if not has_error: 
    159137            # Post parameter event 
    160             ## base is guiframe is this case 
     138            # base is guiframe is this case 
    161139            event = SlicerParameterEvent(type=self.type, params=params) 
    162140            wx.PostEvent(self.base, event) 
     
    166144        On Close Event 
    167145        """ 
    168         ID = self.uid 
    169         self.parent.delete_panel(ID) 
     146        uid = self.uid 
     147        self.parent.delete_panel(uid) 
    170148        self.frame.Destroy() 
Note: See TracChangeset for help on using the changeset viewer.