Ejemplo n.º 1
0
    def __init__(self,
                 name=None,
                 spec=None,
                 conditions=None,
                 parameters=None,
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None,
                 source=None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasConditions.__init__(self, conditions)
        HasParameters.__init__(self, parameters)
        HasSource.__init__(self, source)

        self._ingredients = []

        self._spec = None
        self.spec = spec
        self._output_material = None
Ejemplo n.º 2
0
    def __init__(self,
                 name: str,
                 *,
                 template: Optional[Union[ProcessTemplate, LinkByUID]] = None,
                 conditions: Iterable[Condition] = None,
                 parameters: Iterable[Parameter] = None,
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink],
                                            FileLink]] = None):
        from gemd.entity.object.ingredient_spec import IngredientSpec
        from gemd.entity.link_by_uid import LinkByUID

        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasTemplate.__init__(self, template=template)
        HasParameters.__init__(self, parameters=parameters)
        HasConditions.__init__(self, conditions=conditions)

        # By default, a ProcessSpec is not linked to any MaterialSpec.
        # If a MaterialSpec is linked to this ProcessSpec,
        # then the field self._output_material will be automatically populated
        self._output_material = None
        self._ingredients = validate_list(None, [IngredientSpec, LinkByUID])
Ejemplo n.º 3
0
    def __init__(self,
                 name=None,
                 template=None,
                 parameters=None,
                 conditions=None,
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasParameters.__init__(self, parameters=parameters)
        HasConditions.__init__(self, conditions=conditions)

        self._ingredients = []

        # By default, a ProcessSpec is not linked to any MaterialSpec.
        # If a MaterialSpec is linked to this ProcessSpec,
        # then the field self._output_material will be automatically populated
        self._output_material = None

        HasTemplate.__init__(self, template=template)
Ejemplo n.º 4
0
    def __init__(self,
                 name=None,
                 spec=None,
                 material=None,
                 properties=None,
                 conditions=None,
                 parameters=None,
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None,
                 source=None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasProperties.__init__(self, properties)
        HasConditions.__init__(self, conditions)
        HasParameters.__init__(self, parameters)
        HasSource.__init__(self, source)

        self._material = None
        self.material = material
        self._spec = None
        self.spec = spec
Ejemplo n.º 5
0
    def __init__(self,
                 name: str,
                 *,
                 spec: Union[MaterialSpec, LinkByUID] = None,
                 process: Union[ProcessRun, LinkByUID] = None,
                 sample_type: Union[SampleType, str] = "unknown",
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink],
                                            FileLink]] = None):
        from gemd.entity.object.measurement_run import MeasurementRun
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasSpec.__init__(self, spec=spec)
        self._process = None
        self._measurements = validate_list(None, [MeasurementRun, LinkByUID])
        self._sample_type = None

        self.process = process
        self.sample_type = sample_type
    def __init__(self,
                 name: str,
                 *,
                 spec: Union[MeasurementSpec, LinkByUID] = None,
                 material: Union[MaterialRun, LinkByUID] = None,
                 properties: Iterable[Property] = None,
                 conditions: Iterable[Condition] = None,
                 parameters: Iterable[Parameter] = None,
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink],
                                            FileLink]] = None,
                 source: PerformedSource = None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasSpec.__init__(self, spec=spec)
        HasProperties.__init__(self, properties)
        HasConditions.__init__(self, conditions)
        HasParameters.__init__(self, parameters)
        HasSource.__init__(self, source)

        self._material = None
        self.material = material
    def __init__(self,
                 name: str,
                 *,
                 material: Union[MaterialSpec, LinkByUID] = None,
                 process: Union[ProcessSpec, LinkByUID] = None,
                 labels: Iterable[str] = None,
                 mass_fraction: ContinuousValue = None,
                 volume_fraction: ContinuousValue = None,
                 number_fraction: ContinuousValue = None,
                 absolute_quantity: ContinuousValue = None,
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink], FileLink]] = None):

        BaseObject.__init__(self, name=name,
                            uids=uids, tags=tags, notes=notes, file_links=file_links)
        HasQuantities.__init__(self, mass_fraction=mass_fraction, volume_fraction=volume_fraction,
                               number_fraction=number_fraction, absolute_quantity=absolute_quantity
                               )

        self._material = None
        self._process = None
        self._labels = None

        self.labels = labels
        self.material = material
        self.process = process
