tested and added note to reflect that tar.gz needs to be made into a cmd line option

This commit is contained in:
Tanushree Tunstall 2021-02-12 15:32:16 +00:00
parent 7f75b92553
commit 9c221e6786

View file

@ -82,6 +82,7 @@ def get_results(url_file, host_url, output_dir, outfile_suffix):
out_filename = dynamut_results_dir + '/dynamut_output_' + outfile_suffix + '.csv' out_filename = dynamut_results_dir + '/dynamut_output_' + outfile_suffix + '.csv'
dynamut_results_out_df.to_csv(out_filename, index = False) dynamut_results_out_df.to_csv(out_filename, index = False)
# TODO: add as a cmd option
# Download .tar.gz file # Download .tar.gz file
prediction_number = re.search(r'([0-9]+$)', line).group(0) prediction_number = re.search(r'([0-9]+$)', line).group(0)
tgz_url = f"{host_url}/dynamut/results_file/results_" + prediction_number + '.tar.gz' tgz_url = f"{host_url}/dynamut/results_file/results_" + prediction_number + '.tar.gz'
@ -89,7 +90,7 @@ def get_results(url_file, host_url, output_dir, outfile_suffix):
response_tgz = requests.get(tgz_url, stream = True) response_tgz = requests.get(tgz_url, stream = True)
if response_tgz.status_code == 200: if response_tgz.status_code == 200:
print('\nDownloading tar.gz file:', tgz_url print('\nDownloading tar.gz file:', tgz_url
, '\nSaving file as:', tgz_filename) , '\n\nSaving file as:', tgz_filename)
with open(tgz_filename, 'wb') as f: with open(tgz_filename, 'wb') as f:
f.write(response_tgz.raw.read()) f.write(response_tgz.raw.read())