Example #1
0
    def list_by_template(self,
                         uid: Union[UUID, str],
                         scope: str = CITRINE_SCOPE) -> Iterator[MaterialRun]:
        """
        [ALPHA] Get the material runs using the specified material template.

        Parameters
        ----------
        uid
            The unique ID of the material template whose material run usages are to be located.
        scope
            The scope of `uid`.
        Returns
        -------
        Iterator[MaterialRun]
            The material runs using the specified material template.

        """
        spec_collection = MaterialSpecCollection(self.project_id,
                                                 self.dataset_id, self.session)
        specs = spec_collection.list_by_template(uid=uid, scope=scope)
        return (run for runs in (self.list_by_spec(spec.uids[CITRINE_SCOPE])
                                 for spec in specs) for run in runs)
Example #2
0
 def material_specs(self) -> MaterialSpecCollection:
     """Return a resource representing all material specs in this dataset."""
     return MaterialSpecCollection(self.uid, None, self.session)
Example #3
0
def collection(session) -> MaterialSpecCollection:
    return MaterialSpecCollection(
        project_id=UUID('6b608f78-e341-422c-8076-35adc8828545'),
        dataset_id=UUID('8da51e93-8b55-4dd3-8489-af8f65d4ad9a'),
        session=session)