Skip to content

Commit

Permalink
1 update sections to use latest base sections (#3)
Browse files Browse the repository at this point in the history
* Changed Imports and Inheritances

Updated nomad-lab dependency to v1.2.1.dev with new basesections

Updated the imports and inheritances to the new basesections

* Fixed nomad-lab Version to 1.2.1.dev

* Corrected Fixed nomad-lab Version With Range
  • Loading branch information
hampusnasstrom authored Sep 5, 2023
1 parent 7b74cca commit 525d01a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 46 deletions.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "nomad-material-processing"
version = "0.0.1"
version = "0.0.2"
description = "A plugin for NOMAD containing base sections for material processing."
readme = "README.md"
authors = [
Expand All @@ -21,9 +21,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
]
dependencies = [
"nomad-lab==1.2.0",
"nomad-lab>=1.2.1.dev,<1.2.2",
"pytest",
"typing-extensions==4.4.0",
"structlog==22.3.0",
]

Expand Down
41 changes: 7 additions & 34 deletions src/nomad_material_processing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,15 @@
Quantity,
Section,
)
from nomad.datamodel.data import (
ArchiveSection,
)
from nomad.datamodel.metainfo.eln import (
Process,
Ensemble,
from nomad.datamodel.metainfo.basesections import (
SynthesisMethod,
CompositeSystem,
)

m_package = Package(name='Material Processing')


class ActivityStep(ArchiveSection):
'''
A step in an activity.
'''
m_def = Section()
name = Quantity(
type=str,
description='''
A short and descriptive name for this step.
'''
)

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


class Substrate(Ensemble, ArchiveSection):
class Substrate(CompositeSystem):
'''
A thin free standing sheet of material. Not to be confused with the substrate role
during a deposition, which can be a `Substrate` with `ThinFilm`(s) on it.
Expand Down Expand Up @@ -89,7 +62,7 @@ def normalize(self, archive, logger: BoundLogger) -> None:
super(Substrate, self).normalize(archive, logger)


class ThinFilm(Ensemble, ArchiveSection):
class ThinFilm(CompositeSystem):
'''
A thin film of material which exists as part of a stack.
'''
Expand Down Expand Up @@ -118,7 +91,7 @@ def normalize(self, archive, logger: BoundLogger) -> None:
super(ThinFilm, self).normalize(archive, logger)


class ThinFilmStack(Ensemble, ArchiveSection):
class ThinFilmStack(CompositeSystem):
'''
A stack of `ThinFilm`(s). Typically deposited on a `Substrate`.
'''
Expand Down Expand Up @@ -157,7 +130,7 @@ def normalize(self, archive, logger: BoundLogger) -> None:
super(ThinFilmStack, self).normalize(archive, logger)


class SampleDeposition(Process, ArchiveSection):
class SampleDeposition(SynthesisMethod):
'''
The process of the settling of particles (atoms or molecules) from a solution,
suspension or vapour onto a pre-existing surface, resulting in the growth of a
Expand Down
18 changes: 9 additions & 9 deletions src/nomad_material_processing/physical_vapor_deposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
from nomad.datamodel.metainfo.annotations import (
ELNAnnotation,
)
from nomad.datamodel.metainfo.eln import (
Ensemble,
SampleID,
Substance,
from nomad.datamodel.metainfo.basesections import (
ActivityStep,
CompositeSystem,
PureSubstance,
ReadableIdentifiers,
)
from nomad_material_processing import (
ActivityStep,
SampleDeposition,
ThinFilmStack,
)
Expand Down Expand Up @@ -89,7 +89,7 @@ class PVDMaterialSource(ArchiveSection):
description='''
The material that is being evaporated.
''',
type=Ensemble,
type=CompositeSystem,
)
rate = SubSection(
section_def=PVDMaterialEvaporationRate,
Expand Down Expand Up @@ -255,7 +255,7 @@ class PVDPressure(ArchiveSection):

class PVDGasFlow(ArchiveSection):
gas = Quantity(
type=Substance,
type=PureSubstance,
)
flow = Quantity(
type=float,
Expand Down Expand Up @@ -374,9 +374,9 @@ def normalize(self, archive, logger: BoundLogger) -> None:
super(PhysicalVaporDeposition, self).normalize(archive, logger)


class PLDTarget(Ensemble):
class PLDTarget(CompositeSystem):
target_id = SubSection(
section_def = SampleID,
section_def = ReadableIdentifiers,
)


Expand Down

0 comments on commit 525d01a

Please sign in to comment.