Skip to content

Commit

Permalink
Move specs to entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Aug 23, 2024
1 parent efbfacc commit 9c200ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 14 additions & 2 deletions databaseparsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from pydantic import Field

from nomad.config.models.plugins import ParserEntryPoint


class EntryPoint(ParserEntryPoint):
parser_class_name: str = Field(
description="""
The fully qualified name of the Python class that implements the parser.
This class must have a function `def parse(self, mainfile, archive, logger)`.
"""
)

def load(self):
from nomad.parsing import MatchingParserInterface
from . import (
Expand All @@ -32,5 +41,8 @@ def load(self):
openkim_parser_entry_point = EntryPoint(
name='parsers/openkim',
description='NOMAD parser for OPENKIM.',
parser_class_name='workflowparsers.openkim.OpenKIMParser',
)
python_package='databaseparsers.openkim',
mainfile_contents_re=r'openkim|OPENKIM|OpenKIM',
mainfile_mime_re='(application/json)|(text/.*)',
parser_class_name='databaseparsers.openkim.OpenKIMParser',
)
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ license = { file = "LICENSE" }
dependencies = [
"nomad-lab>=1.3.6.dev1",
"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"
"nomad-schema-plugin-run@git+https://github.com/nomad-coe/nomad-schema-plugin-run.git@develop",
"pydantic>=1.10.8,<2.0.0",
]

[project.urls]
Expand Down

0 comments on commit 9c200ed

Please sign in to comment.