Measurement

class openmsimodel.entity.base.measurement.Measurement(name: str, *, notes: str | None = None, conditions: list[Condition] | None = None, parameters: list[Parameter] | None = None, properties: list[Property] | None = None, material: MaterialRun | None = None)

Bases: ProcessOrMeasurement

Base element for measurements.

property spec: MeasurementSpec

The underlying measurement spec.

property run: MeasurementRun

The underlying measurement run.

classmethod from_spec_or_run(name: str, *, notes: str | None = None, spec: MeasurementSpec = None, run: MeasurementRun = None) Measurement

Instantiate a Measurement from a spec or run with appropriate validation.

Note that the spec’s template will be set to the class template, and the run’s spec will be set to this spec.

get_material() str

Get the name of the material on sstate the measurement run was performed.

set_material(material: MaterialRun | None) None

Set the material on sstate the measurement run was performed.

Parameters:

material – {MaterialRun, None} The measurement’s material.

get_properties_dict()

Return a dict of measurement run properties. The keys are the names of the properties. Each value is a dict containing a value dict and origin str.

update_properties(properties: Property, replace_all: bool = False) None

Change or add measured properties of the measurement run. properties: Property The properties to change (by name) or add. replace_all: bool, default False If True, remove any existing properties before adding new ones.

remove_properties(*property_names: str) None

Remove measured properties from the measurement run by name.

property_names: str

The names of properties to remove.