Changeset 9a5097c in sasview for test/sasguiframe
- Timestamp:
- Mar 26, 2017 11:33:16 PM (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:
- ed2276f
- Parents:
- 9146ed9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasguiframe/test/utest_manipulations.py
rd85c194 r9a5097c 5 5 6 6 import unittest 7 import numpy, math 7 import math 8 import numpy as np 8 9 from sas.sascalc.dataloader.loader import Loader 9 10 from sas.sasgui.guiframe.dataFitting import Data1D, Data2D … … 52 53 def setUp(self): 53 54 # Create two data sets to play with 54 x_0 = n umpy.ones(5)55 x_0 = np.ones(5) 55 56 for i in range(5): 56 57 x_0[i] = x_0[i]*(i+1.0) 57 58 58 y_0 = 2.0*n umpy.ones(5)59 dy_0 = 0.5*n umpy.ones(5)59 y_0 = 2.0*np.ones(5) 60 dy_0 = 0.5*np.ones(5) 60 61 self.data = Data1D(x_0, y_0, dy=dy_0) 61 62 62 63 x = self.data.x 63 y = n umpy.ones(5)64 dy = n umpy.ones(5)64 y = np.ones(5) 65 dy = np.ones(5) 65 66 self.data2 = Data1D(x, y, dy=dy) 66 67 … … 155 156 def setUp(self): 156 157 # Create two data sets to play with 157 x_0 = 2.0*n umpy.ones(25)158 dx_0 = 0.5*n umpy.ones(25)159 qx_0 = n umpy.arange(25)160 qy_0 = n umpy.arange(25)161 mask_0 = n umpy.zeros(25)162 dqx_0 = n umpy.arange(25)/100163 dqy_0 = n umpy.arange(25)/100164 q_0 = n umpy.sqrt(qx_0 * qx_0 + qy_0 * qy_0)158 x_0 = 2.0*np.ones(25) 159 dx_0 = 0.5*np.ones(25) 160 qx_0 = np.arange(25) 161 qy_0 = np.arange(25) 162 mask_0 = np.zeros(25) 163 dqx_0 = np.arange(25)/100 164 dqy_0 = np.arange(25)/100 165 q_0 = np.sqrt(qx_0 * qx_0 + qy_0 * qy_0) 165 166 self.data = Data2D(image=x_0, err_image=dx_0, qx_data=qx_0, 166 167 qy_data=qy_0, q_data=q_0, mask=mask_0, 167 168 dqx_data=dqx_0, dqy_data=dqy_0) 168 169 169 y = n umpy.ones(25)170 dy = n umpy.ones(25)171 qx = n umpy.arange(25)172 qy = n umpy.arange(25)173 mask = n umpy.zeros(25)174 q = n umpy.sqrt(qx * qx + qy * qy)170 y = np.ones(25) 171 dy = np.ones(25) 172 qx = np.arange(25) 173 qy = np.arange(25) 174 mask = np.zeros(25) 175 q = np.sqrt(qx * qx + qy * qy) 175 176 self.data2 = Data2D(image=y, err_image=dy, qx_data=qx, qy_data=qy, 176 177 q_data=q, mask=mask) … … 182 183 """ 183 184 # There should be 5 entries in the file 184 self.assertEqual(n umpy.size(self.data.data), 25)185 self.assertEqual(np.size(self.data.data), 25) 185 186 186 187 for i in range(25): … … 263 264 def setUp(self): 264 265 # Create two data sets to play with 265 x_0 = 2.0*n umpy.ones(25)266 dx_0 = 0.5*n umpy.ones(25)267 qx_0 = n umpy.arange(25)268 qy_0 = n umpy.arange(25)269 mask_0 = n umpy.zeros(25)270 dqx_0 = n umpy.arange(25)/100271 dqy_0 = n umpy.arange(25)/100272 q_0 = n umpy.sqrt(qx_0 * qx_0 + qy_0 * qy_0)266 x_0 = 2.0*np.ones(25) 267 dx_0 = 0.5*np.ones(25) 268 qx_0 = np.arange(25) 269 qy_0 = np.arange(25) 270 mask_0 = np.zeros(25) 271 dqx_0 = np.arange(25)/100 272 dqy_0 = np.arange(25)/100 273 q_0 = np.sqrt(qx_0 * qx_0 + qy_0 * qy_0) 273 274 self.data = Data2D(image=x_0, err_image=dx_0, qx_data=qx_0, 274 275 qy_data=qy_0, q_data=q_0, mask=mask_0, 275 276 dqx_data=dqx_0, dqy_data=dqy_0) 276 277 277 y = n umpy.ones(25)278 dy = n umpy.ones(25)279 qx = n umpy.arange(25)280 qy = n umpy.arange(25)281 mask = n umpy.zeros(25)282 q = n umpy.sqrt(qx * qx + qy * qy)278 y = np.ones(25) 279 dy = np.ones(25) 280 qx = np.arange(25) 281 qy = np.arange(25) 282 mask = np.zeros(25) 283 q = np.sqrt(qx * qx + qy * qy) 283 284 self.data2 = Data2D(image=y, err_image=dy, qx_data=qx, qy_data=qy, 284 285 q_data=q, mask=mask) … … 290 291 """ 291 292 # There should be 5 entries in the file 292 self.assertEqual(n umpy.size(self.data.data), 25)293 self.assertEqual(np.size(self.data.data), 25) 293 294 294 295 for i in range(25):
Note: See TracChangeset
for help on using the changeset viewer.