From 8779bd04afaf3dcb5dc3c90e093cafb9beb5e306 Mon Sep 17 00:00:00 2001 From: sH4MbLe5 Date: Tue, 19 Sep 2023 13:30:45 +0200 Subject: [PATCH] update gitignore --- .gitignore | 2 +- datamodel_b07_tc/core/__init__.py | 69 ++++++++ datamodel_b07_tc/core/analysis.py | 113 +++++++++++++ datamodel_b07_tc/core/author.py | 33 ++++ datamodel_b07_tc/core/calibration.py | 51 ++++++ datamodel_b07_tc/core/chemical.py | 69 ++++++++ datamodel_b07_tc/core/chemicalformula.py | 10 ++ datamodel_b07_tc/core/data.py | 45 ++++++ datamodel_b07_tc/core/dataset.py | 72 +++++++++ datamodel_b07_tc/core/datatype.py | 13 ++ datamodel_b07_tc/core/device.py | 43 +++++ datamodel_b07_tc/core/devicelist.py | 10 ++ datamodel_b07_tc/core/experiment.py | 123 ++++++++++++++ datamodel_b07_tc/core/generalinformation.py | 70 ++++++++ datamodel_b07_tc/core/input.py | 77 +++++++++ datamodel_b07_tc/core/insulation.py | 36 +++++ datamodel_b07_tc/core/massflowmeter.py | 36 +++++ datamodel_b07_tc/core/material.py | 12 ++ datamodel_b07_tc/core/measurement.py | 122 ++++++++++++++ datamodel_b07_tc/core/measurementtype.py | 7 + datamodel_b07_tc/core/metadata.py | 63 ++++++++ datamodel_b07_tc/core/output.py | 77 +++++++++ datamodel_b07_tc/core/parameter.py | 35 ++++ datamodel_b07_tc/core/plantsetup.py | 170 ++++++++++++++++++++ datamodel_b07_tc/core/potentiostat.py | 37 +++++ datamodel_b07_tc/core/pump.py | 31 ++++ datamodel_b07_tc/core/pumptype.py | 6 + datamodel_b07_tc/core/quantity.py | 23 +++ datamodel_b07_tc/core/reactantrole.py | 9 ++ datamodel_b07_tc/core/species.py | 10 ++ datamodel_b07_tc/core/speciesdata.py | 59 +++++++ datamodel_b07_tc/core/stoichiometry.py | 63 ++++++++ datamodel_b07_tc/core/thermocouple.py | 31 ++++ datamodel_b07_tc/core/thermocoupletype.py | 6 + datamodel_b07_tc/core/tubing.py | 52 ++++++ 35 files changed, 1684 insertions(+), 1 deletion(-) create mode 100644 datamodel_b07_tc/core/__init__.py create mode 100644 datamodel_b07_tc/core/analysis.py create mode 100644 datamodel_b07_tc/core/author.py create mode 100644 datamodel_b07_tc/core/calibration.py create mode 100644 datamodel_b07_tc/core/chemical.py create mode 100644 datamodel_b07_tc/core/chemicalformula.py create mode 100644 datamodel_b07_tc/core/data.py create mode 100644 datamodel_b07_tc/core/dataset.py create mode 100644 datamodel_b07_tc/core/datatype.py create mode 100644 datamodel_b07_tc/core/device.py create mode 100644 datamodel_b07_tc/core/devicelist.py create mode 100644 datamodel_b07_tc/core/experiment.py create mode 100644 datamodel_b07_tc/core/generalinformation.py create mode 100644 datamodel_b07_tc/core/input.py create mode 100644 datamodel_b07_tc/core/insulation.py create mode 100644 datamodel_b07_tc/core/massflowmeter.py create mode 100644 datamodel_b07_tc/core/material.py create mode 100644 datamodel_b07_tc/core/measurement.py create mode 100644 datamodel_b07_tc/core/measurementtype.py create mode 100644 datamodel_b07_tc/core/metadata.py create mode 100644 datamodel_b07_tc/core/output.py create mode 100644 datamodel_b07_tc/core/parameter.py create mode 100644 datamodel_b07_tc/core/plantsetup.py create mode 100644 datamodel_b07_tc/core/potentiostat.py create mode 100644 datamodel_b07_tc/core/pump.py create mode 100644 datamodel_b07_tc/core/pumptype.py create mode 100644 datamodel_b07_tc/core/quantity.py create mode 100644 datamodel_b07_tc/core/reactantrole.py create mode 100644 datamodel_b07_tc/core/species.py create mode 100644 datamodel_b07_tc/core/speciesdata.py create mode 100644 datamodel_b07_tc/core/stoichiometry.py create mode 100644 datamodel_b07_tc/core/thermocouple.py create mode 100644 datamodel_b07_tc/core/thermocoupletype.py create mode 100644 datamodel_b07_tc/core/tubing.py diff --git a/.gitignore b/.gitignore index a59ba44..e8d8cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ datasets/* *.pyc # generated python objects -datamodel_b07_tc/core +# datamodel_b07_tc/core # compiled bython files datamodel_b07_tc/__pycache__ diff --git a/datamodel_b07_tc/core/__init__.py b/datamodel_b07_tc/core/__init__.py new file mode 100644 index 0000000..f78e6ae --- /dev/null +++ b/datamodel_b07_tc/core/__init__.py @@ -0,0 +1,69 @@ +from .dataset import Dataset +from .generalinformation import GeneralInformation +from .author import Author +from .experiment import Experiment +from .plantsetup import PlantSetup +from .device import Device +from .pump import Pump +from .thermocouple import Thermocouple +from .massflowmeter import MassFlowMeter +from .parameter import Parameter +from .potentiostat import Potentiostat +from .tubing import Tubing +from .insulation import Insulation +from .input import Input +from .output import Output +from .chemical import Chemical +from .stoichiometry import Stoichiometry +from .data import Data +from .metadata import Metadata +from .measurement import Measurement +from .speciesdata import SpeciesData +from .calibration import Calibration +from .datatype import DataType +from .thermocoupletype import ThermocoupleType +from .material import Material +from .pumptype import PumpType +from .reactantrole import ReactantRole +from .devicelist import DeviceList +from .quantity import Quantity +from .measurementtype import MeasurementType +from .species import Species +from .chemicalformula import ChemicalFormula + +__doc__ = "" + +__all__ = [ + "Dataset", + "GeneralInformation", + "Author", + "Experiment", + "PlantSetup", + "Device", + "Pump", + "Thermocouple", + "MassFlowMeter", + "Parameter", + "Potentiostat", + "Tubing", + "Insulation", + "Input", + "Output", + "Chemical", + "Stoichiometry", + "Data", + "Metadata", + "Measurement", + "SpeciesData", + "Calibration", + "DataType", + "ThermocoupleType", + "Material", + "PumpType", + "ReactantRole", + "DeviceList", + "Quantity", + "MeasurementType", + "Species", + "ChemicalFormula", +] diff --git a/datamodel_b07_tc/core/analysis.py b/datamodel_b07_tc/core/analysis.py new file mode 100644 index 0000000..bdfcf6f --- /dev/null +++ b/datamodel_b07_tc/core/analysis.py @@ -0,0 +1,113 @@ +import sdRDM + +from typing import Optional, Union, List +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + +from datetime import datetime as Datetime +from astropy.units import UnitBase + +from .quantity import Quantity +from .data import Data +from .species import Species +from .calibration import Calibration + + +@forge_signature +class Analysis(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("analysisINDEX"), + xml="@id", + ) + + calibrations: List[Calibration] = Field( + default_factory=ListPlus, + multiple=True, + description="Calibration measurement.", + ) + + faraday_coefficients: List[Data] = Field( + default_factory=ListPlus, + multiple=True, + description="Faraday coefficients.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="a4c50b26815a02cca2986380d5aeb8c023e877eb" + ) + + def add_to_calibrations( + self, + species: Optional[Species] = None, + peak_areas: Optional[Data] = None, + concentrations: Optional[Data] = None, + slope: Optional[Data] = None, + intercept: Optional[Data] = None, + coefficient_of_determination: Optional[Data] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Calibration' to attribute calibrations + + Args: + id (str): Unique identifier of the 'Calibration' object. Defaults to 'None'. + species (): Species for which the calibration was performed.. Defaults to None + peak_areas (): Recorded peak areas of the individual calibration solutions.. Defaults to None + concentrations (): concentrations of the individual calibration solutions.. Defaults to None + slope (): slopes of the (linear) calibration functions.. Defaults to None + intercept (): intercept of the (linear) calibration functions.. Defaults to None + coefficient_of_determination (): coefficients of the (linear) calibration functions.. Defaults to None + """ + + params = { + "species": species, + "peak_areas": peak_areas, + "concentrations": concentrations, + "slope": slope, + "intercept": intercept, + "coefficient_of_determination": coefficient_of_determination, + } + + if id is not None: + params["id"] = id + + self.calibrations.append(Calibration(**params)) + + return self.calibrations[-1] + + def add_to_faraday_coefficients( + self, + quantity: Optional[Quantity] = None, + values: List[Union[float, str, Datetime]] = ListPlus(), + unit: Optional[UnitBase] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Data' to attribute faraday_coefficients + + Args: + id (str): Unique identifier of the 'Data' object. Defaults to 'None'. + quantity (): quantity of a value.. Defaults to None + values (): values.. Defaults to ListPlus() + unit (): unit of the values.. Defaults to None + """ + + params = { + "quantity": quantity, + "values": values, + "unit": unit, + } + + if id is not None: + params["id"] = id + + self.faraday_coefficients.append(Data(**params)) + + return self.faraday_coefficients[-1] \ No newline at end of file diff --git a/datamodel_b07_tc/core/author.py b/datamodel_b07_tc/core/author.py new file mode 100644 index 0000000..d57a995 --- /dev/null +++ b/datamodel_b07_tc/core/author.py @@ -0,0 +1,33 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +@forge_signature +class Author(sdRDM.DataModel): + """This is another object that represents the author of the dataset. Please note, that the options here contain all required fields but also custom ones. In this example, the ```Dataverse``` option specifies where each field should be mapped, when exported to a Dataverse format. Hence, these options allow you to link your dataset towards any other data model without writing code by yourself.""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("authorINDEX"), + xml="@id", + ) + + name: Optional[str] = Field( + default=None, + description="full name including given and family name.", + ) + + affiliation: Optional[str] = Field( + default=None, + description="organization the author is affiliated to.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/calibration.py b/datamodel_b07_tc/core/calibration.py new file mode 100644 index 0000000..2ed75bc --- /dev/null +++ b/datamodel_b07_tc/core/calibration.py @@ -0,0 +1,51 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .data import Data + + +@forge_signature +class Calibration(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("calibrationINDEX"), + xml="@id", + ) + + peak_areas: Optional[Data] = Field( + default=Data(), + description="Recorded peak areas of the individual calibration solutions.", + ) + + concentrations: Optional[Data] = Field( + default=Data(), + description="concentrations of the individual calibration solutions.", + ) + + slope: Optional[Data] = Field( + default=Data(), + description="slopes of the (linear) calibration functions.", + ) + + intercept: Optional[Data] = Field( + default=Data(), + description="intercept of the (linear) calibration functions.", + ) + + coefficient_of_determination: Optional[Data] = Field( + default=Data(), + description="coefficients of the (linear) calibration functions.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/chemical.py b/datamodel_b07_tc/core/chemical.py new file mode 100644 index 0000000..061528c --- /dev/null +++ b/datamodel_b07_tc/core/chemical.py @@ -0,0 +1,69 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .stoichiometry import Stoichiometry +from .reactantrole import ReactantRole + + +@forge_signature +class Chemical(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("chemicalINDEX"), + xml="@id", + ) + + name: List[str] = Field( + description="IUPAC name of the compound.", + default_factory=ListPlus, + multiple=True, + ) + + formula: Optional[str] = Field( + default=None, + description="molecular formula of the compound.", + ) + + pureness: Optional[float] = Field( + default=None, + description="pureness of the compound in percent.", + ) + + supplier: Optional[str] = Field( + default=None, + description="name of the supplier of the compound.", + ) + + stoichiometry: Optional[Stoichiometry] = Field( + default=Stoichiometry(), + description=( + "stoichiometric information like equivalents, mass, amount of substance," + " volume" + ), + ) + + state_of_matter: Optional[str] = Field( + default=None, + description="s for solid, l for liquid and g for gaseous", + ) + + reactant_role: Optional[ReactantRole] = Field( + default=None, + description=( + "Role that a reactand plays in a chemical reaction or in a process." + ), + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/chemicalformula.py b/datamodel_b07_tc/core/chemicalformula.py new file mode 100644 index 0000000..55d6c72 --- /dev/null +++ b/datamodel_b07_tc/core/chemicalformula.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ChemicalFormula(Enum): + H2 = "H2" + CO2 = "CO2" + CO = "CO" + CH4 = "CH4" + C2H4 = "C2H4" + C2H6 = "C2H6" diff --git a/datamodel_b07_tc/core/data.py b/datamodel_b07_tc/core/data.py new file mode 100644 index 0000000..d9d3c29 --- /dev/null +++ b/datamodel_b07_tc/core/data.py @@ -0,0 +1,45 @@ +import sdRDM + +from typing import Optional, Union, List +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + +from astropy.units import UnitBase +from datetime import datetime as Datetime + +from .quantity import Quantity + + +@forge_signature +class Data(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("dataINDEX"), + xml="@id", + ) + + quantity: Optional[Quantity] = Field( + default=None, + description="quantity of a value.", + ) + + values: List[Union[float, str, Datetime]] = Field( + default_factory=ListPlus, + multiple=True, + description="values.", + ) + + unit: Optional[UnitBase] = Field( + default=None, + description="unit of the values.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/dataset.py b/datamodel_b07_tc/core/dataset.py new file mode 100644 index 0000000..cf6a123 --- /dev/null +++ b/datamodel_b07_tc/core/dataset.py @@ -0,0 +1,72 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .speciesdata import SpeciesData +from .generalinformation import GeneralInformation +from .experiment import Experiment +from .measurement import Measurement +from .plantsetup import PlantSetup + + +@forge_signature +class Dataset(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("datasetINDEX"), + xml="@id", + ) + + general_information: Optional[GeneralInformation] = Field( + default=GeneralInformation(), + description="general data about the data model.", + ) + + experiments: List[Experiment] = Field( + default_factory=ListPlus, + multiple=True, + description="information about the individual experiment.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_experiments( + self, + plant_setup: Optional[PlantSetup] = None, + measurements: List[Measurement] = ListPlus(), + species_data: List[SpeciesData] = ListPlus(), + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Experiment' to attribute experiments + + Args: + id (str): Unique identifier of the 'Experiment' object. Defaults to 'None'. + plant_setup (): the individual plant setup that is used in this one experiment.. Defaults to None + measurements (): different measurements that are made within the scope of one experiment.. Defaults to ListPlus() + species_data (): all provided and calculated data about a specific species.. Defaults to ListPlus() + """ + + params = { + "plant_setup": plant_setup, + "measurements": measurements, + "species_data": species_data, + } + + if id is not None: + params["id"] = id + + self.experiments.append(Experiment(**params)) + + return self.experiments[-1] diff --git a/datamodel_b07_tc/core/datatype.py b/datamodel_b07_tc/core/datatype.py new file mode 100644 index 0000000..f75edf1 --- /dev/null +++ b/datamodel_b07_tc/core/datatype.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class DataType(Enum): + STRING = "string" + FLOAT = "float" + DATE = "date" + TIME = "time" + DATETIME = "datetime" + BOOLEAN = "Boolean" + INTEGER = "int" + NONE = "NONE" + LABEL = "label" diff --git a/datamodel_b07_tc/core/device.py b/datamodel_b07_tc/core/device.py new file mode 100644 index 0000000..991d2be --- /dev/null +++ b/datamodel_b07_tc/core/device.py @@ -0,0 +1,43 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +@forge_signature +class Device(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("deviceINDEX"), + xml="@id", + ) + + manufacturer: Optional[str] = Field( + default=None, + description="name of the manufacturer of the device.", + ) + + device_type: Optional[str] = Field( + default=None, + description="type given by the manufacturer of the device.", + ) + + series: Optional[str] = Field( + default=None, + description="the series of the device.", + ) + + on_off: Optional[bool] = Field( + default=None, + description="operational mode of the flow module. True is on and False is off.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/devicelist.py b/datamodel_b07_tc/core/devicelist.py new file mode 100644 index 0000000..3b6e7a5 --- /dev/null +++ b/datamodel_b07_tc/core/devicelist.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DeviceList(Enum): + MASSFLOWCONTROLLER = "Mass flow controller" + HPLC = "HPLC" + GC = "GC" + POTENTIOSTAT = "Potentiostat" + PRESSURETRANSDUCER = "Pressure transducer" + CONTROLUNIT = "Control unit" diff --git a/datamodel_b07_tc/core/experiment.py b/datamodel_b07_tc/core/experiment.py new file mode 100644 index 0000000..609a62a --- /dev/null +++ b/datamodel_b07_tc/core/experiment.py @@ -0,0 +1,123 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .speciesdata import SpeciesData +from .species import Species +from .chemicalformula import ChemicalFormula +from .metadata import Metadata +from .calibration import Calibration +from .data import Data +from .measurementtype import MeasurementType +from .measurement import Measurement +from .plantsetup import PlantSetup + + +@forge_signature +class Experiment(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("experimentINDEX"), + xml="@id", + ) + + plant_setup: Optional[PlantSetup] = Field( + default=PlantSetup(), + description="the individual plant setup that is used in this one experiment.", + ) + + measurements: List[Measurement] = Field( + default_factory=ListPlus, + multiple=True, + description=( + "different measurements that are made within the scope of one experiment." + ), + ) + + species_data: List[SpeciesData] = Field( + default_factory=ListPlus, + multiple=True, + description="all provided and calculated data about a specific species.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_measurements( + self, + measurement_type: Optional[MeasurementType] = None, + metadata: List[Metadata] = ListPlus(), + experimental_data: List[Data] = ListPlus(), + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Measurement' to attribute measurements + + Args: + id (str): Unique identifier of the 'Measurement' object. Defaults to 'None'. + measurement_type (): type of a measurement, e.g. potentiostatic or gas chromatography.. Defaults to None + metadata (): metadata of a measurement.. Defaults to ListPlus() + experimental_data (): experimental data of a measurement.. Defaults to ListPlus() + """ + + params = { + "measurement_type": measurement_type, + "metadata": metadata, + "experimental_data": experimental_data, + } + + if id is not None: + params["id"] = id + + self.measurements.append(Measurement(**params)) + + return self.measurements[-1] + + def add_to_species_data( + self, + species: Optional[Species] = None, + chemical_formula: Optional[ChemicalFormula] = None, + calibration: Optional[Calibration] = None, + correction_factor: Optional[Data] = None, + faraday_coefficient: Optional[Data] = None, + faraday_efficiency: Optional[Data] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'SpeciesData' to attribute species_data + + Args: + id (str): Unique identifier of the 'SpeciesData' object. Defaults to 'None'. + species (): name of the species.. Defaults to None + chemical_formula (): chemical formula of the species.. Defaults to None + calibration (): calibration measurement.. Defaults to None + correction_factor (): correction factors of the individual species.. Defaults to None + faraday_coefficient (): Faraday coefficients of the individual species.. Defaults to None + faraday_efficiency (): Faraday efficiencies of the individual species.. Defaults to None + """ + + params = { + "species": species, + "chemical_formula": chemical_formula, + "calibration": calibration, + "correction_factor": correction_factor, + "faraday_coefficient": faraday_coefficient, + "faraday_efficiency": faraday_efficiency, + } + + if id is not None: + params["id"] = id + + self.species_data.append(SpeciesData(**params)) + + return self.species_data[-1] diff --git a/datamodel_b07_tc/core/generalinformation.py b/datamodel_b07_tc/core/generalinformation.py new file mode 100644 index 0000000..3081405 --- /dev/null +++ b/datamodel_b07_tc/core/generalinformation.py @@ -0,0 +1,70 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .author import Author + + +@forge_signature +class GeneralInformation(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("generalinformationINDEX"), + xml="@id", + ) + + title: Optional[str] = Field( + default=None, + description="title of the work.", + ) + + description: Optional[str] = Field( + default=None, + description="describes the content of the dataset.", + ) + + authors: List[Author] = Field( + default_factory=ListPlus, + multiple=True, + description="authors of this dataset.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_authors( + self, + name: Optional[str] = None, + affiliation: Optional[str] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Author' to attribute authors + + Args: + id (str): Unique identifier of the 'Author' object. Defaults to 'None'. + name (): full name including given and family name.. Defaults to None + affiliation (): organization the author is affiliated to.. Defaults to None + """ + + params = { + "name": name, + "affiliation": affiliation, + } + + if id is not None: + params["id"] = id + + self.authors.append(Author(**params)) + + return self.authors[-1] diff --git a/datamodel_b07_tc/core/input.py b/datamodel_b07_tc/core/input.py new file mode 100644 index 0000000..005ce2c --- /dev/null +++ b/datamodel_b07_tc/core/input.py @@ -0,0 +1,77 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .reactantrole import ReactantRole +from .stoichiometry import Stoichiometry +from .chemical import Chemical + + +@forge_signature +class Input(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("inputINDEX"), + xml="@id", + ) + + component: List[Chemical] = Field( + default_factory=ListPlus, + multiple=True, + description="component of the output fluid.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_component( + self, + name: List[str] = ListPlus(), + formula: Optional[str] = None, + pureness: Optional[float] = None, + supplier: Optional[str] = None, + stoichiometry: Optional[Stoichiometry] = None, + state_of_matter: Optional[str] = None, + reactant_role: Optional[ReactantRole] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Chemical' to attribute component + + Args: + id (str): Unique identifier of the 'Chemical' object. Defaults to 'None'. + name (): IUPAC name of the compound.. Defaults to ListPlus() + formula (): molecular formula of the compound.. Defaults to None + pureness (): pureness of the compound in percent.. Defaults to None + supplier (): name of the supplier of the compound.. Defaults to None + stoichiometry (): stoichiometric information like equivalents, mass, amount of substance, volume. Defaults to None + state_of_matter (): s for solid, l for liquid and g for gaseous. Defaults to None + reactant_role (): Role that a reactand plays in a chemical reaction or in a process.. Defaults to None + """ + + params = { + "name": name, + "formula": formula, + "pureness": pureness, + "supplier": supplier, + "stoichiometry": stoichiometry, + "state_of_matter": state_of_matter, + "reactant_role": reactant_role, + } + + if id is not None: + params["id"] = id + + self.component.append(Chemical(**params)) + + return self.component[-1] diff --git a/datamodel_b07_tc/core/insulation.py b/datamodel_b07_tc/core/insulation.py new file mode 100644 index 0000000..8a01a29 --- /dev/null +++ b/datamodel_b07_tc/core/insulation.py @@ -0,0 +1,36 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .material import Material + + +@forge_signature +class Insulation(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("insulationINDEX"), + xml="@id", + ) + + thickness: Optional[float] = Field( + default=None, + description="diameter of the insulating layer in mm.", + ) + + material: Optional[Material] = Field( + default=None, + description="insulating material", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/massflowmeter.py b/datamodel_b07_tc/core/massflowmeter.py new file mode 100644 index 0000000..aea807b --- /dev/null +++ b/datamodel_b07_tc/core/massflowmeter.py @@ -0,0 +1,36 @@ + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .parameter import Parameter +from .device import Device + + +@forge_signature +class MassFlowMeter(Device): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("massflowmeterINDEX"), + xml="@id", + ) + + min_flow: Optional[Parameter] = Field( + default=Parameter(), + description="Minimum possible flow rate.", + ) + + max_flow: Optional[Parameter] = Field( + default=Parameter(), + description="Maximum possible flow rate.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/material.py b/datamodel_b07_tc/core/material.py new file mode 100644 index 0000000..7d5ce88 --- /dev/null +++ b/datamodel_b07_tc/core/material.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class Material(Enum): + SS14404 = "Stainless Steel 1.4404" + SS14571 = "Stainless Steel 1.4571" + SS14301 = "Stainless Steel 1.4301" + PTFE = "PTFE" + PFA = "PFA" + STONEWOOL = "Stone Wool" + GLASSWOOL = "Glass Wool" + GLASSFIBER = "Glass Fiber" diff --git a/datamodel_b07_tc/core/measurement.py b/datamodel_b07_tc/core/measurement.py new file mode 100644 index 0000000..0597d3e --- /dev/null +++ b/datamodel_b07_tc/core/measurement.py @@ -0,0 +1,122 @@ +import sdRDM + +from typing import Optional, Union, List +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + +from astropy.units import UnitBase +from datetime import datetime as Datetime + +from .quantity import Quantity +from .data import Data +from .measurementtype import MeasurementType +from .metadata import Metadata +from .datatype import DataType + + +@forge_signature +class Measurement(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("measurementINDEX"), + xml="@id", + ) + + measurement_type: Optional[MeasurementType] = Field( + default=None, + description="type of a measurement, e.g. potentiostatic or gas chromatography.", + ) + + metadata: List[Metadata] = Field( + default_factory=ListPlus, + multiple=True, + description="metadata of a measurement.", + ) + + experimental_data: List[Data] = Field( + default_factory=ListPlus, + multiple=True, + description="experimental data of a measurement.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_metadata( + self, + parameter: Optional[str] = None, + value: Union[str, float, Datetime, None] = None, + abbreviation: Optional[str] = None, + data_type: Union[DataType, str, None] = None, + mode: Optional[str] = None, + unit: Optional[UnitBase] = None, + description: Optional[str] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Metadata' to attribute metadata + + Args: + id (str): Unique identifier of the 'Metadata' object. Defaults to 'None'. + parameter (): Name of the parameter.. Defaults to None + value (): value of the parameter.. Defaults to None + abbreviation (): abbreviation for the parameter.. Defaults to None + data_type (): type of the parameter.. Defaults to None + mode (): mode of the parameter. E.g., on and off.. Defaults to None + unit (): unit of the parameter.. Defaults to None + description (): description of the parameter.. Defaults to None + """ + + params = { + "parameter": parameter, + "value": value, + "abbreviation": abbreviation, + "data_type": data_type, + "mode": mode, + "unit": unit, + "description": description, + } + + if id is not None: + params["id"] = id + + self.metadata.append(Metadata(**params)) + + return self.metadata[-1] + + def add_to_experimental_data( + self, + quantity: Optional[Quantity] = None, + values: List[Union[float, str, Datetime]] = ListPlus(), + unit: Optional[UnitBase] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Data' to attribute experimental_data + + Args: + id (str): Unique identifier of the 'Data' object. Defaults to 'None'. + quantity (): quantity of a value.. Defaults to None + values (): values.. Defaults to ListPlus() + unit (): unit of the values.. Defaults to None + """ + + params = { + "quantity": quantity, + "values": values, + "unit": unit, + } + + if id is not None: + params["id"] = id + + self.experimental_data.append(Data(**params)) + + return self.experimental_data[-1] diff --git a/datamodel_b07_tc/core/measurementtype.py b/datamodel_b07_tc/core/measurementtype.py new file mode 100644 index 0000000..f50103d --- /dev/null +++ b/datamodel_b07_tc/core/measurementtype.py @@ -0,0 +1,7 @@ +from enum import Enum + + +class MeasurementType(Enum): + POTENTIOSTATIC = "Potentiostatic measurement" + GC = "GC measurement" + MFM = "MFM measurement" diff --git a/datamodel_b07_tc/core/metadata.py b/datamodel_b07_tc/core/metadata.py new file mode 100644 index 0000000..aaf1773 --- /dev/null +++ b/datamodel_b07_tc/core/metadata.py @@ -0,0 +1,63 @@ +import sdRDM + +from typing import Optional, Union +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + +from astropy.units import UnitBase +from datetime import datetime as Datetime + +from .datatype import DataType + + +@forge_signature +class Metadata(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("metadataINDEX"), + xml="@id", + ) + + parameter: Optional[str] = Field( + default=None, + description="Name of the parameter.", + ) + + value: Union[str, float, Datetime, None] = Field( + default=None, + description="value of the parameter.", + ) + + abbreviation: Optional[str] = Field( + default=None, + description="abbreviation for the parameter.", + ) + + data_type: Union[DataType, str, None] = Field( + default=None, + description="type of the parameter.", + ) + + mode: Optional[str] = Field( + default=None, + description="mode of the parameter. E.g., on and off.", + ) + + unit: Optional[UnitBase] = Field( + default=None, + description="unit of the parameter.", + ) + + description: Optional[str] = Field( + default=None, + description="description of the parameter.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/output.py b/datamodel_b07_tc/core/output.py new file mode 100644 index 0000000..2714241 --- /dev/null +++ b/datamodel_b07_tc/core/output.py @@ -0,0 +1,77 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .reactantrole import ReactantRole +from .stoichiometry import Stoichiometry +from .chemical import Chemical + + +@forge_signature +class Output(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("outputINDEX"), + xml="@id", + ) + + component: List[Chemical] = Field( + default_factory=ListPlus, + multiple=True, + description="component of the output fluid.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_component( + self, + name: List[str] = ListPlus(), + formula: Optional[str] = None, + pureness: Optional[float] = None, + supplier: Optional[str] = None, + stoichiometry: Optional[Stoichiometry] = None, + state_of_matter: Optional[str] = None, + reactant_role: Optional[ReactantRole] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Chemical' to attribute component + + Args: + id (str): Unique identifier of the 'Chemical' object. Defaults to 'None'. + name (): IUPAC name of the compound.. Defaults to ListPlus() + formula (): molecular formula of the compound.. Defaults to None + pureness (): pureness of the compound in percent.. Defaults to None + supplier (): name of the supplier of the compound.. Defaults to None + stoichiometry (): stoichiometric information like equivalents, mass, amount of substance, volume. Defaults to None + state_of_matter (): s for solid, l for liquid and g for gaseous. Defaults to None + reactant_role (): Role that a reactand plays in a chemical reaction or in a process.. Defaults to None + """ + + params = { + "name": name, + "formula": formula, + "pureness": pureness, + "supplier": supplier, + "stoichiometry": stoichiometry, + "state_of_matter": state_of_matter, + "reactant_role": reactant_role, + } + + if id is not None: + params["id"] = id + + self.component.append(Chemical(**params)) + + return self.component[-1] diff --git a/datamodel_b07_tc/core/parameter.py b/datamodel_b07_tc/core/parameter.py new file mode 100644 index 0000000..3b13b1d --- /dev/null +++ b/datamodel_b07_tc/core/parameter.py @@ -0,0 +1,35 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + +from astropy.units import UnitBase + + +@forge_signature +class Parameter(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("parameterINDEX"), + xml="@id", + ) + + value: Optional[float] = Field( + default=None, + description="values.", + ) + + unit: Optional[UnitBase] = Field( + default=None, + description="unit of the values.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/plantsetup.py b/datamodel_b07_tc/core/plantsetup.py new file mode 100644 index 0000000..146bed6 --- /dev/null +++ b/datamodel_b07_tc/core/plantsetup.py @@ -0,0 +1,170 @@ +import sdRDM + +from typing import List, Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.listplus import ListPlus +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .output import Output +from .material import Material +from .tubing import Tubing +from .insulation import Insulation +from .chemical import Chemical +from .input import Input +from .device import Device + + +@forge_signature +class PlantSetup(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("plantsetupINDEX"), + xml="@id", + ) + + devices: List[Device] = Field( + default_factory=ListPlus, + multiple=True, + description="bla", + ) + + tubing: List[Tubing] = Field( + default_factory=ListPlus, + multiple=True, + description="bla", + ) + + input: List[Input] = Field( + default_factory=ListPlus, + multiple=True, + description="bla", + ) + + output: List[Output] = Field( + default_factory=ListPlus, + multiple=True, + description="bla", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) + + def add_to_devices( + self, + manufacturer: Optional[str] = None, + device_type: Optional[str] = None, + series: Optional[str] = None, + on_off: Optional[bool] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Device' to attribute devices + + Args: + id (str): Unique identifier of the 'Device' object. Defaults to 'None'. + manufacturer (): name of the manufacturer of the device.. Defaults to None + device_type (): type given by the manufacturer of the device.. Defaults to None + series (): the series of the device.. Defaults to None + on_off (): operational mode of the flow module. True is on and False is off.. Defaults to None + """ + + params = { + "manufacturer": manufacturer, + "device_type": device_type, + "series": series, + "on_off": on_off, + } + + if id is not None: + params["id"] = id + + self.devices.append(Device(**params)) + + return self.devices[-1] + + def add_to_tubing( + self, + material: Optional[Material] = None, + inner_diameter: Optional[float] = None, + outer_diameter: Optional[float] = None, + length: Optional[int] = None, + insulation: Optional[Insulation] = None, + id: Optional[str] = None, + ) -> None: + """ + This method adds an object of type 'Tubing' to attribute tubing + + Args: + id (str): Unique identifier of the 'Tubing' object. Defaults to 'None'. + material (): material with which the fluid flowing through comes into contact.. Defaults to None + inner_diameter (): inner diameter of the tubing in mm.. Defaults to None + outer_diameter (): outer diameter of the tubing in mm.. Defaults to None + length (): length of the tubing in mm.. Defaults to None + insulation (): insulation of the tubing.. Defaults to None + """ + + params = { + "material": material, + "inner_diameter": inner_diameter, + "outer_diameter": outer_diameter, + "length": length, + "insulation": insulation, + } + + if id is not None: + params["id"] = id + + self.tubing.append(Tubing(**params)) + + return self.tubing[-1] + + def add_to_input( + self, component: List[Chemical] = ListPlus(), id: Optional[str] = None + ) -> None: + """ + This method adds an object of type 'Input' to attribute input + + Args: + id (str): Unique identifier of the 'Input' object. Defaults to 'None'. + component (): component of the output fluid.. Defaults to ListPlus() + """ + + params = { + "component": component, + } + + if id is not None: + params["id"] = id + + self.input.append(Input(**params)) + + return self.input[-1] + + def add_to_output( + self, component: List[Chemical] = ListPlus(), id: Optional[str] = None + ) -> None: + """ + This method adds an object of type 'Output' to attribute output + + Args: + id (str): Unique identifier of the 'Output' object. Defaults to 'None'. + component (): component of the output fluid.. Defaults to ListPlus() + """ + + params = { + "component": component, + } + + if id is not None: + params["id"] = id + + self.output.append(Output(**params)) + + return self.output[-1] diff --git a/datamodel_b07_tc/core/potentiostat.py b/datamodel_b07_tc/core/potentiostat.py new file mode 100644 index 0000000..37f3d0c --- /dev/null +++ b/datamodel_b07_tc/core/potentiostat.py @@ -0,0 +1,37 @@ + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .measurement import Measurement +from .metadata import Metadata +from .device import Device + + +@forge_signature +class Potentiostat(Device): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("potentiostatINDEX"), + xml="@id", + ) + + measurement: Optional[Measurement] = Field( + default=Measurement(), + description="Measuring Data.", + ) + + metadata: Optional[Metadata] = Field( + default=Metadata(), + description="Metadata of the Potentiostat.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/pump.py b/datamodel_b07_tc/core/pump.py new file mode 100644 index 0000000..01e1efb --- /dev/null +++ b/datamodel_b07_tc/core/pump.py @@ -0,0 +1,31 @@ + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .pumptype import PumpType +from .device import Device + + +@forge_signature +class Pump(Device): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("pumpINDEX"), + xml="@id", + ) + + pump_type: Optional[PumpType] = Field( + default=None, + description="type of the pump.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/pumptype.py b/datamodel_b07_tc/core/pumptype.py new file mode 100644 index 0000000..73a4a9f --- /dev/null +++ b/datamodel_b07_tc/core/pumptype.py @@ -0,0 +1,6 @@ +from enum import Enum + + +class PumpType(Enum): + TUBINGPUMP = "Tubing pump" + DIAPHRAGMPUMP = "Diaphragm pump" diff --git a/datamodel_b07_tc/core/quantity.py b/datamodel_b07_tc/core/quantity.py new file mode 100644 index 0000000..a0384e8 --- /dev/null +++ b/datamodel_b07_tc/core/quantity.py @@ -0,0 +1,23 @@ +from enum import Enum + + +class Quantity(Enum): + TIME = "Time" + VOLTAGE = "Voltage" + CURRENT = "Current" + CONCENTRATION = "Concentration" + MASS = "Mass" + MASSFLOWRATE = "Mass flow rate" + VOLUMETRICFLOWRATE = "Volumetric flow rate" + DATETIME = "Date time" + FRACTION = "Fraction" + SIGNAL = "Signal" + PEAKNUMBER = "Peak number" + RETENTIONTIME = "Retention time" + PEAKTYPE = "Peak type" + PEAKAREA = "Peak area" + PEAKHEIGHT = "Peak height" + PEAKAREAPERCENTAGE = "Peak area percentage" + SLOPE = "Slope" + INTERCEPT = "Intercept" + COEFFDET = "Coefficient of determination" diff --git a/datamodel_b07_tc/core/reactantrole.py b/datamodel_b07_tc/core/reactantrole.py new file mode 100644 index 0000000..64a3134 --- /dev/null +++ b/datamodel_b07_tc/core/reactantrole.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ReactantRole(Enum): + EDUCT = "Educt" + PRODUCT = "Product" + CATALYST = "Catalyst" + SOLVENT = "Solvent" + INERTGAS = "Inert Gas" diff --git a/datamodel_b07_tc/core/species.py b/datamodel_b07_tc/core/species.py new file mode 100644 index 0000000..e53786a --- /dev/null +++ b/datamodel_b07_tc/core/species.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class Species(Enum): + HYDROGEN = "Hydrogen" + CARBONDIOXIDE = "Carbon dioxide" + CARBONMONOXIDE = "Carbon monoxide" + METHANE = "Methane" + ETHENE = "Ethene" + ETHANE = "Ethane" diff --git a/datamodel_b07_tc/core/speciesdata.py b/datamodel_b07_tc/core/speciesdata.py new file mode 100644 index 0000000..736ecfc --- /dev/null +++ b/datamodel_b07_tc/core/speciesdata.py @@ -0,0 +1,59 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .species import Species +from .data import Data +from .chemicalformula import ChemicalFormula +from .calibration import Calibration + + +@forge_signature +class SpeciesData(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("speciesdataINDEX"), + xml="@id", + ) + + species: Optional[Species] = Field( + default=None, + description="name of the species.", + ) + + chemical_formula: Optional[ChemicalFormula] = Field( + default=None, + description="chemical formula of the species.", + ) + + calibration: Optional[Calibration] = Field( + default=Calibration(), + description="calibration measurement.", + ) + + correction_factor: Optional[Data] = Field( + default=Data(), + description="correction factors of the individual species.", + ) + + faraday_coefficient: Optional[Data] = Field( + default=Data(), + description="Faraday coefficients of the individual species.", + ) + + faraday_efficiency: Optional[Data] = Field( + default=Data(), + description="Faraday efficiencies of the individual species.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/stoichiometry.py b/datamodel_b07_tc/core/stoichiometry.py new file mode 100644 index 0000000..c196dcd --- /dev/null +++ b/datamodel_b07_tc/core/stoichiometry.py @@ -0,0 +1,63 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +@forge_signature +class Stoichiometry(sdRDM.DataModel): + """Stoichiometric information about the compound.""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("stoichiometryINDEX"), + xml="@id", + ) + + equivalents: Optional[float] = Field( + default=None, + description="used equivalents in relation to the reference compound", + ) + + amount_of_substance: Optional[float] = Field( + default=None, + description="amount of substance n in mmol", + ) + + mass: Optional[float] = Field( + default=None, + description="used mass of the compound in g", + ) + + volume: Optional[float] = Field( + default=None, + description="volume of the compound", + ) + + density: Optional[float] = Field( + default=None, + description="density of the compound at standard temperature and pressure.", + ) + + molar_mass: Optional[float] = Field( + default=None, + description="molar mass of the compound in g per mol", + ) + + mass_concentration: Optional[float] = Field( + default=None, + description="mass concentration in percent.", + ) + + molar_concentration: Optional[float] = Field( + default=None, + description="molar concentration in mol per l.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/thermocouple.py b/datamodel_b07_tc/core/thermocouple.py new file mode 100644 index 0000000..3c8164c --- /dev/null +++ b/datamodel_b07_tc/core/thermocouple.py @@ -0,0 +1,31 @@ + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .thermocoupletype import ThermocoupleType +from .device import Device + + +@forge_signature +class Thermocouple(Device): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("thermocoupleINDEX"), + xml="@id", + ) + + thermocouple_type: Optional[ThermocoupleType] = Field( + default=None, + description="type of thermocouple like J, K and so on.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + ) diff --git a/datamodel_b07_tc/core/thermocoupletype.py b/datamodel_b07_tc/core/thermocoupletype.py new file mode 100644 index 0000000..25968fd --- /dev/null +++ b/datamodel_b07_tc/core/thermocoupletype.py @@ -0,0 +1,6 @@ +from enum import Enum + + +class ThermocoupleType(Enum): + JTYPE = "Type J" + KTYPE = "Type K" diff --git a/datamodel_b07_tc/core/tubing.py b/datamodel_b07_tc/core/tubing.py new file mode 100644 index 0000000..1fa3dbe --- /dev/null +++ b/datamodel_b07_tc/core/tubing.py @@ -0,0 +1,52 @@ +import sdRDM + +from typing import Optional +from pydantic import Field, PrivateAttr +from sdRDM.base.utils import forge_signature, IDGenerator + + +from .material import Material +from .insulation import Insulation + + +@forge_signature +class Tubing(sdRDM.DataModel): + """""" + + id: Optional[str] = Field( + description="Unique identifier of the given object.", + default_factory=IDGenerator("tubingINDEX"), + xml="@id", + ) + + material: Optional[Material] = Field( + default=None, + description="material with which the fluid flowing through comes into contact.", + ) + + inner_diameter: Optional[float] = Field( + default=None, + description="inner diameter of the tubing in mm.", + ) + + outer_diameter: Optional[float] = Field( + default=None, + description="outer diameter of the tubing in mm.", + ) + + length: Optional[int] = Field( + default=None, + description="length of the tubing in mm.", + ) + + insulation: Optional[Insulation] = Field( + default=Insulation(), + description="insulation of the tubing.", + ) + + __repo__: Optional[str] = PrivateAttr( + default="https://github.com/FAIRChemistry/datamodel_b07_tc.git" + ) + __commit__: Optional[str] = PrivateAttr( + default="84c47e3b42d9bd24447f9f5668612ba7a70e39c3" + )