Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

started general module #66

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
281 changes: 281 additions & 0 deletions src/nomad_material_processing/general/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from nomad.datamodel.datamodel import (
EntryArchive,
)
from structlog.stdlib import (
BoundLogger,
)

from nomad.datamodel.metainfo.annotations import ELNAnnotation, ELNComponentEnum

import numpy as np
from nomad.datamodel.data import EntryData, ArchiveSection

from nomad.metainfo import (
Quantity,
SubSection,
Section,
MEnum,
)

from nomad.datamodel.metainfo.basesections import (
CompositeSystem,
ActivityStep,
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
Process,
CompositeSystemReference,
)
from nomad.datamodel.metainfo.annotations import (
ELNAnnotation,
ELNComponentEnum,
)

from nomad.metainfo import (
SectionProxy,
Reference,
)


class Recipe(ArchiveSection):
"""
A Recipe for a material processing experiment.

This class will be subclassed for each process that needs a recipe.

The subclass will inherit Recipe and a specific Process class.

The only difference between the Recipe and the actual Process is that
the datetime and the input samples Entities are hidden in the Recipe.
"""

pass


class EtchingStep(ActivityStep):
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
"""
A step of etching process.
"""

m_def = Section()
duration = Quantity(
type=np.float64,
description='The elapsed time since the annealing process started.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='minute'
),
unit='second',
)
temperature = Quantity(
type=np.float64,
description='The temperature of the etching process.',
a_eln={'component': 'NumberEditQuantity', 'defaultDisplayUnit': 'celsius'},
unit='celsius',
)
agitation = Quantity(
type=MEnum(
'Magnetic Stirring',
'Sonication',
),
description='The agitation method used during the etching process.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.EnumEditQuantity,
),
)
etching_reagents = SubSection(section_def=CompositeSystem, repeats=True)


class Etching(Process, EntryData):
"""
Selectively remove material from a surface using chemical or physical processes
to create specific patterns or structures.
"""

m_def = Section(
a_eln=None,
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
)
recipe = Quantity(
type=Reference(SectionProxy('EtchingRecipe')),
description=""" The recipe used for the process. If a recipe is found,
all the data is copied from the Recipe within the Process.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.ReferenceEditQuantity,
),
)
steps = SubSection(
description="""
The steps of the etching process.
""",
section_def=EtchingStep,
repeats=True,
)


class EtchingRecipe(Etching, Recipe, EntryData):
"""
A Recipe for an etching process.
"""

m_def = Section(
a_eln={'hide': ['datetime', 'samples']},
)


class AnnealingStep(ActivityStep):
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
"""
A step of annealing process.
"""

m_def = Section()
duration = Quantity(
type=np.float64,
description='The elapsed time since the annealing process started.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='minute'
),
unit='second',
)
temperature = Quantity(
type=np.float64,
description='The temperature of the etching process.',
a_eln={'component': 'NumberEditQuantity', 'defaultDisplayUnit': 'celsius'},
unit='celsius',
)
agitation = Quantity(
type=MEnum(
'Magnetic Stirring',
'Sonication',
),
description='The agitation method used during the etching process.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.EnumEditQuantity,
),
)
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
annealing_reagents = SubSection(
section_def=CompositeSystemReference,
)


class Annealing(Process, EntryData):
"""
Heat treatment process used to alter the material's properties,
such as reducing defects, improving crystallinity, or relieving internal stresses.
"""

m_def = Section()
recipe = Quantity(
type=Reference(SectionProxy('AnnealingRecipe')),
description=""" The recipe used for the process. If a recipe is found,
all the data is copied from the Recipe within the Process.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.ReferenceEditQuantity,
),
)
duration = Quantity(
type=np.float64,
description='The elapsed time since the annealing process started.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='minute'
),
unit='second',
)
steps = SubSection(
description="""
The steps of the annealing process.
""",
section_def=AnnealingStep,
repeats=True,
)


class AnnealingRecipe(Annealing, Recipe, EntryData):
"""
A Recipe for an annealing process.
"""

m_def = Section(
a_eln={'hide': ['datetime', 'samples']},
)


class CleaningStep(ActivityStep):
aalbino2 marked this conversation as resolved.
Show resolved Hide resolved
"""
A step of cleaning process.
"""

m_def = Section()
duration = Quantity(
type=np.float64,
description='The elapsed time since the cleaning process started.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='minute'
),
unit='second',
)
temperature = Quantity(
type=np.float64,
description='The temperature of the cleaning process.',
a_eln={'component': 'NumberEditQuantity', 'defaultDisplayUnit': 'celsius'},
unit='celsius',
)
agitation = Quantity(
type=MEnum(
'Magnetic Stirring',
'Sonication',
),
description='The agitation method used during the cleaning process.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.EnumEditQuantity,
),
)
cleaning_reagents = SubSection(
section_def=CompositeSystemReference,
)


class Cleaning(Process, EntryData):
"""
Surface cleaning in thin film material science involves removing contaminants
and residues from a substrate's surface to ensure proper adhesion
and uniformity of the thin film deposition.
"""

m_def = Section(
a_eln={'hide': ['steps']},
)
recipe = Quantity(
type=Reference(SectionProxy('CleaningRecipe')),
description=""" The recipe used for the process. If a recipe is found,
all the data is copied from the Recipe within the Process.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.ReferenceEditQuantity,
),
)
duration = Quantity(
type=np.float64,
description='The elapsed time since the annealing process started.',
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='minute'
),
unit='second',
)
steps = SubSection(
description="""
The steps of the cleaning process.
""",
section_def=CleaningStep,
repeats=True,
)


class CleaningRecipe(Cleaning, Recipe, EntryData):
"""
A Recipe for an cleaning process.
"""

m_def = Section(
a_eln={'hide': ['datetime', 'samples']},
)
Loading