Skip to content

Commit

Permalink
adapt writer & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Feb 1, 2024
1 parent e007d64 commit b15af8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion altamisa/isatab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ class Process:
#: Process date
date: Optional[Union[datetime.date, Literal[""]]]
#: Performer of process
performer: Optional[Tuple[str]]
performer: Optional[Tuple[str, ...]]
#: Tuple of parameters values
parameter_values: Tuple[ParameterValue, ...]
#: Tuple of process comments
Expand Down
4 changes: 3 additions & 1 deletion altamisa/isatab/write_assay_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ def _extract_process(self, node: Process) -> dict:
if node.protocol_ref != TOKEN_UNKNOWN:
attributes[table_headers.PROTOCOL_REF] = node.protocol_ref
if node.performer is not None:
attributes[table_headers.PERFORMER] = node.performer
attributes[table_headers.PERFORMER] = ";".join(
[p.replace(";", "\\;") if p else "" for p in node.performer]
)
if node.date is not None:
attributes[table_headers.DATE] = node.date
for parameter in node.parameter_values:
Expand Down
10 changes: 5 additions & 5 deletions tests/test_parse_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_study_row_reader_small_study(small_investigation_file, small_study_file
None,
None,
date(2018, 2, 2),
"John Doe",
("John Doe",),
(models.ParameterValue("instrument", ["scalpel"], None),),
(),
None,
Expand Down Expand Up @@ -298,7 +298,7 @@ def test_study_row_reader_small_study(small_investigation_file, small_study_file
None,
None,
date(2018, 2, 2),
"John Doe",
("John Doe",),
(models.ParameterValue("instrument", ["scalpel type A", "scalpel type B"], None),),
(),
None,
Expand Down Expand Up @@ -507,7 +507,7 @@ def test_study_reader_small_study(
None,
None,
date(2018, 2, 2),
"John Doe",
("John Doe",),
(models.ParameterValue("instrument", ["scalpel"], None),),
(),
None,
Expand All @@ -522,7 +522,7 @@ def test_study_reader_small_study(
None,
None,
date(2018, 2, 2),
"John Doe",
("John Doe",),
(models.ParameterValue("instrument", ["scalpel type A", "scalpel type B"], None),),
(),
None,
Expand All @@ -537,7 +537,7 @@ def test_study_reader_small_study(
None,
None,
date(2018, 2, 2),
"John Doe",
("John Doe",),
(models.ParameterValue("instrument", ["scalpel"], None),),
(),
None,
Expand Down

0 comments on commit b15af8e

Please sign in to comment.