File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -399,11 +399,16 @@ if __name__ == "__main__":
399399 out_file_name = f"{ ard_config ['out_csv_filename' ]} .xlsx"
400400 df .to_excel (out_file_name , index = False )
401401 else :
402- # Save as compressed CSV
403- out_file_name = f"{ ard_config ['out_csv_filename' ] + '.gz' if ard_config ['apply_compression' ] else '' } "
404- df .to_csv (
405- out_file_name , index = False , compression = ard_config ["apply_compression" ]
406- )
402+ # Save as compressed CSV if specified
403+ out_file_name = ard_config ["out_csv_filename" ]
404+ compression_type = ard_config ["apply_compression" ]
405+ # Valid compression_type: gzip, zip, null
406+ if compression_type == "gzip" :
407+ out_file_name = out_file_name + ".gz"
408+ elif compression_type == "zip" :
409+ out_file_name = out_file_name + ".zip"
410+
411+ df .to_csv (out_file_name , index = False , compression = compression_type )
407412
408413 if len (failed_to_reduce_alleles ) == 0 :
409414 print ("No Errors" , file = sys .stderr )
You can’t perform that action at this time.
0 commit comments