Skip to content

Commit

Permalink
API update
Browse files Browse the repository at this point in the history
  • Loading branch information
sdRDM Bot authored and sdRDM Bot committed Apr 1, 2024
1 parent 2430ed6 commit 0fab85f
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 58 deletions.
2 changes: 1 addition & 1 deletion FAIRFlowChemistry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

__URL__ = "https://github.com/FAIRChemistry/FAIRFlowChemistry"
__COMMIT__ = "1bb5f3b4519dae01439e0005d07224bae46e1d13"
__COMMIT__ = "2430ed60950545d51f2fa235656907e21e8d3ac4"
4 changes: 2 additions & 2 deletions FAIRFlowChemistry/core/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Calibration(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Calibration"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Calibration"
},
):
""""""
Expand Down Expand Up @@ -60,7 +60,7 @@ class Calibration(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)

def calibrate(self):
Expand Down
6 changes: 3 additions & 3 deletions FAIRFlowChemistry/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
):
""""""
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions FAIRFlowChemistry/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
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


@forge_signature
class Data(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Data"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Data"
},
):
""""""
Expand Down Expand Up @@ -54,5 +54,5 @@ class Data(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)
12 changes: 6 additions & 6 deletions FAIRFlowChemistry/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'"""
Expand All @@ -41,15 +41,15 @@ class GeneralInformation(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)


@forge_signature
class Dataset(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Dataset"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Dataset"
},
):
""""""
Expand Down Expand Up @@ -84,7 +84,7 @@ class Dataset(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)

def add_to_experiments(
Expand Down
12 changes: 6 additions & 6 deletions FAIRFlowChemistry/core/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
):
""""""
Expand Down Expand Up @@ -69,7 +69,7 @@ class Experiment(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)

def add_to_measurements(
Expand Down
4 changes: 2 additions & 2 deletions FAIRFlowChemistry/core/genericattibute.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class GenericAttibute(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#GenericAttibute"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#GenericAttibute"
},
):
""""""
Expand Down Expand Up @@ -68,5 +68,5 @@ class GenericAttibute(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)
12 changes: 6 additions & 6 deletions FAIRFlowChemistry/core/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
):
""""""
Expand Down Expand Up @@ -69,7 +69,7 @@ class Measurement(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)

def add_to_metadata(
Expand Down
6 changes: 3 additions & 3 deletions FAIRFlowChemistry/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
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


@forge_signature
class Metadata(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Metadata"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Metadata"
},
):
""""""
Expand Down Expand Up @@ -78,5 +78,5 @@ class Metadata(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)
4 changes: 2 additions & 2 deletions FAIRFlowChemistry/core/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Parameter(
sdRDM.DataModel,
nsmap={
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@1bb5f3b4519dae01439e0005d07224bae46e1d13#Parameter"
"": "https://github.com/FAIRChemistry/FAIRFlowChemistry@2430ed60950545d51f2fa235656907e21e8d3ac4#Parameter"
},
):
""""""
Expand Down Expand Up @@ -41,5 +41,5 @@ class Parameter(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)
29 changes: 8 additions & 21 deletions FAIRFlowChemistry/core/plantsetup.py
Original file line number Diff line number Diff line change
@@ -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"
},
):
""""""
Expand All @@ -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),
),
)

Expand All @@ -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),
),
)

Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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]
6 changes: 3 additions & 3 deletions FAIRFlowChemistry/core/speciesdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
):
""""""
Expand Down Expand Up @@ -70,5 +70,5 @@ class SpeciesData(
default="https://github.com/FAIRChemistry/FAIRFlowChemistry"
)
_commit: Optional[str] = PrivateAttr(
default="1bb5f3b4519dae01439e0005d07224bae46e1d13"
default="2430ed60950545d51f2fa235656907e21e8d3ac4"
)

0 comments on commit 0fab85f

Please sign in to comment.