Skip to content
Snippets Groups Projects

Draft: Updating archive json based on changes from normalize method

Open Sarthak Kapoor requested to merge update-archive-json-not-working into develop
1 unresolved thread
Files
2
@@ -36,6 +36,7 @@ from nomad.datamodel.data import (
)
from nomad.datamodel.metainfo.annotations import (
ELNAnnotation,
ELNComponentEnum,
)
from nomad.datamodel.metainfo.basesections.v1 import (
Activity,
@@ -61,6 +62,7 @@ from nomad.datamodel.metainfo.basesections.v1 import (
CompositeSystem as Ensemble, # For legacy support
)
from nomad.datamodel.metainfo.basesections.v1 import (
BaseSection,
SystemComponent as Component,
)
from nomad.datamodel.metainfo.common import ProvenanceTracker
@@ -1740,4 +1742,31 @@ class SolarCellEQE(PlotSection):
add_band_gap(archive, self.bandgap_eqe)
class TestSection(BaseSection, EntryData):
"""
Section for testing schema.
"""
bool_quantity = Quantity(
type=bool,
a_eln=ELNAnnotation(
component=ELNComponentEnum.BoolEditQuantity,
),
)
string_quantity = Quantity(
type=str,
a_eln=ELNAnnotation(
component=ELNComponentEnum.StringEditQuantity,
),
)
def normalize(self, archive, logger):
if self.bool_quantity:
logger.info('bool_quantity is True')
self.bool_quantity = False
self.string_quantity = 'modified'
super().normalize(archive, logger)
m_package.__init_metainfo__()
Loading