@@ -55,8 +55,8 @@ def lowmem_fid_write_readback(dic, data, shape, torder):
5555
5656@attr (speed = 'fast' )
5757def test_1d ():
58- """ reading/writing of 1D Varian file """
59- dic , data = ng .varian .read (DATA_DIR + "agilent_1d" )
58+ """ reading/writing of 1D Varian file """
59+ dic , data = ng .varian .read (os . path . join ( DATA_DIR , "agilent_1d" ) )
6060 assert data .shape == (1500 , )
6161 assert round (data [0 ].real , 2 ) == 91899.24
6262 assert round (data [0 ].imag , 2 ) == - 1964.70
@@ -66,31 +66,31 @@ def test_1d():
6666
6767@attr (speed = 'fast' )
6868def test_2d ():
69- """ reading/writing of 2D Varian file """
70- dic , data = ng .varian .read (DATA_DIR + "agilent_2d" )
71- assert data .shape == (332 , 1500 )
72- assert round (data [0 , 1 ].real , 2 ) == 360.07
69+ """ reading/writing of 2D Varian file """
70+ dic , data = ng .varian .read (os . path . join ( DATA_DIR , "agilent_2d" ) )
71+ assert data .shape == (332 , 1500 )
72+ assert round (data [0 , 1 ].real , 2 ) == 360.07
7373 assert round (data [0 , 1 ].imag , 2 ) == - 223.20
7474 assert round (data [10 , 18 ].real , 2 ) == 17.93
7575 assert round (data [10 , 18 ].imag , 2 ) == - 67.20
7676 write_readback (dic , data )
7777
7878@attr (speed = 'fast' )
7979def test_2d_lowmem ():
80- """ low memory reading/writing of 2D Varian file """
81- dic , data = ng .varian .read_lowmem (DATA_DIR + "agilent_2d" )
82- assert data .shape == (332 , 1500 )
83- assert round (data [0 , 1 ].real , 2 ) == 360.07
80+ """ low memory reading/writing of 2D Varian file """
81+ dic , data = ng .varian .read_lowmem (os . path . join ( DATA_DIR , "agilent_2d" ) )
82+ assert data .shape == (332 , 1500 )
83+ assert round (data [0 , 1 ].real , 2 ) == 360.07
8484 assert round (data [0 , 1 ].imag , 2 ) == - 223.20
8585 assert round (data [10 , 18 ].real , 2 ) == 17.93
8686 assert round (data [10 , 18 ].imag , 2 ) == - 67.20
8787 lowmem_write_readback (dic , data )
8888
8989@attr (speed = 'fast' )
9090def test_2d_tppi ():
91- """ reading/writing of 2D Varian file with TPPI encoding """
92- dic , data = ng .varian .read (DATA_DIR + "agilent_2d_tppi" )
93- assert data .shape == (600 , 1400 )
91+ """ reading/writing of 2D Varian file with TPPI encoding """
92+ dic , data = ng .varian .read (os . path . join ( DATA_DIR , "agilent_2d_tppi" ) )
93+ assert data .shape == (600 , 1400 )
9494 assert round (data [0 , 1 ].real , 2 ) == - 4589.29
9595 assert round (data [0 , 1 ].imag , 2 ) == - 1691.82
9696 assert round (data [10 , 18 ].real , 2 ) == - 166.62
@@ -99,9 +99,10 @@ def test_2d_tppi():
9999
100100@attr (speed = 'fast' )
101101def test_2d_tppi_lowmem ():
102- """ low memory reading/writing of 2D Varian file with TPPI encoding """
103- dic , data = ng .varian .read_lowmem (DATA_DIR + "agilent_2d_tppi" )
104- assert data .shape == (600 , 1400 )
102+ """ low memory reading/writing of 2D Varian file with TPPI encoding """
103+ dic , data = ng .varian .read_lowmem (os .path .join (DATA_DIR ,
104+ "agilent_2d_tppi" ))
105+ assert data .shape == (600 , 1400 )
105106 assert round (data [0 , 1 ].real , 2 ) == - 4589.29
106107 assert round (data [0 , 1 ].imag , 2 ) == - 1691.82
107108 assert round (data [10 , 18 ].real , 2 ) == - 166.62
@@ -110,8 +111,8 @@ def test_2d_tppi_lowmem():
110111
111112@attr (speed = 'slow' )
112113def test_3d ():
113- """ reading/writing of 3D Varian file """
114- dic , data = ng .varian .read (DATA_DIR + "agilent_3d" )
114+ """ reading/writing of 3D Varian file """
115+ dic , data = ng .varian .read (os . path . join ( DATA_DIR , "agilent_3d" ) )
115116 assert data .shape == (128 , 88 , 1250 )
116117 assert round (data [0 , 1 , 2 ].real , 2 ) == 7.98
117118 assert round (data [0 , 1 , 2 ].imag , 2 ) == 33.82
@@ -121,8 +122,8 @@ def test_3d():
121122
122123@attr (speed = 'slow' )
123124def test_3d_lowmem ():
124- """ low memory reading/writing of 3D Varian file """
125- dic , data = ng .varian .read_lowmem (DATA_DIR + "agilent_3d" )
125+ """ low memory reading/writing of 3D Varian file """
126+ dic , data = ng .varian .read_lowmem (os . path . join ( DATA_DIR , "agilent_3d" ))
126127 assert data .shape == (128 , 88 , 1250 )
127128 assert round (data [0 , 1 , 2 ].real , 2 ) == 7.98
128129 assert round (data [0 , 1 , 2 ].imag , 2 ) == 33.82
@@ -132,27 +133,28 @@ def test_3d_lowmem():
132133
133134@attr (speed = 'slow' )
134135def test_4d ():
135- """ reading/writing of 4D Varian fid file """
136+ """ reading/writing of 4D Varian fid file """
136137 # since this is a fake 4D with no procpar we need to explicitly
137138 # provide the shape and trace ordering parameters
138- dic , data = ng .varian .read_fid (DATA_DIR + "agilent_4d/fid" ,
139- shape = (8 , 12 , 16 , 1400 ), torder = 'r' )
139+ dic , data = ng .varian .read_fid (os . path . join ( DATA_DIR , "agilent_4d/fid" ) ,
140+ shape = (8 , 12 , 16 , 1400 ), torder = 'r' )
140141 assert data .shape == (8 , 12 , 16 , 1400 )
141- assert round (data [0 , 1 , 2 , 3 ].real , 2 ) == 395.11
142+ assert round (data [0 , 1 , 2 , 3 ].real , 2 ) == 395.11
142143 assert round (data [0 , 1 , 2 , 3 ].imag , 2 ) == 52.72
143144 assert round (data [3 , 10 , 11 , 18 ].real , 2 ) == 51.81
144145 assert round (data [3 , 10 , 11 , 18 ].imag , 2 ) == 16.01
145146 write_fid_readback (dic , data , (8 , 12 , 16 , 1400 ),'r' )
146147
147148@attr (speed = 'slow' )
148149def test_4d_lowmem ():
149- """ low memory reading/writing of 4D Varian fid file """
150+ """ low memory reading/writing of 4D Varian fid file """
150151 # since this is a fake 4D with no procpar we need to explicitly
151152 # provide the shape and trace ordering parameters
152- dic , data = ng .varian .read_fid_lowmem (DATA_DIR + "agilent_4d/fid" ,
153- shape = (8 , 12 , 16 , 1400 ),torder = 'r' )
153+ dic , data = ng .varian .read_fid_lowmem (
154+ os .path .join (DATA_DIR , "agilent_4d/fid" ),
155+ shape = (8 , 12 , 16 , 1400 ),torder = 'r' )
154156 assert data .shape == (8 , 12 , 16 , 1400 )
155- assert round (data [0 , 1 , 2 , 3 ].real , 2 ) == 395.11
157+ assert round (data [0 , 1 , 2 , 3 ].real , 2 ) == 395.11
156158 assert round (data [0 , 1 , 2 , 3 ].imag , 2 ) == 52.72
157159 assert round (data [3 , 10 , 11 , 18 ].real , 2 ) == 51.81
158160 assert round (data [3 , 10 , 11 , 18 ].imag , 2 ) == 16.01
0 commit comments