Skip to content

Commit

Permalink
split check for multiple studies
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Oct 31, 2023
1 parent 6ad18e8 commit 3ddd6bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion altamisa/isatab/modify_investigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def __init__(self, input_path: str):
with i_file.open("rt") as f:
self.investigation = InvestigationReader.from_stream(f).read()

if len(self.investigation.studies) != 1:
# TODO: add support for multiple studies
raise IndexError("Only single study investigations are supported.")

@staticmethod
def _join_protocols(x: dict, y: dict) -> dict:
"""
Expand Down Expand Up @@ -58,7 +62,7 @@ def add_assay(self, input_path: str):
with i_file.open("rt") as f:
investigation2 = InvestigationReader.from_stream(f).read()

if len(self.investigation.studies) != 1 or len(investigation2.studies) != 1:
if len(investigation2.studies) != 1:
# TODO: add support for multiple studies
raise IndexError("Only single study investigations are supported.")

Expand Down

0 comments on commit 3ddd6bd

Please sign in to comment.