Changeset 235f514 in sasview for src/sas/sascalc/calculator/sas_gen.py
- Timestamp:
- Apr 9, 2017 5:46:10 AM (8 years ago)
- 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:
- ac07a3a
- Parents:
- 5b2b04d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/sas_gen.py
r9c0f3c17 r235f514 97 97 :Param volume: pixel volume [float] 98 98 """ 99 if self.data_vol ==None:99 if self.data_vol is None: 100 100 raise 101 101 self.data_vol = volume … … 119 119 pos_z = self.data_z 120 120 len_x = len(pos_x) 121 if self.is_avg ==None:121 if self.is_avg is None: 122 122 len_x *= -1 123 123 pos_x, pos_y, pos_z = transform_center(pos_x, pos_y, pos_z) … … 257 257 self.sld_n = np.zeros(length) 258 258 259 if omfdata.mx ==None:259 if omfdata.mx is None: 260 260 self.mx = np.zeros(length) 261 if omfdata.my ==None:261 if omfdata.my is None: 262 262 self.my = np.zeros(length) 263 if omfdata.mz ==None:263 if omfdata.mz is None: 264 264 self.mz = np.zeros(length) 265 265 … … 703 703 :Param data: MagSLD data object 704 704 """ 705 if path ==None:705 if path is None: 706 706 raise ValueError, "Missing the file path." 707 if data ==None:707 if data is None: 708 708 raise ValueError, "Missing the data to save." 709 709 x_val = data.pos_x … … 713 713 length = len(x_val) 714 714 sld_n = data.sld_n 715 if sld_n ==None:715 if sld_n is None: 716 716 sld_n = np.zeros(length) 717 717 sld_mx = data.sld_mx 718 if sld_mx ==None:718 if sld_mx is None: 719 719 sld_mx = np.zeros(length) 720 720 sld_my = np.zeros(length) … … 935 935 :Params pixel: str; pixel or atomic symbol, or array of strings 936 936 """ 937 if self.sld_n ==None:937 if self.sld_n is None: 938 938 return 939 939 if symbol.__class__.__name__ == 'str': … … 947 947 :Params pixel: str; pixel or atomic symbol, or array of strings 948 948 """ 949 if self.sld_n ==None:949 if self.sld_n is None: 950 950 return 951 951 if vol.__class__.__name__ == 'ndarray':
Note: See TracChangeset
for help on using the changeset viewer.