Skip to content

Commit

Permalink
Refactor debug print statements and improve error handling in analyze…
Browse files Browse the repository at this point in the history
…r.py
  • Loading branch information
haeussma committed Oct 25, 2024
1 parent fc1998c commit d8fb9ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions chromatopy/tools/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,18 +514,18 @@ def read_agilent(
print(f"everything: {directory.rglob('*')}", flush=True)
try:
lines = AgilentRDLReader.read_file(str(txt_path))
print("lines: ", lines, flush=True)
read = "found lines: " + str(lines)
if lines[0].startswith("┌─────"):
rdl_paths = [str(f.absolute()) for f in directory.rglob("*.txt")]
print("rdl paths: ", rdl_paths, flush=True)
found_lines = "found startswith ┌─────"
else:
txt_paths = txt_paths
print("not rdl, txr_paths: ", txt_paths, flush=True)
found_lines = "found no startswith ┌─────"
except UnicodeDecodeError:
print("UnicodeDecodeError", flush=True)
error = "UnicodeDecodeError"
txt_paths = txt_paths
except StopIteration:
print("StopIteration", flush=True)
error = "StopIteration"
txt_paths = txt_paths

data = {
Expand All @@ -542,6 +542,9 @@ def read_agilent(
print("txt_paths: ", txt_paths, flush=True)
print("csv_paths: ", csv_paths, flush=True)
print("rdl_paths: ", rdl_paths, flush=True)
print(read, flush=True)
print(found_lines, flush=True)
print(error, flush=True)

if rdl_paths:
data["file_paths"] = rdl_paths # type: ignore
Expand Down

0 comments on commit d8fb9ef

Please sign in to comment.