generated from FAIRmat-NFDI/nomad-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema_package.py
38 lines (28 loc) · 1006 Bytes
/
schema_package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from typing import (
TYPE_CHECKING,
)
if TYPE_CHECKING:
from nomad.datamodel.datamodel import (
EntryArchive,
)
from structlog.stdlib import (
BoundLogger,
)
from nomad.config import config
from nomad.datamodel.data import Schema
from nomad.datamodel.metainfo.annotations import ELNAnnotation, ELNComponentEnum
from nomad.metainfo import Quantity, SchemaPackage
configuration = config.get_plugin_entry_point(
'nomad_parser_vasp.schema_packages:schema_package_entry_point'
)
m_package = SchemaPackage()
class NewSchemaPackage(Schema):
name = Quantity(
type=str, a_eln=ELNAnnotation(component=ELNComponentEnum.StringEditQuantity)
)
message = Quantity(type=str)
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
logger.info('NewSchema.normalize', parameter=configuration.parameter)
self.message = f'Hello {self.name}!'
m_package.__init_metainfo__()