@@ -195,30 +195,30 @@ def x2sys_cross(
195
195
"""
196
196
output_type = validate_output_table_type (output_type , outfile = outfile )
197
197
198
- with Session () as lib :
199
- file_contexts = []
200
- for track in tracks :
201
- kind = data_kind (track )
202
- if kind == "file" :
203
- file_contexts .append (contextlib .nullcontext (track ))
204
- elif kind == "matrix" :
205
- # find suffix (-E) of trackfiles used (e.g. xyz, csv, etc) from
206
- # $X2SYS_HOME/TAGNAME/TAGNAME.tag file
207
- lastline = (
208
- Path (os .environ ["X2SYS_HOME" ], kwargs ["T" ], f"{ kwargs ['T' ]} .tag" )
209
- .read_text (encoding = "utf8" )
210
- .strip ()
211
- .split ("\n " )[- 1 ]
212
- ) # e.g. "-Dxyz -Etsv -I1/1"
213
- for item in sorted (lastline .split ()): # sort list alphabetically
214
- if item .startswith (("-E" , "-D" )): # prefer -Etsv over -Dxyz
215
- suffix = item [2 :] # e.g. tsv (1st choice) or xyz (2nd choice)
216
-
217
- # Save pandas.DataFrame track data to temporary file
218
- file_contexts .append (tempfile_from_dftrack (track = track , suffix = suffix ))
219
- else :
220
- raise GMTInvalidInput (f"Unrecognized data type: { type (track )} " )
198
+ file_contexts = []
199
+ for track in tracks :
200
+ kind = data_kind (track )
201
+ if kind == "file" :
202
+ file_contexts .append (contextlib .nullcontext (track ))
203
+ elif kind == "matrix" :
204
+ # find suffix (-E) of trackfiles used (e.g. xyz, csv, etc) from
205
+ # $X2SYS_HOME/TAGNAME/TAGNAME.tag file
206
+ lastline = (
207
+ Path (os .environ ["X2SYS_HOME" ], kwargs ["T" ], f"{ kwargs ['T' ]} .tag" )
208
+ .read_text (encoding = "utf8" )
209
+ .strip ()
210
+ .split ("\n " )[- 1 ]
211
+ ) # e.g. "-Dxyz -Etsv -I1/1"
212
+ for item in sorted (lastline .split ()): # sort list alphabetically
213
+ if item .startswith (("-E" , "-D" )): # prefer -Etsv over -Dxyz
214
+ suffix = item [2 :] # e.g. tsv (1st choice) or xyz (2nd choice)
215
+
216
+ # Save pandas.DataFrame track data to temporary file
217
+ file_contexts .append (tempfile_from_dftrack (track = track , suffix = suffix ))
218
+ else :
219
+ raise GMTInvalidInput (f"Unrecognized data type: { type (track )} " )
221
220
221
+ with Session () as lib :
222
222
with lib .virtualfile_out (kind = "dataset" , fname = outfile ) as vouttbl :
223
223
with contextlib .ExitStack () as stack :
224
224
fnames = [stack .enter_context (c ) for c in file_contexts ]
0 commit comments