Changeset 9a5097c in sasview for test/sasinvariant
- 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
- Location:
- test/sasinvariant/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasinvariant/test/utest_data_handling.py
rb699768 r9a5097c 9 9 """ 10 10 import unittest 11 import numpy, math 11 import math 12 import numpy as np 12 13 from sas.sascalc.dataloader.loader import Loader 13 14 from sas.sascalc.dataloader.data_info import Data1D … … 20 21 """ 21 22 def setUp(self): 22 x = n umpy.asarray([1.,2.,3.,4.,5.,6.,7.,8.,9.])23 y = n umpy.asarray([1.,2.,3.,4.,5.,6.,7.,8.,9.])23 x = np.asarray([1.,2.,3.,4.,5.,6.,7.,8.,9.]) 24 y = np.asarray([1.,2.,3.,4.,5.,6.,7.,8.,9.]) 24 25 dy = y/10.0 25 26 … … 135 136 136 137 def test_error_treatment(self): 137 x = n umpy.asarray(numpy.asarray([0,1,2,3]))138 y = n umpy.asarray(numpy.asarray([1,1,1,1]))138 x = np.asarray(np.asarray([0,1,2,3])) 139 y = np.asarray(np.asarray([1,1,1,1])) 139 140 140 141 # These are all the values of the dy array that would cause … … 340 341 self.scale = 1.5 341 342 self.rg = 30.0 342 x = n umpy.arange(0.0001, 0.1, 0.0001)343 y = n umpy.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x])343 x = np.arange(0.0001, 0.1, 0.0001) 344 y = np.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x]) 344 345 dy = y*.1 345 346 self.data = Data1D(x=x, y=y, dy=dy) … … 383 384 self.scale = 1.5 384 385 self.m = 3.0 385 x = n umpy.arange(0.0001, 0.1, 0.0001)386 y = n umpy.asarray([self.scale * math.pow(q ,-1.0*self.m) for q in x])386 x = np.arange(0.0001, 0.1, 0.0001) 387 y = np.asarray([self.scale * math.pow(q ,-1.0*self.m) for q in x]) 387 388 dy = y*.1 388 389 self.data = Data1D(x=x, y=y, dy=dy) … … 427 428 that can't be transformed 428 429 """ 429 x = n umpy.asarray(numpy.asarray([0,1,2,3]))430 y = n umpy.asarray(numpy.asarray([1,1,1,1]))430 x = np.asarray(np.asarray([0,1,2,3])) 431 y = np.asarray(np.asarray([1,1,1,1])) 431 432 g = invariant.Guinier() 432 433 data_in = Data1D(x=x, y=y) … … 438 439 439 440 def test_allowed_bins(self): 440 x = n umpy.asarray(numpy.asarray([0,1,2,3]))441 y = n umpy.asarray(numpy.asarray([1,1,1,1]))442 dy = n umpy.asarray(numpy.asarray([1,1,1,1]))441 x = np.asarray(np.asarray([0,1,2,3])) 442 y = np.asarray(np.asarray([1,1,1,1])) 443 dy = np.asarray(np.asarray([1,1,1,1])) 443 444 g = invariant.Guinier() 444 445 data = Data1D(x=x, y=y, dy=dy) … … 465 466 self.scale = 1.5 466 467 self.rg = 30.0 467 x = n umpy.arange(0.0001, 0.1, 0.0001)468 y = n umpy.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x])468 x = np.arange(0.0001, 0.1, 0.0001) 469 y = np.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x]) 469 470 dy = y*.1 470 471 self.data = Data1D(x=x, y=y, dy=dy) … … 513 514 self.scale = 1.5 514 515 self.rg = 30.0 515 x = n umpy.arange(0.0001, 0.1, 0.0001)516 y = n umpy.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x])516 x = np.arange(0.0001, 0.1, 0.0001) 517 y = np.asarray([self.scale * math.exp( -(q*self.rg)**2 / 3.0 ) for q in x]) 517 518 dy = y*.1 518 519 self.data = Data1D(x=x, y=y, dy=dy) … … 600 601 self.scale = 1.5 601 602 self.m = 3.0 602 x = n umpy.arange(0.0001, 0.1, 0.0001)603 y = n umpy.asarray([self.scale * math.pow(q ,-1.0*self.m) for q in x])603 x = np.arange(0.0001, 0.1, 0.0001) 604 y = np.asarray([self.scale * math.pow(q ,-1.0*self.m) for q in x]) 604 605 dy = y*.1 605 606 self.data = Data1D(x=x, y=y, dy=dy) -
test/sasinvariant/test/utest_use_cases.py
rb699768 r9a5097c 5 5 #TODO: there's no test for smeared extrapolation 6 6 import unittest 7 import numpy8 7 from sas.sascalc.dataloader.loader import Loader 9 8
Note: See TracChangeset
for help on using the changeset viewer.