gemd.entity.object.measurement_run module

class gemd.entity.object.measurement_run.MeasurementRun(name: str, *, spec: Optional[Union[MeasurementSpec, LinkByUID]] = None, material: Optional[Union[MaterialRun, LinkByUID]] = None, properties: Optional[Union[Property, Iterable[Property]]] = None, conditions: Optional[Union[Iterable[Condition], Condition]] = None, parameters: Optional[Union[Parameter, Iterable[Parameter]]] = None, uids: Optional[Mapping[str, str]] = None, tags: Optional[Iterable[str]] = None, notes: Optional[str] = None, file_links: Optional[Union[Iterable[FileLink], FileLink]] = None, source: Optional[PerformedSource] = None)

Bases: BaseObject, HasMaterial, HasSpec, HasConditions, HasProperties, HasParameters, HasSource

A measurement run.

This contains a link to the material the measurement is performed on, as well as links to any properties, conditions, and parameters.

Parameters
  • name (str, required) – Name of the measurement run.

  • uids (Map[str, str], optional) – A collection of unique IDs.

  • tags (List[str], optional) – Tags are hierarchical strings that store information about an entity. They can be used for filtering and discoverability.

  • notes (str, optional) – Long-form notes about the measurement run.

  • conditions (List[Condition], optional) – Conditions under which this measurement run occurs.

  • parameters (List[Parameter], optional) – Parameters of this measurement run.

  • properties (List[Property], optional) – Properties that are measured during this measurement run.

  • spec (MaterialSpec`) – The measurement specification of which this is an instance.

  • material (MaterialRun`) – The material run being measured.

  • spec – The material specification of which this is an instance.

  • file_links (List[FileLink], optional) – Links to associated files, with resource paths into the files API.

  • source (PerformedSource, optional) – Information about the person who performed the run and when.

add_uid(scope: str, uid: str)

Add a uid.

Parameters
  • scope (str) – scope of the uid

  • uid (str) – Unique identifier

all_dependencies() Set[Union[BaseEntityType, LinkByUIDType]]

Return a set of all immediate dependencies (no recursion).

as_dict() Dict[str, Any]

Convert the object to a dictionary.

Returns

A dictionary representation of the object, where the keys are its fields.

Return type

dict

static build(d: Mapping[str, Any]) DictSerializableType

Build an object from a JSON dictionary.

This differs from from_dict in that the values themselves may also be dictionaries corresponding to serialized DictSerializable objects.

Parameters

d (dict) – The object as a serialized dictionary.

Returns

The deserialized object.

Return type

DictSerializable

dump() Dict[str, Any]

Convert the object to a JSON dictionary, so that every entry is serialized.

Uses the json encoder client, so objects with uids are converted to LinkByUID dictionaries.

Returns

A string representation of the object as a dictionary.

Return type

str

classmethod from_dict(d: Mapping[str, Any]) DictSerializableType

Reconstitute the object from a dictionary.

Parameters

d (dict) – The object as a dictionary of key-value pairs that correspond to the object’s fields.

Returns

The deserialized object.

Return type

DictSerializable

Generate a ~gemd.entity.link_by_uid.LinkByUID for this object.

Parameters
  • scope (str, optional) – scope of the uid to get

  • allow_fallback (bool) – whether to grab another scope/id if chosen scope is missing (Default: False).

Return type

LinkByUID

property conditions: List[Condition]

A list of conditions associated with this entity.

Links to associated files, with resource paths into the files API.

property material: Union[MaterialRun, LinkByUID]

Get the material.

property name: str

Name of the object.

property parameters: List[Parameter]

A list of parameters associated with this entity.

property properties: List[Property]

A list of properties associated with this entity.

skip = {}
property source: PerformedSource

Information about the person who performed the run and when.

property spec: Union[HasTemplate, LinkByUID]

A spec, which expresses the anticipated or aspirational behavior of this object.

property tags: List[str]

A collection of structured labels.

Tags are hierarchical strings that store information about an entity. They can be used for filtering and discoverability.

property template: Optional[Union[BaseTemplate, LinkByUID]]

Get the template associated with the spec.

typ = 'measurement_run'
property uids: Dict[str, str]

A collection of unique IDs.

Requirements for and the value of unique IDs are discussed here.