Skip to content

Commit

Permalink
updated version - sample created with 1 thin film only
Browse files Browse the repository at this point in the history
GarzonDiegoFEUP committed Oct 6, 2024
1 parent 695c4db commit 8f5ab10
Showing 5 changed files with 1,128 additions and 26 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -115,6 +115,7 @@ CVarser_entry_point = "nomad_inl_base.parsers:CV_parser_entry_point"
EDparser_entry_point1 = "nomad_inl_base.parsers:ED_parser_entry_point"
schema_package_entry_point = "nomad_inl_base.schema_packages:schema_package_entry_point"
cyclic_voltammetry_entry_point = "nomad_inl_base.schema_packages:cyclic_voltammetry_entry_point"
star_entry_point = "nomad_inl_base.schema_packages:star_entry_point"



12 changes: 12 additions & 0 deletions src/nomad_inl_base/schema_packages/__init__.py
Original file line number Diff line number Diff line change
@@ -30,3 +30,15 @@ def load(self):
description='CyclicVoltammetry entry point configuration.',
)

class StarPackageEntryPoint(SchemaPackageEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

def load(self):
from nomad_inl_base.schema_packages.star import m_package

return m_package

star_entry_point = StarPackageEntryPoint(
name = 'STAR processes',
description = 'STAR processes entry point configuration.',
)
33 changes: 7 additions & 26 deletions src/nomad_inl_base/schema_packages/cyclic_voltammetry.py
Original file line number Diff line number Diff line change
@@ -17,8 +17,7 @@

from nomad.datamodel.metainfo.annotations import ELNAnnotation, ELNComponentEnum
from nomad.datamodel.metainfo.basesections import Measurement
from nomad_material_processing.general import TimeSeries
from nomad_material_processing.vapor_deposition.general import SampleParameters
from nomad_material_processing.general import TimeSeries, ThinFilmStack, ThinFilm, RectangleCuboid, Substrate
import numpy as np

from nomad.datamodel.metainfo.plot import PlotSection, PlotlyFigure
@@ -62,8 +61,9 @@ class ScanTimeSeries(TimeSeries):
shape=['*'],
)


class VoltageTimeSeries(TimeSeries):


m_def = Section(label_quantity='set_value', a_eln={'hide': ['set_value','set_time',]})

value = Quantity(
@@ -73,8 +73,7 @@ class VoltageTimeSeries(TimeSeries):
unit='volt',
)


class ChronoamperometryMeasurement(PlotSection, Measurement, Schema):
class ChronoamperometryMeasurement(PlotSection, Measurement, EntryData):
m_def = Section(
links=['https://w3id.org/nfdi4cat/voc4cat_0007206'],
)
@@ -127,7 +126,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
logger.info('NewSchema.normalize', parameter=configuration.parameter)
#self.message = f'Hello {self.name}!'

class PotentiostatMeasurement(PlotSection, Measurement, Schema):
class PotentiostatMeasurement(PlotSection, Measurement, EntryData):
m_def = Section(
links=['https://w3id.org/nfdi4cat/voc4cat_0007206'],
)
@@ -203,7 +202,6 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
#self.message = f'Hello {self.name}!'



class ElectrolyteSolution(Solution):
m_def = Section(
links=['https://w3id.org/nfdi4cat/voc4cat_0007206'],
@@ -237,9 +235,9 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
#self.message = f'Hello {self.name}!'


class WorkingElectrode(SampleParameters, Schema):
class WorkingElectrode(ThinFilmStack, EntryData):
m_def = Section(
links=['https://w3id.org/nfdi4cat/voc4cat_0007206'],
links=['https://w3id.org/nfdi4cat/voc4cat_0007206'], a_eln={'hide': ['name','datetime', 'ID', 'description']}
)

area_electrode = Quantity(
@@ -252,23 +250,6 @@ class WorkingElectrode(SampleParameters, Schema):
unit='meter**2',
)

substrate = Quantity(
type=str,
description='Substrate of the electrode',
a_eln=ELNAnnotation(
component=ELNComponentEnum.StringEditQuantity,
),
default='SLG',
)

layer = Quantity(
type=str,
description='Layer of the electrode',
a_eln=ELNAnnotation(
component=ELNComponentEnum.StringEditQuantity,
),
default='Mo',
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super(WorkingElectrode, self).normalize(archive, logger)
1,087 changes: 1,087 additions & 0 deletions src/nomad_inl_base/schema_packages/star.py

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions src/nomad_inl_base/utils.py
Original file line number Diff line number Diff line change
@@ -54,6 +54,27 @@ def list_nan_equal(list1, list2):
return True


def create_filename(datafile, data_measurement, special_txt, archive,
logger, filetype='yaml'):

from nomad.datamodel.datamodel import EntryArchive, EntryMetadata

#create a filename and archive

filename = f'{datafile}.{special_txt}.archive.{filetype}'

if archive.m_context.raw_path_exists(filename):
logger.warn(f'Process archive already exists: {filename}')
else:
archive = EntryArchive(
data=data_measurement,
m_context=archive.m_context,
metadata=EntryMetadata(upload_id=archive.m_context.upload_id),
)

return filename, archive


def create_archive(
entry_dict, context, filename, file_type, logger, *, overwrite: bool = False
):

0 comments on commit 8f5ab10

Please sign in to comment.