Ejemplo n.º 8
0
    def __init__(self,
                 *,
                 material: Union[MaterialRun, LinkByUID] = None,
                 process: Union[ProcessRun, LinkByUID] = None,
                 mass_fraction: ContinuousValue = None,
                 volume_fraction: ContinuousValue = None,
                 number_fraction: ContinuousValue = None,
                 absolute_quantity: ContinuousValue = None,
                 spec: Union[IngredientSpec, LinkByUID] = None,
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink],
                                            FileLink]] = None):
        BaseObject.__init__(self,
                            name=None,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        self._labels = None
        HasSpec.__init__(
            self, spec)  # this will overwrite name/labels if/when they are set

        HasQuantities.__init__(self,
                               mass_fraction=mass_fraction,
                               volume_fraction=volume_fraction,
                               number_fraction=number_fraction,
                               absolute_quantity=absolute_quantity)
        self._material = None
        self._process = None

        self.material = material
        self.process = process
Ejemplo n.º 9
0
 def __init__(self,
              name: str,
              *,
              template: Optional[Union[MeasurementTemplate, LinkByUID]] = None,
              conditions: Iterable[Condition] = None,
              parameters: Iterable[Parameter] = None,
              uids: Mapping[str, str] = None,
              tags: Iterable[str] = None,
              notes: str = None,
              file_links: Optional[Union[Iterable[FileLink], FileLink]] = None):
     BaseObject.__init__(self, name=name, uids=uids, tags=tags, notes=notes,
                         file_links=file_links)
     HasTemplate.__init__(self, template=template)
     HasParameters.__init__(self, parameters=parameters)
     HasConditions.__init__(self, conditions=conditions)
Ejemplo n.º 10
0
 def __init__(self,
              name=None,
              template=None,
              parameters=None,
              conditions=None,
              uids=None,
              tags=None,
              notes=None,
              file_links=None):
     BaseObject.__init__(self,
                         name=name,
                         uids=uids,
                         tags=tags,
                         notes=notes,
                         file_links=file_links)
     HasParameters.__init__(self, parameters=parameters)
     HasConditions.__init__(self, conditions=conditions)
     HasTemplate.__init__(self, template=template)
Ejemplo n.º 11
0
    def __init__(self,
                 material=None,
                 process=None,
                 name=None,
                 labels=None,
                 mass_fraction=None,
                 volume_fraction=None,
                 number_fraction=None,
                 absolute_quantity=None,
                 spec=None,
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        HasQuantities.__init__(self, mass_fraction, volume_fraction,
                               number_fraction, absolute_quantity)
        if name is not None:
            warnings.warn(
                "The 'name' argument for ingredient runs is deprecated. "
                "It may be overwritten by the name of this object's spec.",
                DeprecationWarning)
        if labels is not None:
            warnings.warn(
                "The 'labels' argument for ingredient runs is deprecated. "
                "It may be overwritten by the labels of this object's spec.",
                DeprecationWarning)
        self._material = None
        self._process = None
        self._spec = None
        self._labels = None

        self.material = material
        self.process = process
        self.labels = labels
        # this may overwrite name/labels
        self.spec = spec
Ejemplo n.º 12
0
    def __init__(self,
                 material=None,
                 process=None,
                 name=None,
                 labels=None,
                 mass_fraction=None,
                 volume_fraction=None,
                 number_fraction=None,
                 absolute_quantity=None,
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None):
        """
        Create an IngredientSpec object.

        Assigns a unique_label and other descriptive labels to a material used as an ingredient
        :param material: MaterialSpec that is being used as the ingredient
        :param process: ProcessSpec that uses this ingredient
        :param name: of the ingredient as used in the process, i.e. "the peanut butter"
        :param labels: that this ingredient belongs to, e.g. "spread" or "solvent"
        :param mass_fraction: fraction of the ingredients that is this input ingredient, by mass
        :param volume_fraction: fraction of the ingredients that is this ingredient, by volume
        :param number_fraction: fraction of the ingredients that is this ingredient, by number
        :param absolute_quantity: quantity of this ingredient in an absolute sense, e.g. 2 cups
        """
        BaseObject.__init__(self,
                            name,
                            uids,
                            tags,
                            notes=notes,
                            file_links=file_links)
        HasQuantities.__init__(self, mass_fraction, volume_fraction,
                               number_fraction, absolute_quantity)

        self._material = None
        self._process = None
        self._labels = None

        self.material = material
        self.process = process
        self.labels = labels
Ejemplo n.º 13
0
 def __init__(self,
              name=None,
              template=None,
              properties=None,
              process=None,
              uids=None,
              tags=None,
              notes=None,
              file_links=None):
     BaseObject.__init__(self,
                         name=name,
                         uids=uids,
                         tags=tags,
                         notes=notes,
                         file_links=file_links)
     self._properties = None
     self.properties = properties
     self._process = None
     self.process = process
     HasTemplate.__init__(self, template)
Ejemplo n.º 14
0
 def __init__(self,
              name: str,
              *,
              template: Optional[Union[MaterialTemplate, LinkByUID]] = None,
              process: Union[ProcessSpec, LinkByUID] = None,
              properties: Iterable[PropertyAndConditions] = None,
              uids: Mapping[str, str] = None,
              tags: Iterable[str] = None,
              notes: str = None,
              file_links: Optional[Union[Iterable[FileLink],
                                         FileLink]] = None):
     BaseObject.__init__(self,
                         name=name,
                         uids=uids,
                         tags=tags,
                         notes=notes,
                         file_links=file_links)
     HasTemplate.__init__(self, template)
     self._properties = None
     self.properties = properties
     self._process = None
     self.process = process
Ejemplo n.º 15
0
    def __init__(self,
                 name: str,
                 *,
                 spec: Union[ProcessSpec, LinkByUID] = None,
                 conditions: Iterable[Condition] = None,
                 parameters: Iterable[Parameter] = None,
                 uids: Mapping[str, str] = None,
                 tags: Iterable[str] = None,
                 notes: str = None,
                 file_links: Optional[Union[Iterable[FileLink], FileLink]] = None,
                 source: PerformedSource = None):
        from gemd.entity.object.ingredient_run import IngredientRun

        BaseObject.__init__(self, name=name, uids=uids, tags=tags, notes=notes,
                            file_links=file_links)
        HasSpec.__init__(self, spec=spec)
        HasConditions.__init__(self, conditions)
        HasParameters.__init__(self, parameters)
        HasSource.__init__(self, source)

        self._ingredients = validate_list(None, [IngredientRun, LinkByUID])
        self._output_material = None
Ejemplo n.º 16
0
    def __init__(self,
                 name=None,
                 spec=None,
                 process=None,
                 sample_type="unknown",
                 uids=None,
                 tags=None,
                 notes=None,
                 file_links=None):
        BaseObject.__init__(self,
                            name=name,
                            uids=uids,
                            tags=tags,
                            notes=notes,
                            file_links=file_links)
        self._process = None
        self._measurements = []
        self._sample_type = None
        self._spec = None

        self.spec = spec
        self.process = process
        self.sample_type = sample_type