From 70f3dc16dfe901bc313f044860be0a5f2adac871 Mon Sep 17 00:00:00 2001 From: Marion Date: Wed, 22 Nov 2023 09:44:52 -0800 Subject: [PATCH] updates based on PR review, thanks @daisieh --- CSVConvert.py | 9 ++++++--- mappings.py | 11 ----------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/CSVConvert.py b/CSVConvert.py index 618bb02..bbbd28d 100644 --- a/CSVConvert.py +++ b/CSVConvert.py @@ -410,11 +410,14 @@ def read_mapping_template(mapping_path): continue joined_line = '' for value in line: - if value == '': + if value.strip() == '': continue else: - joined_line = joined_line + value + ',' - template_lines.append(joined_line.rstrip(',')) + joined_line = joined_line + value.strip() + ',' + if joined_line == '': + continue + else: + template_lines.append(joined_line.rstrip(',')) except FileNotFoundError: sys.exit(f"Mapping template {mapping_path} not found. Ensure your mapping template is in the directory with the" f" manifest.yml and is specified correctly.") diff --git a/mappings.py b/mappings.py index ce93af1..0605931 100644 --- a/mappings.py +++ b/mappings.py @@ -250,17 +250,6 @@ def float(data_values): return None -# This seems like a duplicate of the method above, ok to delete? -# def double(data_values): -# cell = single_val(data_values) -# if cell is None or cell.lower() == "nan": -# return None -# try: -# return float_val(cell) -# except: -# return None - - def ontology_placeholder(data_values): """Placeholder function to make a fake ontology entry.