Skip to content

Commit

Permalink
Fix parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Oct 1, 2023
1 parent 7dd3038 commit 3b24614
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nomadparserexample/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
from nomad.datamodel import EntryMetadata
from nomad.metainfo import MSection, Quantity


Expand All @@ -8,10 +9,12 @@ class ExampleSection(MSection):

class ExampleParser:
def parse(self, mainfile, archive, logger):
logger.info('parsing started.')

with open(mainfile, 'rt') as f:
data = f.readlines()

archive.metadata.external_id = data[0][1:]
archive.metadata = EntryMetadata(external_id=data[0][1:])
archive.data = ExampleSection()
archive.data.pattern = [
[float(number) for number in line.split(' ')]
Expand Down

0 comments on commit 3b24614

Please sign in to comment.