Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello World plugin is not working #18

Open
rekumar opened this issue Sep 13, 2024 · 0 comments
Open

Hello World plugin is not working #18

rekumar opened this issue Sep 13, 2024 · 0 comments

Comments

@rekumar
Copy link

rekumar commented Sep 13, 2024

The test included in this repo is currently failing. I'm getting the following error when trying to run from nomad.client import parse

>>> from nomad.client import parse
Schema is deprecated, use plugins. ()
Error importing simulation schemas. ()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/client/__init__.py", line 19, in <module>
    from .archive import ArchiveQuery
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/client/archive.py", line 34, in <module>
    from nomad.datamodel import EntryArchive, ClientContext
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/datamodel/__init__.py", line 23, in <module>
    from .datamodel import (
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/datamodel/datamodel.py", line 29, in <module>
    from nomad.datamodel.metainfo.common import FastAccess
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/datamodel/metainfo/__init__.py", line 52, in <module>
    config.load_plugins()
  File "/opt/homebrew/Caskroom/miniconda/base/envs/schematest/lib/python3.11/site-packages/nomad/config/models/config.py", line 1161, in load_plugins
    self.plugins = Plugins.parse_obj(_plugins)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 10 validation errors for Plugins
entry_points -> options -> schemas/example -> name
  field required (type=value_error.missing)
entry_points -> options -> schemas/example -> name
  field required (type=value_error.missing)
entry_points -> options -> schemas/example -> normalizer_class_name
  field required (type=value_error.missing)
entry_points -> options -> schemas/example -> name
  field required (type=value_error.missing)
entry_points -> options -> schemas/example -> parser_class_name
  field required (type=value_error.missing)
entry_points -> options -> schemas/example
  Can't instantiate abstract class SchemaPackageEntryPoint with abstract method load (type=type_error)
entry_points -> options -> schemas/example
  Can't instantiate abstract class ParserEntryPoint with abstract method load (type=type_error)
entry_points -> options -> schemas/example
  Can't instantiate abstract class NormalizerEntryPoint with abstract method load (type=type_error)
entry_points -> options -> schemas/example -> app
  field required (type=value_error.missing)
entry_points -> options -> schemas/example -> __root__
  Provide one of "path", "url" or "local_path". (type=value_error)

I cloned this repo into a new Python 3.11 conda environment and ran the code exactly as described in the README. I'm wondering if this plugin example repo is out of date? This is based on two clues -- The error trace starts with Schema is deprecated, use plugins. (), and a recent issue that mentions the docs around plugins need to catch up to the current best practices.

I see these errors with nomad-lab==1.3.6

Am I making a mistake trying to set this plugin demo up? Or if this repo is out of date, can you share a contemporary example of how to define a custom plugin (normalizers and schema in particular).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant