Skip to content

Commit

Permalink
revert changes addressed in #127
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Jan 16, 2024
1 parent 2ad1c35 commit b18117d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions altamisa/isatab/parse_assay_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def from_stream(cls, study_id: str, input_file: TextIO, filename: Optional[str]
def __init__(self, study_id: str, input_file: TextIO, filename: Optional[str]):
self.study_id = study_id
self.input_file = input_file
self.filename = filename or getattr(input_file, "name", "<no file>")
self._filename = filename or getattr(input_file, "name", "<no file>")
self.unique_rows = set()
self.duplicate_rows = []
self._reader = csv.reader(input_file, delimiter="\t", quotechar='"')
Expand Down Expand Up @@ -849,7 +849,7 @@ def _read_next_line(self):
except StopIteration:
self._line = None
except UnicodeDecodeError as e: # pragma: no cover
msg = f"Invalid encoding of study file '{self.input_file.name}' (use Unicode/UTF-8)."
msg = f"Invalid encoding of study file '{self._filename}' (use Unicode/UTF-8)."
raise ParseIsatabException(msg) from e
return prev_line

Expand All @@ -859,7 +859,7 @@ def read(self):
:returns: Nodes per row of the study file
"""
builder = _StudyRowBuilder(self.header, self.filename, self.study_id)
builder = _StudyRowBuilder(self.header, self._filename, self.study_id)
while True:
line = self._read_next_line()
if line:
Expand Down Expand Up @@ -942,7 +942,7 @@ def __init__(self, study_id: str, assay_id: str, input_file: TextIO, filename: O
self.study_id = study_id
self.assay_id = assay_id
self.input_file = input_file
self.filename = filename or getattr(input_file, "name", "<no file>")
self._filename = filename or getattr(input_file, "name", "<no file>")
self.unique_rows = set()
self.duplicate_rows = []
self._reader = csv.reader(input_file, delimiter="\t", quotechar='"')
Expand Down Expand Up @@ -974,7 +974,7 @@ def _read_next_line(self):
except StopIteration:
self._line = None
except UnicodeDecodeError as e: # pragma: no cover
msg = f"Invalid encoding of assay file '{self.input_file.name}' (use Unicode/UTF-8)."
msg = f"Invalid encoding of assay file '{self._filename}' (use Unicode/UTF-8)."
raise ParseIsatabException(msg) from e
return prev_line

Expand All @@ -984,7 +984,7 @@ def read(self):
:return: Nodes per row of the assay file
"""
builder = _AssayRowBuilder(self.header, self.filename, self.study_id, self.assay_id)
builder = _AssayRowBuilder(self.header, self._filename, self.study_id, self.assay_id)
while True:
line = self._read_next_line()
if line:
Expand Down

0 comments on commit b18117d

Please sign in to comment.