@@ -44,15 +44,13 @@ def test_x2sys_cross_input_file_output_file(mock_x2sys_home):
44
44
x2sys_init (tag = tag , fmtfile = "xyz" , force = True )
45
45
outfile = os .path .join (tmpdir , "tmp_coe.txt" )
46
46
output = x2sys_cross (
47
- tracks = ["@tut_ship.xyz" ], tag = tag , coe = "i" , outfile = outfile , verbose = "i"
47
+ tracks = ["@tut_ship.xyz" ], tag = tag , coe = "i" , outfile = outfile
48
48
)
49
49
50
50
assert output is None # check that output is None since outfile is set
51
51
assert os .path .exists (path = outfile ) # check that outfile exists at path
52
52
_ = pd .read_csv (outfile , sep = "\t " , header = 2 ) # ensure ASCII text file loads ok
53
53
54
- return output
55
-
56
54
57
55
def test_x2sys_cross_input_file_output_dataframe (mock_x2sys_home ):
58
56
"""
@@ -62,16 +60,14 @@ def test_x2sys_cross_input_file_output_dataframe(mock_x2sys_home):
62
60
with TemporaryDirectory (prefix = "X2SYS" , dir = os .getcwd ()) as tmpdir :
63
61
tag = os .path .basename (tmpdir )
64
62
x2sys_init (tag = tag , fmtfile = "xyz" , force = True )
65
- output = x2sys_cross (tracks = ["@tut_ship.xyz" ], tag = tag , coe = "i" , verbose = "i" )
63
+ output = x2sys_cross (tracks = ["@tut_ship.xyz" ], tag = tag , coe = "i" )
66
64
67
65
assert isinstance (output , pd .DataFrame )
68
66
assert output .shape == (14294 , 12 )
69
67
columns = list (output .columns )
70
68
assert columns [:6 ] == ["x" , "y" , "i_1" , "i_2" , "dist_1" , "dist_2" ]
71
69
assert columns [6 :] == ["head_1" , "head_2" , "vel_1" , "vel_2" , "z_X" , "z_M" ]
72
70
73
- return output
74
-
75
71
76
72
def test_x2sys_cross_input_dataframe_output_dataframe (mock_x2sys_home , tracks ):
77
73
"""
@@ -82,7 +78,7 @@ def test_x2sys_cross_input_dataframe_output_dataframe(mock_x2sys_home, tracks):
82
78
tag = os .path .basename (tmpdir )
83
79
x2sys_init (tag = tag , fmtfile = "xyz" , force = True )
84
80
85
- output = x2sys_cross (tracks = tracks , tag = tag , coe = "i" , verbose = "i" )
81
+ output = x2sys_cross (tracks = tracks , tag = tag , coe = "i" )
86
82
87
83
assert isinstance (output , pd .DataFrame )
88
84
assert output .shape == (14 , 12 )
@@ -92,8 +88,6 @@ def test_x2sys_cross_input_dataframe_output_dataframe(mock_x2sys_home, tracks):
92
88
assert output .dtypes ["i_1" ].type == np .object_
93
89
assert output .dtypes ["i_2" ].type == np .object_
94
90
95
- return output
96
-
97
91
98
92
def test_x2sys_cross_input_two_dataframes (mock_x2sys_home ):
99
93
"""
@@ -120,7 +114,7 @@ def test_x2sys_cross_input_two_dataframes(mock_x2sys_home):
120
114
track ["time" ] = pd .date_range (start = f"2020-{ i } 1-01" , periods = 10 , freq = "ms" )
121
115
tracks .append (track )
122
116
123
- output = x2sys_cross (tracks = tracks , tag = tag , coe = "e" , verbose = "i" )
117
+ output = x2sys_cross (tracks = tracks , tag = tag , coe = "e" )
124
118
125
119
assert isinstance (output , pd .DataFrame )
126
120
assert output .shape == (30 , 12 )
@@ -171,9 +165,7 @@ def test_x2sys_cross_input_two_filenames(mock_x2sys_home):
171
165
) as fname :
172
166
np .savetxt (fname = fname , X = np .random .rand (10 , 3 ))
173
167
174
- output = x2sys_cross (
175
- tracks = ["track_0.xyz" , "track_1.xyz" ], tag = tag , coe = "e" , verbose = "i"
176
- )
168
+ output = x2sys_cross (tracks = ["track_0.xyz" , "track_1.xyz" ], tag = tag , coe = "e" )
177
169
178
170
assert isinstance (output , pd .DataFrame )
179
171
assert output .shape == (24 , 12 )
@@ -182,8 +174,6 @@ def test_x2sys_cross_input_two_filenames(mock_x2sys_home):
182
174
assert columns [6 :] == ["head_1" , "head_2" , "vel_1" , "vel_2" , "z_X" , "z_M" ]
183
175
_ = [os .remove (f"track_{ i } .xyz" ) for i in range (2 )] # cleanup track files
184
176
185
- return output
186
-
187
177
188
178
def test_x2sys_cross_invalid_tracks_input_type (tracks ):
189
179
"""
0 commit comments