diff --git a/dosnormalizer/__init__.py b/dosnormalizer/__init__.py index 9f2b3cb..20577ff 100644 --- a/dosnormalizer/__init__.py +++ b/dosnormalizer/__init__.py @@ -15,4 +15,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .normalizer import DosNormalizer +from nomad.config.models.plugins import NormalizerEntryPoint + + +class DosNormalizerEntryPoint(NormalizerEntryPoint): + def load(self): + import dosnormalizer + from .normalizer import DosNormalizer + + dosnormalizer.DosNormalizer = DosNormalizer + + return DosNormalizer(**self.dict()) + + +dos_normalizer_entry_point = DosNormalizerEntryPoint( + name='DosNormalizer', + description='Normalizer for the DOS data.', +) diff --git a/pyproject.toml b/pyproject.toml index cddde3b..be54767 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,5 +75,5 @@ line-ending = "auto" [tool.setuptools.packages.find] include = ["dosnormalizer*"] -[tool.setuptools.package-data] -dosnormalizer = ["*/nomad_plugin.yaml"] +[project.entry-points.'nomad.plugin'] +dosnormalizer = "dosnormalizer:dos_normalizer_entry_point"