Skip to content

Commit

Permalink
Testing pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 23, 2024
1 parent 144782f commit 13d752a
Show file tree
Hide file tree
Showing 8 changed files with 731 additions and 6 deletions.
3 changes: 2 additions & 1 deletion nomad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ plugins:
# We only include our schema here. Without the explicit include, all plugins will be
# loaded. Many build in plugins require more dependencies. Install nomad-lab[parsing]
# to make all default plugins work.
include: 'parsers/magres'
include:
- 'parsers/magres'
options:
parsers/magres:
python_package: nomad_parser_magres
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
"nomad-lab>=1.2.2dev457",
"nomad-lab@git+https://github.com/nomad-coe/nomad.git@develop",
"nomad-schema-plugin-simulation-workflow@git+https://github.com/nomad-coe/nomad-schema-plugin-simulation-workflow.git@develop",
"nomad-schema-plugin-run@git+https://github.com/nomad-coe/nomad-schema-plugin-run.git@develop",
]

[project.urls]
Expand All @@ -41,6 +43,7 @@ dev = [
"unidecode==1.3.2",
"fastapi==0.92.0",
"zipstream-new==1.1.5",
"lxml_html_clean>=0.1.0",
]

[tool.ruff]
Expand Down Expand Up @@ -93,4 +96,4 @@ line-ending = "auto"
where = ["src"]

[tool.setuptools.package-data]
nomad_analysis = ['*/nomad_plugin.yaml']
nomad_parser_magres = ['*/nomad_plugin.yaml']
2 changes: 1 addition & 1 deletion src/nomad_parser_magres/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .parser import *
from .parser import MagresParser
2 changes: 1 addition & 1 deletion src/nomad_parser_magres/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# For the automatic workflow NMR
from nomad.search import search
from nomad.app.v1.models import MetadataRequired
from ..utils import BeyondDFTWorkflowsParser
from .utils import BeyondDFTWorkflowsParser


re_float = r' *[-+]?\d+\.\d*(?:[Ee][-+]\d+)? *'
Expand Down
20 changes: 20 additions & 0 deletions src/nomad_parser_magres/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .utils import get_files, numpy_type_to_json_serializable, BeyondDFTWorkflowsParser
from .magres_workflow import NMRMagRes, NMRMagResMethod, NMRMagResResults
61 changes: 61 additions & 0 deletions src/nomad_parser_magres/utils/magres_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from nomad.metainfo import SubSection, Quantity, Reference
from nomad.datamodel.metainfo.simulation.method import Method
from simulationworkflowschema import (
SimulationWorkflowResults,
SimulationWorkflowMethod,
SerialSimulation,
)


class NMRMagResResults(SimulationWorkflowResults):
"""
Groups the NMR magres outputs.
"""

pass


class NMRMagResMethod(SimulationWorkflowMethod):
"""
References the NMR (first principles) input methodology.
"""

nmr_method_ref = Quantity(
type=Reference(Method),
description="""
Reference to the NMR (first principles) methodology.
""",
)


class NMRMagRes(SerialSimulation):
"""
The NMR MagRes workflow is generated in an extra EntryArchive IF both the NMR (first
principles) and the NMR magres SinglePoint EntryArchives are present in the
upload.
"""

method = SubSection(sub_section=NMRMagResMethod)

results = SubSection(sub_section=NMRMagResResults)

def normalize(self, archive, logger):
super().normalize(archive, logger)
Loading

0 comments on commit 13d752a

Please sign in to comment.