From 0fab85f2f771b0e8972781ca8bc0b4f10e1d393a Mon Sep 17 00:00:00 2001 From: sdRDM Bot Date: Mon, 1 Apr 2024 17:07:32 +0000 Subject: [PATCH] API update --- FAIRFlowChemistry/__init__.py | 2 +- FAIRFlowChemistry/core/calibration.py | 4 ++-- FAIRFlowChemistry/core/component.py | 6 ++--- FAIRFlowChemistry/core/data.py | 6 ++--- FAIRFlowChemistry/core/dataset.py | 12 +++++----- FAIRFlowChemistry/core/experiment.py | 12 +++++----- FAIRFlowChemistry/core/genericattibute.py | 4 ++-- FAIRFlowChemistry/core/measurement.py | 12 +++++----- FAIRFlowChemistry/core/metadata.py | 6 ++--- FAIRFlowChemistry/core/parameter.py | 4 ++-- FAIRFlowChemistry/core/plantsetup.py | 29 +++++++---------------- FAIRFlowChemistry/core/speciesdata.py | 6 ++--- 12 files changed, 45 insertions(+), 58 deletions(-) diff --git a/FAIRFlowChemistry/__init__.py b/FAIRFlowChemistry/__init__.py index 32df6ce..e767ac2 100644 --- a/FAIRFlowChemistry/__init__.py +++ b/FAIRFlowChemistry/__init__.py @@ -1,3 +1,3 @@ __URL__ = "https://github.com/FAIRChemistry/FAIRFlowChemistry" -__COMMIT__ = "1bb5f3b4519dae01439e0005d07224bae46e1d13" +__COMMIT__ = "2430ed60950545d51f2fa235656907e21e8d3ac4" diff --git a/FAIRFlowChemistry/core/calibration.py b/FAIRFlowChemistry/core/calibration.py index a2d564b..a015d39 100644 --- a/FAIRFlowChemistry/core/calibration.py +++ b/FAIRFlowChemistry/core/calibration.py @@ -14,7 +14,7 @@ class Calibration( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Calibration" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Calibration" }, ): """""" @@ -60,7 +60,7 @@ class Calibration( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def calibrate(self): diff --git a/FAIRFlowChemistry/core/component.py b/FAIRFlowChemistry/core/component.py index eeaa39b..dcc7c6c 100644 --- a/FAIRFlowChemistry/core/component.py +++ b/FAIRFlowChemistry/core/component.py @@ -6,15 +6,15 @@ from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature -from .componenttype import ComponentType from .genericattibute import GenericAttibute +from .componenttype import ComponentType @forge_signature class Component( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Component" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Component" }, ): """""" @@ -90,7 +90,7 @@ class Component( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def add_to_generic_attributes( diff --git a/FAIRFlowChemistry/core/data.py b/FAIRFlowChemistry/core/data.py index 15668fb..7d6e125 100644 --- a/FAIRFlowChemistry/core/data.py +++ b/FAIRFlowChemistry/core/data.py @@ -6,8 +6,8 @@ from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature -from datetime import datetime as Datetime from sdRDM.base.datatypes import Unit +from datetime import datetime as Datetime from .quantity import Quantity @@ -15,7 +15,7 @@ class Data( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Data" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Data" }, ): """""" @@ -54,5 +54,5 @@ class Data( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) diff --git a/FAIRFlowChemistry/core/dataset.py b/FAIRFlowChemistry/core/dataset.py index 0d54b03..037ac5c 100644 --- a/FAIRFlowChemistry/core/dataset.py +++ b/FAIRFlowChemistry/core/dataset.py @@ -6,17 +6,17 @@ from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature -from .plantsetup import PlantSetup -from .speciesdata import SpeciesData from .measurement import Measurement +from .plantsetup import PlantSetup from .experiment import Experiment +from .speciesdata import SpeciesData @forge_signature class GeneralInformation( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#GeneralInformation" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#GeneralInformation" }, ): """Small type for attribute 'general_information'""" @@ -41,7 +41,7 @@ class GeneralInformation( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) @@ -49,7 +49,7 @@ class GeneralInformation( class Dataset( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Dataset" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Dataset" }, ): """""" @@ -84,7 +84,7 @@ class Dataset( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def add_to_experiments( diff --git a/FAIRFlowChemistry/core/experiment.py b/FAIRFlowChemistry/core/experiment.py index 44c5ef7..99b381e 100644 --- a/FAIRFlowChemistry/core/experiment.py +++ b/FAIRFlowChemistry/core/experiment.py @@ -8,23 +8,23 @@ from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature -from .speciesdata import SpeciesData -from .calibration import Calibration +from .datatype import DataType from .plantsetup import PlantSetup +from .data import Data +from .speciesdata import SpeciesData from .component import Component from .quantity import Quantity from .measurementtype import MeasurementType from .measurement import Measurement -from .datatype import DataType from .metadata import Metadata -from .data import Data +from .calibration import Calibration @forge_signature class Experiment( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Experiment" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Experiment" }, ): """""" @@ -69,7 +69,7 @@ class Experiment( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def add_to_measurements( diff --git a/FAIRFlowChemistry/core/genericattibute.py b/FAIRFlowChemistry/core/genericattibute.py index d3f7096..9895c67 100644 --- a/FAIRFlowChemistry/core/genericattibute.py +++ b/FAIRFlowChemistry/core/genericattibute.py @@ -11,7 +11,7 @@ class GenericAttibute( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#GenericAttibute" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#GenericAttibute" }, ): """""" @@ -68,5 +68,5 @@ class GenericAttibute( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) diff --git a/FAIRFlowChemistry/core/measurement.py b/FAIRFlowChemistry/core/measurement.py index 36e4b10..e5d2401 100644 --- a/FAIRFlowChemistry/core/measurement.py +++ b/FAIRFlowChemistry/core/measurement.py @@ -6,21 +6,21 @@ from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature -from datetime import datetime as Datetime from sdRDM.base.datatypes import Unit -from .quantity import Quantity +from datetime import datetime as Datetime +from .datatype import DataType +from .data import Data from .component import Component +from .quantity import Quantity from .measurementtype import MeasurementType -from .datatype import DataType from .metadata import Metadata -from .data import Data @forge_signature class Measurement( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Measurement" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Measurement" }, ): """""" @@ -69,7 +69,7 @@ class Measurement( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def add_to_metadata( diff --git a/FAIRFlowChemistry/core/metadata.py b/FAIRFlowChemistry/core/metadata.py index d7ab06b..abe6e71 100644 --- a/FAIRFlowChemistry/core/metadata.py +++ b/FAIRFlowChemistry/core/metadata.py @@ -5,8 +5,8 @@ from uuid import uuid4 from pydantic_xml import attr, element from sdRDM.base.utils import forge_signature -from datetime import datetime as Datetime from sdRDM.base.datatypes import Unit +from datetime import datetime as Datetime from .datatype import DataType @@ -14,7 +14,7 @@ class Metadata( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Metadata" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Metadata" }, ): """""" @@ -78,5 +78,5 @@ class Metadata( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) diff --git a/FAIRFlowChemistry/core/parameter.py b/FAIRFlowChemistry/core/parameter.py index fd4d1fa..6896961 100644 --- a/FAIRFlowChemistry/core/parameter.py +++ b/FAIRFlowChemistry/core/parameter.py @@ -12,7 +12,7 @@ class Parameter( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Parameter" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Parameter" }, ): """""" @@ -41,5 +41,5 @@ class Parameter( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) diff --git a/FAIRFlowChemistry/core/plantsetup.py b/FAIRFlowChemistry/core/plantsetup.py index 3d1b8f1..a225245 100644 --- a/FAIRFlowChemistry/core/plantsetup.py +++ b/FAIRFlowChemistry/core/plantsetup.py @@ -1,23 +1,21 @@ import sdRDM from typing import List, Optional -from uuid import uuid4 from pydantic import PrivateAttr +from uuid import uuid4 from pydantic_xml import attr, element, wrapped from sdRDM.base.listplus import ListPlus from sdRDM.base.utils import forge_signature - - -from .componenttype import ComponentType -from .genericattibute import GenericAttibute from .component import Component +from .genericattibute import GenericAttibute +from .componenttype import ComponentType @forge_signature class PlantSetup( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#PlantSetup" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#PlantSetup" }, ): """""" @@ -35,9 +33,7 @@ class PlantSetup( description="bla.", default_factory=ListPlus, tag="Component", - json_schema_extra=dict( - multiple=True, - ), + json_schema_extra=dict(multiple=True), ), ) @@ -47,9 +43,7 @@ class PlantSetup( description="bla.", default_factory=ListPlus, tag="string", - json_schema_extra=dict( - multiple=True, - ), + json_schema_extra=dict(multiple=True), ), ) @@ -59,17 +53,14 @@ class PlantSetup( description="bla.", default_factory=ListPlus, tag="string", - json_schema_extra=dict( - multiple=True, - ), + json_schema_extra=dict(multiple=True), ), ) - _repo: Optional[str] = PrivateAttr( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" ) def add_to_components( @@ -96,7 +87,6 @@ def add_to_components( generic_attributes (): a generic attribute as defined by DEXPI.. Defaults to ListPlus() connections (): component id of other component this component is connected to via pipes, wires or similar.. Defaults to ListPlus() """ - params = { "component_type": component_type, "component_id": component_id, @@ -106,10 +96,7 @@ def add_to_components( "generic_attributes": generic_attributes, "connections": connections, } - if id is not None: params["id"] = id - self.components.append(Component(**params)) - return self.components[-1] diff --git a/FAIRFlowChemistry/core/speciesdata.py b/FAIRFlowChemistry/core/speciesdata.py index 44914ea..1195c16 100644 --- a/FAIRFlowChemistry/core/speciesdata.py +++ b/FAIRFlowChemistry/core/speciesdata.py @@ -5,15 +5,15 @@ from uuid import uuid4 from pydantic_xml import attr, element from sdRDM.base.utils import forge_signature -from .calibration import Calibration from .data import Data +from .calibration import Calibration @forge_signature class SpeciesData( sdRDM.DataModel, nsmap={ - "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#SpeciesData" + "": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#SpeciesData" }, ): """""" @@ -70,5 +70,5 @@ class SpeciesData( default="https://github.com/FAIRChemistry/FAIRFlowChemistry" ) _commit: Optional[str] = PrivateAttr( - default="1bb5f3b4519dae01439e0005d07224bae46e1d13" + default="2430ed60950545d51f2fa235656907e21e8d3ac4" )