Skip to content

Commit

Permalink
Refactor debug print statements and update error handling in analyzer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed Oct 25, 2024
1 parent 53399c9 commit d17b1e6
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run tests with pytest
run: |
poetry run pytest -s
poetry run pytest --nbval-lax -s
14 changes: 1 addition & 13 deletions chromatopy/tools/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@ def read_agilent(
]
rdl_paths = []

error = "no error"
found_lines = "no found lines"

try:
txt_path = next(directory.rglob("*.txt"))
print("sole path: ", txt_path, flush=True)
Expand All @@ -519,15 +516,12 @@ def read_agilent(
lines = AgilentRDLReader.read_file(str(txt_path))
if lines[0].startswith("┌─────"):
rdl_paths = [str(f.absolute()) for f in directory.rglob("*.txt")]
found_lines = "found lines"
else:
txt_paths = txt_paths
found_lines = "found no lines"
except UnicodeDecodeError:
error = "UnicodeDecodeError"
raise IOError(f"Could not read file '{txt_path}'.")

except StopIteration:
error = "StopIteration"
txt_paths = txt_paths

data = {
Expand All @@ -541,12 +535,6 @@ def read_agilent(
"mode": mode,
}

print("txt_paths: ", txt_paths, flush=True)
print("csv_paths: ", csv_paths, flush=True)
print("rdl_paths: ", rdl_paths, flush=True)
print(found_lines, flush=True)
print(error, flush=True)

if rdl_paths:
data["file_paths"] = rdl_paths # type: ignore
reader = AgilentRDLReader(**data)
Expand Down
Loading

0 comments on commit d17b1e6

Please sign in to comment.