Skip to content

Commit

Permalink
small reworks after feedback
Browse files Browse the repository at this point in the history
- do not return modified ISA-tab, but overwrite attribute
- add to __init__
- not a child class of InvestigationReader
  • Loading branch information
sellth committed Oct 31, 2023
1 parent 2650c0a commit 5897ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions altamisa/isatab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
from .validate_investigation import InvestigationValidator # noqa: F401
from .write_assay_study import AssayWriter, StudyWriter, RefTableBuilder # noqa: F401
from .write_investigation import InvestigationWriter # noqa: F401
from .modify_investigation import InvestigationForge # noqa: F401
6 changes: 3 additions & 3 deletions altamisa/isatab/modify_investigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from altamisa.isatab import InvestigationReader


class InvestigationForge(InvestigationReader):
class InvestigationForge():
"""
Provides methods to add assays to an existing investigation.
Expand All @@ -15,6 +15,7 @@ class InvestigationForge(InvestigationReader):

def __init__(self, input_path: str):
i_file = Path(input_path).expanduser().resolve()

with i_file.open("rt") as f:
self.investigation = InvestigationReader.from_stream(f).read()

Expand Down Expand Up @@ -73,5 +74,4 @@ def add_assay(self, input_path: str):
assays += investigation2.studies[0].assays

new_study = attr.evolve(self.investigation.studies[0], protocols=protocols, assays=assays)
modified_inv = attr.evolve(self.investigation, studies=(new_study,))
return modified_inv
self.investigation = attr.evolve(self.investigation, studies=(new_study,))

0 comments on commit 5897ebb

Please sign in to comment.