Skip to content

Commit

Permalink
Adapted CVT to Sushmitas comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanNoky committed Jan 27, 2025
1 parent ca9bb87 commit b428340
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 162 deletions.
152 changes: 78 additions & 74 deletions src/cpfs_synthesis/cpfs_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@
)
from nomad.datamodel.metainfo.annotations import (
ELNAnnotation,
ELNComponentEnum,
SectionProperties,
)
from nomad.datamodel.metainfo.eln import (
ElementalComposition,
Ensemble,
Instrument,
SampleID,
)
from nomad.metainfo import (
Datetime,
MEnum,
Package,
Quantity,
Section,
SubSection,
)
from structlog.stdlib import (
BoundLogger,
Expand Down Expand Up @@ -138,24 +137,21 @@ class CPFSCrystalGrowthTube(EntryData, ArchiveSection):
a_eln=ELNAnnotation(
properties=SectionProperties(
order=[
'name',
'material',
'diameter',
'filling',
],
),
lane_width='600px',
),
)
material = Quantity(
type=str,
description="""
The material of the tube.
""",
a_eln={
'component': 'StringEditQuantity',
},
)
# material = Quantity(
# type=str,
# description="""
# The material of the tube.
# """,
# a_eln={
# 'component': 'StringEditQuantity',
# },
# )
diameter = Quantity(
type=float,
description="""
Expand All @@ -164,34 +160,42 @@ class CPFSCrystalGrowthTube(EntryData, ArchiveSection):
a_eln={'component': 'NumberEditQuantity', 'defaultDisplayUnit': 'millimeter'},
unit='meter',
)
filling = Quantity(
type=str,
length = Quantity(
type=float,
description="""
The filling of the tube.
The diameter of the tube.
""",
a_eln={
'component': 'StringEditQuantity',
},
)
name = Quantity(
type=MEnum(
'TubeType1',
'TubeType2',
'TubeType3',
),
a_eln=ELNAnnotation(
component='EnumEditQuantity',
),
)
datetime = Quantity(
type=Datetime,
description='The date and time associated with this section.',
)
lab_id = Quantity(
type=str,
description="""An ID string that is unique at least for the lab that produced
this data.""",
a_eln={'component': 'NumberEditQuantity', 'defaultDisplayUnit': 'millimeter'},
unit='meter',
)
# filling = Quantity(
# type=str,
# description="""
# The filling of the tube.
# """,
# a_eln={
# 'component': 'StringEditQuantity',
# },
# )
# name = Quantity(
# type=MEnum(
# 'TubeType1',
# 'TubeType2',
# 'TubeType3',
# ),
# a_eln=ELNAnnotation(
# component='EnumEditQuantity',
# ),
# )
# datetime = Quantity(
# type=Datetime,
# description='The date and time associated with this section.',
# )
# lab_id = Quantity(
# type=str,
# description="""An ID string that is unique at least for the lab that produced
# this data.""",
# )
description = Quantity(
type=str,
description='Any information that cannot be captured in the other fields.',
Expand All @@ -207,18 +211,18 @@ def normalize(self, archive, logger: BoundLogger) -> None:
logger (BoundLogger): A structlog logger.
"""
super().normalize(archive, logger)
if self.name:
furnace_list = [
['TubeType1', 'Quartz', '0.011', 'Vacuum'],
['TubeType2', 'Tantalum', '0.012', 'Iodine'],
['TubeType3', 'Quartz', '0.010', ''],
]
for li in furnace_list:
if self.name == li[0]:
self.material = li[1]
self.diameter = float(li[2])
self.filling = li[3]
break
# if self.name:
# furnace_list = [
# ['TubeType1', 'Quartz', '0.011', 'Vacuum'],
# ['TubeType2', 'Tantalum', '0.012', 'Iodine'],
# ['TubeType3', 'Quartz', '0.010', ''],
# ]
# for li in furnace_list:
# if self.name == li[0]:
# self.material = li[1]
# self.diameter = float(li[2])
# self.filling = li[3]
# break


class CPFSCrucible(EntryData, ArchiveSection):
Expand Down Expand Up @@ -308,25 +312,25 @@ class CPFSCrystal(Ensemble, EntryData):
'component': 'StringEditQuantity',
},
)

internal_sample_id = SubSection(
section_def=SampleID,
image_of_crystals = Quantity(
type=str,
description='Images of the resulting crystals.',
a_browser={'adaptor': 'RawFileAdaptor'},
a_eln=ELNAnnotation(
component=ELNComponentEnum.FileEditQuantity,
),
)

# internal_sample_id = SubSection(
# section_def=SampleID,
# )
achieved_composition = Quantity(
type=str,
a_eln=ELNAnnotation(
component='StringEditQuantity',
),
)
final_crystal_length = Quantity(
type=float,
unit='meter',
a_eln=ELNAnnotation(
component='NumberEditQuantity',
defaultDisplayUnit='millimeter',
),
)
single_poly = Quantity(
type=str,
a_eln=ELNAnnotation(
component='StringEditQuantity',
Expand Down Expand Up @@ -358,11 +362,7 @@ class CPFSCrystal(Ensemble, EntryData):
type=str,
description="""An ID string that is unique at least for the lab that produced
this data.""",
)
description = Quantity(
type=str,
description='Any information that cannot be captured in the other fields.',
a_eln=dict(component='StringEditQuantity', label='Remarks'),
default='MPI CPfS Dresden',
)

def normalize(self, archive, logger: BoundLogger) -> None:
Expand Down Expand Up @@ -392,14 +392,9 @@ class CPFSInitialSynthesisComponent(Ensemble, EntryData):
description='Any information that cannot be captured in the other fields.',
)
state = Quantity(
type=MEnum(
'Powder',
'Polycrystal',
'Plate',
'Pieces',
),
type=str,
a_eln=ELNAnnotation(
component='EnumEditQuantity',
component='StringEditQuantity',
),
)
weight = Quantity(
Expand All @@ -413,6 +408,15 @@ class CPFSInitialSynthesisComponent(Ensemble, EntryData):
component='StringEditQuantity',
),
)
purity = Quantity(
type=float,
a_eln=ELNAnnotation(component='NumberEditQuantity'),
)
description = Quantity(
type=str,
description='Any information that cannot be captured in the other fields.',
a_eln=dict(component='RichTextEditQuantity', props=dict(height=200)),
)

def normalize(self, archive, logger: BoundLogger) -> None:
"""
Expand Down
Loading

0 comments on commit b428340

Please sign in to comment.