Skip to content

Commit

Permalink
Added run and workflow2 schemas to yaml
Browse files Browse the repository at this point in the history
Fix testing
  • Loading branch information
JosePizarro3 committed Apr 24, 2024
1 parent 13d752a commit 67b8b7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion nomad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins:
# to make all default plugins work.
include:
- 'parsers/magres'
- 'runschema'
- 'simulationworkflowschema'
options:
parsers/magres:
python_package: nomad_parser_magres
python_package: nomad_parser_magres
runschema:
python_package: runschema
simulationworkflowschema:
python_package: simulationworkflowschema
2 changes: 1 addition & 1 deletion src/nomad_parser_magres/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def parse(self, filepath, archive, logger):

# Create Run with Program information
sec_run = Run()
calculation_params = self.magres_file_parser.get('calculation')
calculation_params = self.magres_file_parser.get('calculation', {})
program_name = calculation_params.get('code', '')
if program_name != 'CASTEP':
self.logger.error(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import pytest
import numpy as np
import os

from nomad.datamodel import EntryArchive
from nomad_parser_magres.parser import MagresParser
Expand All @@ -35,11 +36,10 @@ def parser():
def test_single_point_ethanol(parser):
archive = EntryArchive()
parser.parse(
'/home/josepizarro/nomad-parser-magres/tests/data/ethanol_nmr.magres',
os.path.join(os.path.dirname(__file__), 'data/ethanol_nmr.magres'),
archive,
None,
)
# parser.parse('tests/data/magres/ethanol_nmr.magres', archive, None)
sec_run = archive.run[-1]

# Program testing
Expand Down

0 comments on commit 67b8b7a

Please sign in to comment.