From b21099a5a1224eed8a5c14600f7bd15993d866fa Mon Sep 17 00:00:00 2001 From: "Vitor C. Piro" Date: Mon, 25 Jan 2021 18:13:23 +0100 Subject: [PATCH] fix performance iteration with df --- setup.py | 2 +- taxsbp/taxsbp.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 1266924..c846ba0 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(filename): setup( name="taxsbp", - version="1.1.0", + version="1.1.1", url="https://www.github.com/pirovc/taxsbp", license='MIT', diff --git a/taxsbp/taxsbp.py b/taxsbp/taxsbp.py index 0dd50b0..85e11a3 100755 --- a/taxsbp/taxsbp.py +++ b/taxsbp/taxsbp.py @@ -58,7 +58,7 @@ def main(arguments: str=None): parser.add_argument('-u','--update-file', metavar='', dest="update_file", type=str, default="", help="Previously generated clusters to be updated. Output only new sequences") parser.add_argument('-w','--allow-merge', dest="allow_merge", default=False, action='store_true', help="When updating, allow merging of existing bins. Will output the whole set, not only new bins") parser.add_argument('-t','--silent', dest="silent", default=False, action='store_true', help="Do not print warning to STDERR") - parser.add_argument('-v','--version', action='version', version='%(prog)s 1.1.0') + parser.add_argument('-v','--version', action='version', version='%(prog)s 1.1.1') if len(sys.argv)==1: # Print help calling script without parameters parser.print_help() @@ -488,7 +488,7 @@ def file_reader(file_handler): yield line.rstrip().split("\t") def table_reader(table): - for idx,row in table.iterrows(): + for row in table.itertuples(index=False, name=None): yield [*row] def check_specialization_update(update_file, update_table, specialization): @@ -500,8 +500,8 @@ def check_specialization_update(update_file, update_table, specialization): if (n_fields==7 and not specialization) or (n_fields==6 and specialization): print_log("Specialization should match pre-generated bins") - ret = False + if fhand is not None: fhand.close() return ret