diff options
author | zsloan | 2022-04-29 18:59:57 +0000 |
---|---|---|
committer | zsloan | 2022-04-29 18:59:57 +0000 |
commit | 588702ebfbdafaa6cefd970aa45beabbda51fe40 (patch) | |
tree | 312a7789ed3e3a8c46eb29db1c8d5d971ae4c3f4 /gn3 | |
parent | 39afc680ea3eac81a2e5fff763c1cd1a51156bb5 (diff) | |
download | genenetwork3-588702ebfbdafaa6cefd970aa45beabbda51fe40.tar.gz |
Get max string length instead when comparing headers
Apparently max(string1, string2) in Python gets the strong that is
highest alphabetically, but I'm pretty sure this line was intenteded
to get the header with the most items (which this commit doesn't fully
address; you could still end up with a situation where some case
attributes were removed while others were added, though that should be
rare)
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/csvcmp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/csvcmp.py b/gn3/csvcmp.py index 24cbee0..87a1610 100644 --- a/gn3/csvcmp.py +++ b/gn3/csvcmp.py @@ -69,8 +69,8 @@ def csv_diff(base_csv, delta_csv, tmp_dir="/tmp") -> dict: if line.startswith("Strain Name,Value,SE,Count"): base_csv_header, delta_csv_header = line, delta_csv_list[i] break - longest_header = max(base_csv_header, delta_csv_header) + longest_header = max(base_csv_header, delta_csv_header, key=lambda x: len(x)) if base_csv_header != delta_csv_header: if longest_header != base_csv_header: base_csv = base_csv.replace( |