Skip to content

Commit

Permalink
add sample class
Browse files Browse the repository at this point in the history
  • Loading branch information
schumannj committed Jun 18, 2024
1 parent c2a8ee3 commit 8f6355d
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/nomad_unisyscat/schema_packages/mypackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Measurement,
MeasurementResult,
)
from nomad.datamodel.metainfo.eln import ELNSample
from nomad.datamodel.metainfo.plot import PlotlyFigure, PlotSection
from nomad.metainfo import Quantity, SchemaPackage, Section

Expand All @@ -28,6 +29,63 @@

m_package = SchemaPackage()

class Sample(ELNSample, Schema):
'''
Class autogenerated from yaml schema.
'''
m_def = Section(
a_eln={
"hide": [
"chemical_formula",
"description",
"datetime"
]
},)
creation_time = Quantity(
type=Datetime,
a_eln={
"component": "DateTimeEditQuantity"
},
)
protein_solution = Quantity(
type=MEnum(['ReRH', 'ReMBH']),
description='Specify the protein solution used to prepare the sample',
a_eln={
"component": "RadioEnumEditQuantity"
},
)
sample_physical_form = Quantity(
type=MEnum(['Crystal', 'Solution', 'Lyophilizate']),
description='Specify the physical form of the sample',
a_eln={
"component": "RadioEnumEditQuantity"
},
)
incubation_gas = Quantity(
type=MEnum(['H2', 'D2']),
description='Specify the gas used in the gas exchange',
a_eln={
"component": "RadioEnumEditQuantity"
},
)
additional_information = Quantity(
type=str,
a_eln={
"component": "RichTextEditQuantity"
},
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
'''
The normalizer for the `Sample` class.
Args:
archive (EntryArchive): The archive containing the section that is being
normalized.
logger (BoundLogger): A structlog logger.
'''
super().normalize(archive, logger)


class EPRSettings(ArchiveSection):
metal_ions_defined = Quantity(type=bool)
Expand Down

0 comments on commit 8f6355d

Please sign in to comment.