Skip to content

Commit

Permalink
fixed unicode decode error
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed Oct 25, 2024
1 parent fd170de commit 0dd5cbb
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 204 deletions.
2 changes: 0 additions & 2 deletions chromatopy/readers/agilent_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def read(self) -> list[Measurement]:
'RESULTS.CSV' files {len(self.file_paths)}.
"""

print(self.file_paths)

measurements = []
for path_idx, csv_path in enumerate(self.file_paths):
peaks = self._read_peaks_from_csv(csv_path)
Expand Down
1 change: 0 additions & 1 deletion chromatopy/readers/agilent_rdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def extract_information(lines: list[str]) -> Tuple[list[list[str]], list[str], s
sample_name.append(lines[i + 1])
else:
sample_name.append("")
print("")

if "│Signal:│" in line:
signal = line
Expand Down
9 changes: 6 additions & 3 deletions chromatopy/tools/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,12 @@ def read_agilent(

try:
txt_path = next(directory.rglob("*.txt"))
lines = AgilentRDLReader.read_file(str(txt_path))
if lines[0].startswith("┌─────"):
rdl_paths = [str(f.absolute()) for f in directory.rglob("*.txt")]
try:
lines = AgilentRDLReader.read_file(str(txt_path))
if lines[0].startswith("┌─────"):
rdl_paths = [str(f.absolute()) for f in directory.rglob("*.txt")]
except UnicodeDecodeError:
txt_paths = txt_paths
except StopIteration:
txt_paths = txt_paths

Expand Down
Loading

0 comments on commit 0dd5cbb

Please sign in to comment.