Skip to content

Commit c6e43ed

Browse files
committed
Fix to ExperimentalStep
1 parent db056e1 commit c6e43ed

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed
Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
from bam_masterdata.datamodel.object_types import Instrument
1+
from bam_masterdata.datamodel.object_types import ExperimentalStep
22
from bam_masterdata.parsing import AbstractParser
33

44

55
class MasterdataParserExample(AbstractParser):
66
def parse(self, files, collection, logger):
7-
instrument_input = Instrument(
8-
name="Example Input Instrument",
9-
manufacturer="Example Manufacturer",
10-
bam_oe="OE_VP.1",
11-
bam_location_complete="UE_08_0_101",
12-
)
13-
instrument_input_id = collection.add(instrument_input)
14-
instrument_output = Instrument(
15-
name="Example Output Instrument",
16-
manufacturer="Example Manufacturer",
17-
bam_oe="OE_VP.1",
18-
bam_location_complete="UE_08_0_101",
19-
)
20-
instrument_output_id = collection.add(instrument_output)
21-
_ = collection.add_relationship(instrument_input_id, instrument_output_id)
7+
synthesis = ExperimentalStep(name="Synthesis")
8+
synthesis_id = collection.add(synthesis)
9+
measurement = ExperimentalStep(name="Measurement")
10+
measurement_id = collection.add(measurement)
11+
_ = collection.add_relationship(synthesis_id, measurement_id)
2212
logger.info(
23-
"Parsing finished: Added examples input and output instruments and their relation."
13+
"Parsing finished: Added examples synthesis and measurement experimental steps."
2414
)

tests/test_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ def test_parse(self, parser):
99

1010
assert len(collection.attached_objects) == 2
1111
objects = list(collection.attached_objects.values())
12-
assert objects[0].name == "Example Input Instrument"
13-
assert objects[1].name == "Example Output Instrument"
12+
assert objects[0].name == "Synthesis"
13+
assert objects[1].name == "Measurement"
1414
assert len(collection.relationships) == 1

0 commit comments

Comments
 (0)