|
1 | | -from bam_masterdata.datamodel.object_types import Instrument, Storage |
| 1 | +from bam_masterdata.datamodel.object_types import Instrument |
2 | 2 | from bam_masterdata.parsing import AbstractParser |
3 | 3 |
|
4 | 4 |
|
5 | 5 | class MasterdataParserExample(AbstractParser): |
6 | 6 | def parse(self, files, collection, logger): |
7 | | - storage = Storage( |
8 | | - name="Example Storage", |
9 | | - storage_storage_validation_level="BOX", |
| 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", |
10 | 12 | ) |
11 | | - storage_id = collection.add(storage) |
12 | | - instrument = Instrument( |
13 | | - name="Example Instrument", |
| 13 | + instrument_input_id = collection.add(instrument_input) |
| 14 | + instrument_output = Instrument( |
| 15 | + name="Example Output Instrument", |
14 | 16 | manufacturer="Example Manufacturer", |
15 | 17 | bam_oe="OE_VP.1", |
16 | 18 | bam_location_complete="UE_08_0_101", |
17 | 19 | ) |
18 | | - instrument_id = collection.add(instrument) |
19 | | - _ = collection.add_relationship(storage_id, instrument_id) |
20 | | - logger.info("Parsing finished: Added example chemical and instrument.") |
| 20 | + instrument_output_id = collection.add(instrument_output) |
| 21 | + _ = collection.add_relationship(instrument_input_id, instrument_output_id) |
| 22 | + logger.info( |
| 23 | + "Parsing finished: Added examples input and output instruments and their relation." |
| 24 | + ) |
0 commit comments