Skip to content

Commit

Permalink
Merge pull request #3 from nomad-coe/entry-point
Browse files Browse the repository at this point in the history
Add entry point
  • Loading branch information
ladinesa authored Aug 20, 2024
2 parents d98d97b + b9fcf1a commit 04ecd65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "nomad-normalizer-plugin-spectra"
version = "1.0"
description = "SOAP nomad plugin for NOMAD."
description = "Spectra normalizer plugin for NOMAD."
readme = "README.md"
authors = [{ name = "The NOMAD Authors" }]
license = { text = "Apache-2.0" }
Expand Down Expand Up @@ -69,5 +69,5 @@ line-ending = "auto"
[tool.setuptools.packages.find]
include = ["spectranormalizer*"]

[tool.setuptools.package-data]
spectranormalizer = ["*/nomad_plugin.yaml"]
[project.entry-points.'nomad.plugin']
spectranormalizer = "spectranormalizer:spectra_normalizer_entry_point"
18 changes: 17 additions & 1 deletion spectranormalizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .normalizer import SpectraNormalizer
from nomad.config.models.plugins import NormalizerEntryPoint


class SpectraNormalizerEntryPoint(NormalizerEntryPoint):
def load(self):
import spectranormalizer
from .normalizer import SpectraNormalizer

spectranormalizer.SpectraNormalizer = SpectraNormalizer

return SpectraNormalizer(**self.dict())


spectra_normalizer_entry_point = SpectraNormalizerEntryPoint(
name='SpectraNormalizer',
description='Normalizer for the spectra data.',
)

0 comments on commit 04ecd65

Please sign in to comment.