diff --git a/IKZ_plugin/nomad.yaml b/IKZ_plugin/nomad.yaml index be8e3c52..01b905c5 100644 --- a/IKZ_plugin/nomad.yaml +++ b/IKZ_plugin/nomad.yaml @@ -11,7 +11,9 @@ plugins: - 'parsers/hall_lakeshore_measurement' - 'parsers/hall_lakeshore_instrument' - 'parsers/laytec_epitt' - - 'schemas/basesections' + - 'schemas/basesections_IKZ' + - 'schemas/characterization_IKZ' + - 'schemas/substrate_IKZ' - 'parsers/czochralski' - 'parsers/movpe_2' - 'parsers/movpe_1_deposition_control' @@ -33,8 +35,12 @@ plugins: python_package: hall.instrument_parser parsers/laytec_epitt: python_package: laytec_epitt - schemas/basesections: + schemas/basesections_IKZ: python_package: basesections + schemas/characterization_IKZ: + python_package: characterization + schemas/substrate_IKZ: + python_package: substrate parsers/czochralski: python_package: czochralski parsers/movpe_2: diff --git a/IKZ_plugin/src/basesections/__init__.py b/IKZ_plugin/src/ikz_plugin/__init__.py similarity index 69% rename from IKZ_plugin/src/basesections/__init__.py rename to IKZ_plugin/src/ikz_plugin/__init__.py index 8eeb6548..4c45c167 100644 --- a/IKZ_plugin/src/basesections/__init__.py +++ b/IKZ_plugin/src/ikz_plugin/__init__.py @@ -1,12 +1,14 @@ -import json - -from nomad.metainfo import ( - Package, Quantity, SubSection, Section, Category) from nomad.datamodel.data import EntryData, EntryDataCategory -#from nomad.datamodel.metainfo.workflow import Link -from nomad.datamodel.metainfo.eln import Entity, Activity, SampleID -from nomad.datamodel.util import parse_path +import numpy as np +from nomad.datamodel.metainfo.basesections import ( + CompositeSystem, + Activity, + Process, + CompositeSystemReference, +) +from nomad.metainfo import Package, Quantity, SubSection, Datetime, Section, Category +from nomad.datamodel.data import EntryData m_package = Package(name='basesections_IKZ') @@ -34,6 +36,82 @@ class IKZHallCategory(EntryDataCategory): m_def = Category(label='Hall', categories=[EntryDataCategory, IKZCategory]) +class SubstratePreparationStep(Activity): + """ + A section used for referencing Activities performed on Substrate. + """ + + m_def = Section() + + +class Etching(Process, SubstratePreparationStep, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + a_eln=None, + categories=[IKZCategory], + ) + method = Quantity( + type=str, + default="Etching (MOVPE IKZ)", + ) + datetime = Quantity( + type=Datetime, + description="FILL", + a_eln={"component": "DateTimeEditQuantity", "label": "deposition_date"}, + ) + temperature = Quantity( + type=np.float64, + description="FILL THE DESCRIPTION", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "celsius"}, + unit="celsius", + ) + elapsed_time = Quantity( + type=np.float64, + description="Past time since process started (minutes)", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "minute"}, + unit="minute", + ) + etching_reagents = SubSection(section_def=CompositeSystem, repeats=True) + + +class Annealing(Process, SubstratePreparationStep, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + a_eln=None, + categories=[IKZCategory], + ) + method = Quantity( + type=str, + default="Annealing (MOVPE IKZ)", + ) + datetime = Quantity( + type=Datetime, + description="FILL", + a_eln={"component": "DateTimeEditQuantity", "label": "deposition_date"}, + ) + temperature = Quantity( + type=np.float64, + description="FILL THE DESCRIPTION", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "celsius"}, + unit="celsius", + ) + elapsed_time = Quantity( + type=np.float64, + description="Past time since process started (minutes)", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "minute"}, + unit="minute", + ) + anealing_reagents = SubSection( + section_def=CompositeSystemReference, + ) + + # class CollectionOfSystems(Entity, EntryData): # ''' # A base class for a batch of materials. Each component of the batch is diff --git a/IKZ_plugin/src/movpe/__init__.py b/IKZ_plugin/src/ikz_plugin/characterization/__init__.py similarity index 100% rename from IKZ_plugin/src/movpe/__init__.py rename to IKZ_plugin/src/ikz_plugin/characterization/__init__.py diff --git a/IKZ_plugin/src/basesections/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/characterization/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/basesections/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/characterization/nomad_plugin.yaml diff --git a/IKZ_plugin/src/ikz_plugin/characterization/schema.py b/IKZ_plugin/src/ikz_plugin/characterization/schema.py new file mode 100644 index 00000000..66e3ee47 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/characterization/schema.py @@ -0,0 +1,127 @@ +import numpy as np +from nomad.datamodel.metainfo.basesections import ( + Measurement, + MeasurementResult, +) +from nomad.metainfo import Package, Quantity, SubSection, MEnum, Datetime, Section +from nomad.datamodel.data import EntryData + +from ikz_plugin import ( + IKZCategory, + SubstratePreparationStep, +) + +m_package = Package(name="characterization_IKZ") + + +class AFMresults(MeasurementResult): + """ + The results of an AFM measurement + """ + + roughness = Quantity( + type=np.float64, + description="RMS roughness value obtained by AFM", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "picometer"}, + unit="picometer", + ) + surface_features = Quantity( + type=MEnum(["Step Flow", "Step Bunching", "2D Island"]), + a_eln={"component": "EnumEditQuantity"}, + ) + scale = Quantity( + type=np.float64, + description="scale of the image, to be multiplied by 5 to know the image size", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "nanometer"}, + unit="nanometer", + ) + image = Quantity( + type=str, + description="image showing the thickness measurement points", + a_browser={"adaptor": "RawFileAdaptor"}, + a_eln={"component": "FileEditQuantity"}, + ) + crop_image = Quantity( + type=str, + description="crop image ready to be used for AI-based analysis", + a_browser={"adaptor": "RawFileAdaptor"}, + a_eln={"component": "FileEditQuantity"}, + ) + + +class AFMmeasurement(Measurement, SubstratePreparationStep, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + a_eln={"hide": ["steps"]}, + categories=[IKZCategory], + label="AFM", + ) + + method = Quantity( + type=str, + default="AFM (IKZ MOVPE)", + ) + description = Quantity( + type=str, + a_eln={"component": "StringEditQuantity"}, + ) + datetime = Quantity( + type=Datetime, + a_eln={"component": "DateTimeEditQuantity"}, + ) + results = SubSection( + section_def=AFMresults, + repeats=True, + ) + + +class LiMiresults(MeasurementResult): + """ + The results of a Light Microscope measurement + """ + + image = Quantity( + type=str, + description="image showing the thickness measurement points", + a_browser={"adaptor": "RawFileAdaptor"}, + a_eln={"component": "FileEditQuantity"}, + ) + crop_image = Quantity( + type=str, + description="crop image ready to be used for AI-based analysis", + a_browser={"adaptor": "RawFileAdaptor"}, + a_eln={"component": "FileEditQuantity"}, + ) + scale = Quantity( + type=np.float64, + description="scale of the image", + a_eln={"component": "NumberEditQuantity", "defaultDisplayUnit": "micrometer"}, + unit="micrometer", + ) + + +class LightMicroscope(Measurement, SubstratePreparationStep, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + a_eln={"hide": ["steps"]}, + categories=[IKZCategory], + label="Light Microscope", + ) + method = Quantity( + type=str, + default="Light Microscope (MOVPE IKZ)", + ) + datetime = Quantity( + type=Datetime, + a_eln={"component": "DateTimeEditQuantity"}, + ) + results = SubSection( + section_def=LiMiresults, + repeats=True, + ) \ No newline at end of file diff --git a/IKZ_plugin/src/czochralski/__init__.py b/IKZ_plugin/src/ikz_plugin/czochralski/__init__.py similarity index 100% rename from IKZ_plugin/src/czochralski/__init__.py rename to IKZ_plugin/src/ikz_plugin/czochralski/__init__.py diff --git a/IKZ_plugin/src/czochralski/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/czochralski/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/czochralski/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/czochralski/nomad_plugin.yaml diff --git a/IKZ_plugin/src/czochralski/parser.py b/IKZ_plugin/src/ikz_plugin/czochralski/parser.py similarity index 100% rename from IKZ_plugin/src/czochralski/parser.py rename to IKZ_plugin/src/ikz_plugin/czochralski/parser.py diff --git a/IKZ_plugin/src/czochralski/schema.py b/IKZ_plugin/src/ikz_plugin/czochralski/schema.py similarity index 100% rename from IKZ_plugin/src/czochralski/schema.py rename to IKZ_plugin/src/ikz_plugin/czochralski/schema.py diff --git a/IKZ_plugin/src/directional_solidification/__init__.py b/IKZ_plugin/src/ikz_plugin/directional_solidification/__init__.py similarity index 100% rename from IKZ_plugin/src/directional_solidification/__init__.py rename to IKZ_plugin/src/ikz_plugin/directional_solidification/__init__.py diff --git a/IKZ_plugin/src/directional_solidification/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/directional_solidification/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/directional_solidification/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/directional_solidification/nomad_plugin.yaml diff --git a/IKZ_plugin/src/directional_solidification/parser.py b/IKZ_plugin/src/ikz_plugin/directional_solidification/parser.py similarity index 100% rename from IKZ_plugin/src/directional_solidification/parser.py rename to IKZ_plugin/src/ikz_plugin/directional_solidification/parser.py diff --git a/IKZ_plugin/src/directional_solidification/schema.py b/IKZ_plugin/src/ikz_plugin/directional_solidification/schema.py similarity index 99% rename from IKZ_plugin/src/directional_solidification/schema.py rename to IKZ_plugin/src/ikz_plugin/directional_solidification/schema.py index e47bc27d..8b6bd377 100644 --- a/IKZ_plugin/src/directional_solidification/schema.py +++ b/IKZ_plugin/src/ikz_plugin/directional_solidification/schema.py @@ -64,7 +64,7 @@ ) from nomad.datamodel.metainfo.plot import PlotSection, PlotlyFigure -from basesections import IKZDSCategory +from ikz_plugin import IKZDSCategory m_package = Package(name='Directional Solidification Experiment') diff --git a/IKZ_plugin/src/ikz_plugin/mbe/__init__.py b/IKZ_plugin/src/ikz_plugin/mbe/__init__.py new file mode 100644 index 00000000..ec313ab2 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/mbe/__init__.py @@ -0,0 +1,2 @@ +from .schema import * +from ikz_plugin import * \ No newline at end of file diff --git a/IKZ_plugin/src/mbe/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/mbe/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/mbe/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/mbe/nomad_plugin.yaml diff --git a/IKZ_plugin/src/mbe/schema.py b/IKZ_plugin/src/ikz_plugin/mbe/schema.py similarity index 99% rename from IKZ_plugin/src/mbe/schema.py rename to IKZ_plugin/src/ikz_plugin/mbe/schema.py index 7f2b9091..70e393ac 100644 --- a/IKZ_plugin/src/mbe/schema.py +++ b/IKZ_plugin/src/ikz_plugin/mbe/schema.py @@ -11,7 +11,7 @@ from nomad.datamodel.metainfo.eln import PublicationReference from nomad.datamodel.metainfo.eln import Entity, Activity, SampleID from nomad.datamodel.util import parse_path -from basesections import SampleCut +from ikz_plugin import SampleCut m_package = Package(name='mbe_IKZ') diff --git a/IKZ_plugin/src/movpe/README.md b/IKZ_plugin/src/ikz_plugin/movpe/README.md similarity index 100% rename from IKZ_plugin/src/movpe/README.md rename to IKZ_plugin/src/ikz_plugin/movpe/README.md diff --git a/IKZ_plugin/src/ikz_plugin/movpe/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/__init__.py new file mode 100644 index 00000000..7a3dade8 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/movpe/__init__.py @@ -0,0 +1,18 @@ +# Copyright The NOMAD Authors. +# +# This file is part of NOMAD. See https://nomad-lab.eu for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from .schema import * diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/__init__.py similarity index 100% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/__init__.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/__init__.py diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/__init__.py similarity index 100% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/__init__.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/__init__.py diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/nomad_plugin.yaml diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/parser.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/parser.py similarity index 98% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/parser.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/parser.py index a5aea58e..87f3fc70 100644 --- a/IKZ_plugin/src/movpe/movpe1_growth_parser/constant_parameters/parser.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/constant_parameters/parser.py @@ -37,7 +37,7 @@ ) from nomad.search import search from nomad_material_processing.utils import create_archive as create_archive_ref -from movpe import ( +from ikz_plugin.movpe import ( ExperimentMovpe1IKZ, GrowthMovpe1IKZConstantParameters, ThinFilmStackMovpe @@ -46,7 +46,7 @@ from nomad.parsing.tabular import create_archive from nomad.utils import hash -from basesections import IKZMOVPE1Category +from ikz_plugin import IKZMOVPE1Category class RawFileConstantParameters(EntryData): m_def = Section( diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/__init__.py similarity index 100% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/__init__.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/__init__.py diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/nomad_plugin.yaml diff --git a/IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/parser.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/parser.py similarity index 99% rename from IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/parser.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/parser.py index b2f8ba19..ad2b7496 100644 --- a/IKZ_plugin/src/movpe/movpe1_growth_parser/deposition_control/parser.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/movpe1_growth_parser/deposition_control/parser.py @@ -39,7 +39,7 @@ from nomad.app.v1.models.models import User from nomad.datamodel.data import EntryData, ArchiveSection from nomad.search import search, MetadataPagination -from movpe import ( +from ikz_plugin.movpe import ( ExperimentMovpe1IKZ, GrowthMovpe1IKZConstantParametersReference, GrowthMovpe1IKZDepositionControl, @@ -64,7 +64,7 @@ # from nomad.parsing.tabular import create_archive from nomad.utils import hash -from basesections import IKZMOVPE1Category +from ikz_plugin import IKZMOVPE1Category def create_archive( diff --git a/IKZ_plugin/src/movpe/movpe2_growth_parser/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/__init__.py similarity index 100% rename from IKZ_plugin/src/movpe/movpe2_growth_parser/__init__.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/__init__.py diff --git a/IKZ_plugin/src/movpe/movpe2_growth_parser/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/movpe/movpe2_growth_parser/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/nomad_plugin.yaml diff --git a/IKZ_plugin/src/movpe/movpe2_growth_parser/parser.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/parser.py similarity index 99% rename from IKZ_plugin/src/movpe/movpe2_growth_parser/parser.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/parser.py index a7406d68..2e8fa158 100644 --- a/IKZ_plugin/src/movpe/movpe2_growth_parser/parser.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/parser.py @@ -39,7 +39,7 @@ PubChemPureSubstanceSection, ) -from basesections import IKZMOVPE2Category +from ikz_plugin import IKZMOVPE2Category from nomad.search import search # from nomad_material_processing.utils import create_archive as create_archive_ref @@ -47,7 +47,7 @@ SubstrateReference, ThinFilmReference, ) -from movpe import ( +from ikz_plugin.movpe import ( ExperimentMovpe2IKZ, GrowthStepMovpe2IKZ, GrowthMovpe2IKZ, diff --git a/IKZ_plugin/src/movpe/movpe2_growth_parser/utils.py b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/utils.py similarity index 84% rename from IKZ_plugin/src/movpe/movpe2_growth_parser/utils.py rename to IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/utils.py index b1b76af4..af982765 100644 --- a/IKZ_plugin/src/movpe/movpe2_growth_parser/utils.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/movpe2_growth_parser/utils.py @@ -21,6 +21,8 @@ from typing import Dict, List import yaml import json +import math + from nomad.datamodel.context import ClientContext from nomad.datamodel import EntryArchive @@ -40,7 +42,7 @@ CompositeSystemReference, ) -from basesections import IKZMOVPE2Category +from ikz_plugin import IKZMOVPE2Category from nomad.search import search # from nomad_material_processing.utils import create_archive as create_archive_ref @@ -52,7 +54,7 @@ CVDSource, ) -from movpe import ( +from ikz_plugin.movpe import ( ExperimentMovpe2IKZ, GrowthStepMovpe2IKZ, GrowthMovpe2IKZ, @@ -80,6 +82,44 @@ def get_entry_id_from_file_name(filename, upload_id): return hash(upload_id, filename) +def nan_equal(a, b): + """ + Compare two values with NaN values. + """ + if isinstance(a, float) and isinstance(b, float): + return a == b or (math.isnan(a) and math.isnan(b)) + elif isinstance(a, dict) and isinstance(b, dict): + return dict_nan_equal(a, b) + elif isinstance(a, list) and isinstance(b, list): + return list_nan_equal(a, b) + else: + return a == b + + +def list_nan_equal(list1, list2): + """ + Compare two lists with NaN values. + """ + if len(list1) != len(list2): + return False + for a, b in zip(list1, list2): + if not nan_equal(a, b): + return False + return True + + +def dict_nan_equal(dict1, dict2): + """ + Compare two dictionaries with NaN values. + """ + if set(dict1.keys()) != set(dict2.keys()): + return False + for key in dict1: + if not nan_equal(dict1[key], dict2[key]): + return False + return True + + def create_archive( entry_dict, context, filename, file_type, logger, *, overwrite: bool = False ): @@ -88,13 +128,19 @@ def create_archive( if context.raw_path_exists(filename): with context.raw_file(filename, "r") as file: existing_dict = yaml.safe_load(file) - if context.raw_path_exists(filename) and existing_dict != entry_dict: + if context.raw_path_exists(filename) and not dict_nan_equal( + existing_dict, entry_dict + ): logger.error( f"{filename} archive file already exists. " f"You are trying to overwrite it with a different content. " f"To do so, remove the existing archive and click reprocess again." ) - if not context.raw_path_exists(filename) or existing_dict == entry_dict or overwrite: + if ( + not context.raw_path_exists(filename) + or existing_dict == entry_dict + or overwrite + ): with context.raw_file(filename, "w") as newfile: if file_type == "json": json.dump(entry_dict, newfile) @@ -103,21 +149,20 @@ def create_archive( context.upload.process_updated_raw_file(filename, allow_modify=True) return get_reference( - context.upload_id, - get_entry_id_from_file_name(filename, context.upload_id) + context.upload_id, get_entry_id_from_file_name(filename, context.upload_id) ) - # !! useful to fetch the upload_id from another upload. - # experiment_context = ServerContext( - # get_upload_with_read_access( - # matches["upload_id"][0], - # User( - # is_admin=True, - # user_id=current_parse_archive.metadata.main_author.user_id, - # ), - # include_others=True, - # ) - # ) # Upload(upload_id=matches["upload_id"][0])) + # !! useful to fetch the upload_id from another upload. + # experiment_context = ServerContext( + # get_upload_with_read_access( + # matches["upload_id"][0], + # User( + # is_admin=True, + # user_id=current_parse_archive.metadata.main_author.user_id, + # ), + # include_others=True, + # ) + # ) # Upload(upload_id=matches["upload_id"][0])) # def create_archive( diff --git a/IKZ_plugin/src/movpe/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/movpe/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/movpe/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/movpe/nomad_plugin.yaml diff --git a/IKZ_plugin/src/movpe/schema.py b/IKZ_plugin/src/ikz_plugin/movpe/schema.py similarity index 99% rename from IKZ_plugin/src/movpe/schema.py rename to IKZ_plugin/src/ikz_plugin/movpe/schema.py index a852a32c..a4c3e8b0 100644 --- a/IKZ_plugin/src/movpe/schema.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/schema.py @@ -39,7 +39,7 @@ from laytec_epitt import LayTecEpiTTMeasurement from hall import HallMeasurement -from basesections import IKZMOVPECategory, IKZMOVPE1Category, IKZMOVPE2Category +from ikz_plugin import IKZMOVPECategory, IKZMOVPE1Category, IKZMOVPE2Category from nomad_material_processing import ( SubstrateReference, CrystallineSubstrate, @@ -110,6 +110,39 @@ class ElementalCompositionMovpe(ElementalComposition): ) +class Precursor(PureSubstance, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section(categories=[IKZMOVPECategory]) + name = Quantity( + type=str, + description="FILL", + a_eln=ELNAnnotation(component="StringEditQuantity", label="Substance Name"), + ) + cas_number = Quantity( + type=str, + description="FILL", + a_eln=ELNAnnotation(component="StringEditQuantity", label="CAS number"), + ) + + +class PrecursorReference(EntityReference): + """ + A section used for referencing a Precursor. + """ + + reference = Quantity( + type=Precursor, + description="A reference to a NOMAD `Precursor` entry.", + a_eln=ELNAnnotation( + component="ReferenceEditQuantity", + label="Precursor Reference", + ), + ) + + class DopantMovpe(Dopant): """ A dopant element in a crystalline structure @@ -331,39 +364,6 @@ class SubstrateCrystalPropertiesMovpe(SubstrateCrystalProperties): miscut = SubSection(section_def=MiscutMovpe) -class Precursor(PureSubstance, EntryData): - """ - Class autogenerated from yaml schema. - """ - - m_def = Section(categories=[IKZMOVPECategory]) - name = Quantity( - type=str, - description="FILL", - a_eln=ELNAnnotation(component="StringEditQuantity", label="Substance Name"), - ) - cas_number = Quantity( - type=str, - description="FILL", - a_eln=ELNAnnotation(component="StringEditQuantity", label="CAS number"), - ) - - -class Precursors(EntityReference): - """ - A section used for referencing a Precursor. - """ - - reference = Quantity( - type=Precursor, - description="A reference to a NOMAD `Precursor` entry.", - a_eln=ELNAnnotation( - component="ReferenceEditQuantity", - label="Precursor Reference", - ), - ) - - class SubstrateMovpe(CrystallineSubstrate, EntryData): """ Class autogenerated from yaml schema. @@ -2338,7 +2338,7 @@ class ExperimentMovpe2IKZ(Experiment, EntryData): section_def=Users, ) precursors = SubSection( - section_def=Precursors, + section_def=PrecursorReference, repeats=True, ) growth_run = SubSection( diff --git a/IKZ_plugin/src/movpe/substrate_parser/__init__.py b/IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/__init__.py similarity index 96% rename from IKZ_plugin/src/movpe/substrate_parser/__init__.py rename to IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/__init__.py index 5629c510..0fc0f675 100644 --- a/IKZ_plugin/src/movpe/substrate_parser/__init__.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/__init__.py @@ -16,4 +16,4 @@ # from movpe.schema import * -from .parser import * \ No newline at end of file +from .parser import * diff --git a/IKZ_plugin/src/movpe/substrate_parser/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/nomad_plugin.yaml similarity index 100% rename from IKZ_plugin/src/movpe/substrate_parser/nomad_plugin.yaml rename to IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/nomad_plugin.yaml diff --git a/IKZ_plugin/src/movpe/substrate_parser/parser.py b/IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/parser.py similarity index 98% rename from IKZ_plugin/src/movpe/substrate_parser/parser.py rename to IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/parser.py index 27e2ddfb..d9d87d35 100644 --- a/IKZ_plugin/src/movpe/substrate_parser/parser.py +++ b/IKZ_plugin/src/ikz_plugin/movpe/substrate_parser/parser.py @@ -32,7 +32,7 @@ from nomad_material_processing.utils import create_archive from movpe import SubstrateInventory -from basesections import ( +from ikz_plugin import ( IKZMOVPECategory ) diff --git a/IKZ_plugin/src/movpe/test_query.http b/IKZ_plugin/src/ikz_plugin/movpe/test_query.http similarity index 100% rename from IKZ_plugin/src/movpe/test_query.http rename to IKZ_plugin/src/ikz_plugin/movpe/test_query.http diff --git a/IKZ_plugin/src/ikz_plugin/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/nomad_plugin.yaml new file mode 100644 index 00000000..44965ba3 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/nomad_plugin.yaml @@ -0,0 +1,5 @@ +plugin_type: schema +name: NOMAD's example schema plugin +description: | + This is a simple hello world schema. This is meant as a template. + Fork the github project to create your own schemas. \ No newline at end of file diff --git a/IKZ_plugin/src/ikz_plugin/substrate/__init__.py b/IKZ_plugin/src/ikz_plugin/substrate/__init__.py new file mode 100644 index 00000000..7a3dade8 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/substrate/__init__.py @@ -0,0 +1,18 @@ +# Copyright The NOMAD Authors. +# +# This file is part of NOMAD. See https://nomad-lab.eu for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from .schema import * diff --git a/IKZ_plugin/src/ikz_plugin/substrate/nomad_plugin.yaml b/IKZ_plugin/src/ikz_plugin/substrate/nomad_plugin.yaml new file mode 100644 index 00000000..fa9bfce6 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/substrate/nomad_plugin.yaml @@ -0,0 +1,4 @@ +plugin_type: schema +name: MOVPE IKZ +description: | + This is a schema for MOVPE IKZ experiment diff --git a/IKZ_plugin/src/ikz_plugin/substrate/schema.py b/IKZ_plugin/src/ikz_plugin/substrate/schema.py new file mode 100644 index 00000000..d4d20488 --- /dev/null +++ b/IKZ_plugin/src/ikz_plugin/substrate/schema.py @@ -0,0 +1,196 @@ +from nomad.datamodel.metainfo.basesections import ( + ElementalComposition, + Activity, + Process, +) +from nomad.datamodel.metainfo.annotations import ( + ELNAnnotation, +) +from nomad.datamodel.metainfo.annotations import ( + ELNAnnotation, +) +from nomad.metainfo import Package, Quantity, SubSection, MEnum, Datetime, Section +from nomad.datamodel.data import EntryData + +from ikz_plugin import ( + IKZCategory, + SubstratePreparationStep, +) +from nomad_material_processing import ( + SubstrateReference, + CrystallineSubstrate, + Miscut, + SubstrateCrystalProperties, + Dopant, + Parallelepiped, +) + +from nomad_measurements import ( + ActivityReference, +) + + +m_package = Package(name="substrate_IKZ") + + +class MiscutIKZ(Miscut): + """ + The miscut in a crystalline substrate refers to + the intentional deviation from a specific crystallographic orientation, + commonly expressed as the angular displacement of a crystal plane. + """ + + m_def = Section(label="Miscut") + + b_angle = Quantity( + type=float, + description="crystallographic orientation of the substrate in [hkl]", + a_eln=ELNAnnotation( + component="NumberEditQuantity", + ), + a_tabular={ + "name": "Substrate/Miscut b angle", + # "unit": "deg" + }, + unit="deg", + ) + angle = Quantity( + type=float, + description="angular displacement from crystallographic orientation of the substrate", + a_eln=ELNAnnotation( + component="NumberEditQuantity", + defaultDisplayUnit="deg", + label="c angle", + ), + unit="deg", + a_tabular={ + "name": "Substrate/Miscut c angle", + # "unit": "deg" + }, + ) + angle_deviation = Quantity( + type=float, + description="uncertainty on the angular displacement", + a_eln=ELNAnnotation( + component="NumberEditQuantity", + defaultDisplayUnit="deg", + label="c angle deviation", + ), + unit="deg", + ) + orientation = Quantity( + type=str, + description="crystallographic orientation of the substrate in [hkl]", + a_eln=ELNAnnotation( + component="StringEditQuantity", + ), + a_tabular={"name": "Substrate/Miscut c Orientation"}, + ) + + +class SubstrateCrystalPropertiesIKZ(SubstrateCrystalProperties): + """ + Characteristics arising from the ordered arrangement of atoms in a crystalline structure. + These properties are defined by factors such as crystal symmetry, lattice parameters, + and the specific arrangement of atoms within the crystal lattice. + """ + + m_def = Section(label="CrystalProperties") + orientation = Quantity( + type=str, + a_eln=ELNAnnotation( + component="StringEditQuantity", + ), + a_tabular={"name": "Substrate/Orientation"}, + ) + miscut = SubSection(section_def=MiscutIKZ) + + +class SubstrateIKZ(CrystallineSubstrate, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + label_quantity="lab_id", categories=[IKZCategory], label="Substrate" + ) + + supplier = Quantity( + type=str, + a_eln=ELNAnnotation( + component="StringEditQuantity", + ), + a_tabular={"name": "Substrate/Supplier"}, + ) + supplier_id = Quantity( + type=str, + description="""An ID string that is unique from the supplier.""", + a_eln=ELNAnnotation( + component="StringEditQuantity", + label="Polishing ID", + ), + a_tabular={"name": "Substrate/Polishing Number"}, + ) + documentation = Quantity( + type=str, + description="pdf files containing certificate and other documentation", + a_browser={"adaptor": "RawFileAdaptor"}, + a_eln=ELNAnnotation( + component="FileEditQuantity", + ), + ) + description = Quantity( + type=str, + description="description", + a_eln=ELNAnnotation( + component="StringEditQuantity", + label="Notes", + ), + ) + geometry = SubSection( + section_def=Parallelepiped, + ) + crystal_properties = SubSection(section_def=SubstrateCrystalPropertiesIKZ) + + +class SubstratePreparationStepReference(ActivityReference): + """ + A section used for referencing SubstratePreparationSteps. + """ + + reference = Quantity( + type=SubstratePreparationStep, + description="A reference to a NOMAD `SubstratePreparationSteps` entry.", + a_eln=ELNAnnotation( + component="ReferenceEditQuantity", + label="Substrate Preparation Steps", + ), + ) + + +class SubstratePreparation(Process, EntryData): + """ + Class autogenerated from yaml schema. + """ + + m_def = Section( + a_eln=None, + categories=[IKZCategory], + ) + method = Quantity( + type=str, + default="Substrate Process (MOVPE IKZ)", + ) + description = Quantity( + type=str, + description="description", + a_eln={"component": "StringEditQuantity"}, + ) + substrates = SubSection( + section_def=SubstrateReference, + repeats=True, + ) + steps = SubSection( + section_def=SubstratePreparationStepReference, + repeats=True, + ) \ No newline at end of file diff --git a/IKZ_plugin/src/mbe/__init__.py b/IKZ_plugin/src/mbe/__init__.py deleted file mode 100644 index 6b925fc4..00000000 --- a/IKZ_plugin/src/mbe/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .schema import * -from basesections import * \ No newline at end of file