Skip to content

Commit

Permalink
Add entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Aug 19, 2024
1 parent 05c632c commit fb078b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ line-ending = "auto"
[tool.setuptools.packages.find]
include = ["soapnormalizer*"]

[tool.setuptools.package-data]
soapnormalizer = ["*/nomad_plugin.yaml"]
[project.entry-points.'nomad.plugin']
soapnormalizer = "soapnormalizer:soap_normalizer_entry_point"
18 changes: 17 additions & 1 deletion soapnormalizer/__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 SoapNormalizer
from nomad.config.models.plugins import NormalizerEntryPoint


class SoapNormalizerEntryPoint(NormalizerEntryPoint):
def load(self):
import soapnormalizer
from .normalizer import SoapNormalizer

soapnormalizer.SoapNormalizer = SoapNormalizer

return SoapNormalizer(**self.dict())


soap_normalizer_entry_point = SoapNormalizerEntryPoint(
name="SoapNormalizer",
description="Normalizer for the SOAP data.",
)

0 comments on commit fb078b9

Please sign in to comment.