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 21, 2024
2 parents b81e76a + 90c92ba commit 670b62f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion dosnormalizer/__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 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.',
)
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 670b62f

Please sign in to comment.