From 387c562ac68000191b841fb18ad2c49b3bc9358a Mon Sep 17 00:00:00 2001 From: Kalev Takkis Date: Thu, 14 Nov 2024 16:34:49 +0000 Subject: [PATCH] fix: correct path for compounds_manual.csv --- viewer/target_loader.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/viewer/target_loader.py b/viewer/target_loader.py index 037d63c2..167ed825 100644 --- a/viewer/target_loader.py +++ b/viewer/target_loader.py @@ -2059,17 +2059,15 @@ def process_bundle(self): ) # import compound identifier file, if present - if ( - Path(upload_dir) - .joinpath("extra_files") - .joinpath(CUSTOM_IDENTIFIER_FILE) - .exists() - ): - self.import_compound_identifiers() + alias_file_path = ( + Path(upload_dir).joinpath("extra_files").joinpath(CUSTOM_IDENTIFIER_FILE) + ) + if alias_file_path.exists(): + self.import_compound_identifiers(alias_file_path) - def import_compound_identifiers(self): + def import_compound_identifiers(self, alias_file_path): try: - df = pd.read_csv(CUSTOM_IDENTIFIER_FILE) + df = pd.read_csv(alias_file_path) except UnicodeDecodeError: self.report.log( logging.ERROR,