@@ -55,7 +55,7 @@ def test_x2sys_cross_input_file_output_file():
55
55
assert output is None # check that output is None since outfile is set
56
56
assert outfile .stat ().st_size > 0 # check that outfile exists at path
57
57
result = pd .read_csv (outfile , sep = "\t " , comment = ">" , header = 2 )
58
- assert result .shape == (14338 , 12 )
58
+ assert result .shape == (14374 , 12 ) if sys . platform == "darwin" else ( 14338 , 12 )
59
59
columns = list (result .columns )
60
60
assert columns [:6 ] == ["# x" , "y" , "i_1" , "i_2" , "dist_1" , "dist_2" ]
61
61
assert columns [6 :] == ["head_1" , "head_2" , "vel_1" , "vel_2" , "z_X" , "z_M" ]
@@ -65,7 +65,7 @@ def test_x2sys_cross_input_file_output_file():
65
65
66
66
@pytest .mark .usefixtures ("mock_x2sys_home" )
67
67
@pytest .mark .xfail (
68
- condition = Version (__gmt_version__ ) < Version ("6.5.0" ) or sys . platform == "darwin" ,
68
+ condition = Version (__gmt_version__ ) < Version ("6.5.0" ),
69
69
reason = "Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8188" ,
70
70
)
71
71
def test_x2sys_cross_input_file_output_dataframe ():
@@ -79,7 +79,7 @@ def test_x2sys_cross_input_file_output_dataframe():
79
79
output = x2sys_cross (tracks = ["@tut_ship.xyz" ], tag = tag , coe = "i" )
80
80
81
81
assert isinstance (output , pd .DataFrame )
82
- assert output .shape == (14338 , 12 )
82
+ assert output .shape == (14374 , 12 ) if sys . platform == "darwin" else ( 14338 , 12 )
83
83
columns = list (output .columns )
84
84
assert columns [:6 ] == ["x" , "y" , "i_1" , "i_2" , "dist_1" , "dist_2" ]
85
85
assert columns [6 :] == ["head_1" , "head_2" , "vel_1" , "vel_2" , "z_X" , "z_M" ]
@@ -243,7 +243,7 @@ def test_x2sys_cross_invalid_tracks_input_type(tracks):
243
243
244
244
@pytest .mark .usefixtures ("mock_x2sys_home" )
245
245
@pytest .mark .xfail (
246
- condition = Version (__gmt_version__ ) < Version ("6.5.0" ) or sys . platform == "darwin" ,
246
+ condition = Version (__gmt_version__ ) < Version ("6.5.0" ),
247
247
reason = "Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8188" ,
248
248
)
249
249
def test_x2sys_cross_region_interpolation_numpoints ():
@@ -264,15 +264,21 @@ def test_x2sys_cross_region_interpolation_numpoints():
264
264
)
265
265
266
266
assert isinstance (output , pd .DataFrame )
267
- assert output .shape == (3882 , 12 )
268
- # Check crossover errors (z_X) and mean value of observables (z_M)
269
- npt .assert_allclose (output .z_X .mean (), - 138.66 , rtol = 1e-4 )
270
- npt .assert_allclose (output .z_M .mean (), - 2896.875915 )
267
+ if sys .platform == "darwin" :
268
+ assert output .shape == (3894 , 12 )
269
+ # Check crossover errors (z_X) and mean value of observables (z_M)
270
+ npt .assert_allclose (output .z_X .mean (), - 138.23215 , rtol = 1e-4 )
271
+ npt .assert_allclose (output .z_M .mean (), - 2897.187545 , rtol = 1e-4 )
272
+ else :
273
+ assert output .shape == (3882 , 12 )
274
+ # Check crossover errors (z_X) and mean value of observables (z_M)
275
+ npt .assert_allclose (output .z_X .mean (), - 138.66 , rtol = 1e-4 )
276
+ npt .assert_allclose (output .z_M .mean (), - 2896.875915 , rtol = 1e-4 )
271
277
272
278
273
279
@pytest .mark .usefixtures ("mock_x2sys_home" )
274
280
@pytest .mark .xfail (
275
- condition = Version (__gmt_version__ ) < Version ("6.5.0" ) or sys . platform == "darwin" ,
281
+ condition = Version (__gmt_version__ ) < Version ("6.5.0" ),
276
282
reason = "Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8188" ,
277
283
)
278
284
def test_x2sys_cross_trackvalues ():
@@ -285,7 +291,12 @@ def test_x2sys_cross_trackvalues():
285
291
output = x2sys_cross (tracks = ["@tut_ship.xyz" ], tag = tag , trackvalues = True )
286
292
287
293
assert isinstance (output , pd .DataFrame )
288
- assert output .shape == (14338 , 12 )
289
- # Check mean of track 1 values (z_1) and track 2 values (z_2)
290
- npt .assert_allclose (output .z_1 .mean (), - 2422.418556 , rtol = 1e-4 )
291
- npt .assert_allclose (output .z_2 .mean (), - 2402.268364 , rtol = 1e-4 )
294
+ if sys .platform == "darwin" :
295
+ assert output .shape == (14374 , 12 )
296
+ # Check mean of track 1 values (z_1) and track 2 values (z_2)
297
+ npt .assert_allclose (output .z_1 .mean (), - 2422.973372 , rtol = 1e-4 )
298
+ npt .assert_allclose (output .z_2 .mean (), - 2402.87476 , rtol = 1e-4 )
299
+ else :
300
+ assert output .shape == (14338 , 12 )
301
+ npt .assert_allclose (output .z_1 .mean (), - 2422.418556 , rtol = 1e-4 )
302
+ npt .assert_allclose (output .z_2 .mean (), - 2402.268364 , rtol = 1e-4 )
0 commit comments