Ignore:
Timestamp:
Jun 16, 2017 10:51:12 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
940d034, fca1f50
Parents:
c0ef8da (diff), d9c1551 (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 ticket-510

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/sas_gen.py

    rd1bee3f rf2ea95a  
    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 
     
    9799        :Param volume: pixel volume [float] 
    98100        """ 
    99         if self.data_vol == None: 
     101        if self.data_vol is None: 
    100102            raise 
    101103        self.data_vol = volume 
     
    119121        pos_z = self.data_z 
    120122        len_x = len(pos_x) 
    121         if self.is_avg == None: 
     123        if self.is_avg is None: 
    122124            len_x *= -1 
    123125            pos_x, pos_y, pos_z = transform_center(pos_x, pos_y, pos_z) 
     
    257259        self.sld_n = np.zeros(length) 
    258260 
    259         if omfdata.mx == None: 
     261        if omfdata.mx is None: 
    260262            self.mx = np.zeros(length) 
    261         if omfdata.my == None: 
     263        if omfdata.my is None: 
    262264            self.my = np.zeros(length) 
    263         if omfdata.mz == None: 
     265        if omfdata.mz is None: 
    264266            self.mz = np.zeros(length) 
    265267 
     
    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): 
     
    691693            output.set_pix_type('pixel') 
    692694            output.set_pixel_symbols('pixel') 
    693             if vol_pix != None: 
     695            if vol_pix is not None: 
    694696                output.set_pixel_volumes(vol_pix) 
    695697            return output 
     
    703705        :Param data: MagSLD data object 
    704706        """ 
    705         if path == None: 
     707        if path is None: 
    706708            raise ValueError, "Missing the file path." 
    707         if data == None: 
     709        if data is None: 
    708710            raise ValueError, "Missing the data to save." 
    709711        x_val = data.pos_x 
     
    713715        length = len(x_val) 
    714716        sld_n = data.sld_n 
    715         if sld_n == None: 
     717        if sld_n is None: 
    716718            sld_n = np.zeros(length) 
    717719        sld_mx = data.sld_mx 
    718         if sld_mx == None: 
     720        if sld_mx is None: 
    719721            sld_mx = np.zeros(length) 
    720722            sld_my = np.zeros(length) 
     
    867869        self.sld_theta = None 
    868870        self.pix_symbol = None 
    869         if sld_mx != None and sld_my != None and sld_mz != None: 
     871        if sld_mx is not None and sld_my is not None and sld_mz is not None: 
    870872            self.set_sldms(sld_mx, sld_my, sld_mz) 
    871873        self.set_nodes() 
     
    935937        :Params pixel: str; pixel or atomic symbol, or array of strings 
    936938        """ 
    937         if self.sld_n == None: 
     939        if self.sld_n is None: 
    938940            return 
    939941        if symbol.__class__.__name__ == 'str': 
     
    947949        :Params pixel: str; pixel or atomic symbol, or array of strings 
    948950        """ 
    949         if self.sld_n == None: 
     951        if self.sld_n is None: 
    950952            return 
    951953        if vol.__class__.__name__ == 'ndarray': 
     
    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) 
Note: See TracChangeset for help on using the changeset viewer.