Property Result

Structured representation of scalar properties with units and semantic tags.

class kbkit.schema.property_result.PropertyResult(name: str, value: ndarray, metadata: dict[str, Any] | None = None, property_type: str | None = None, units: str | None = None)[source]

Bases: object

Container for calculated thermodynamic properties with metadata.

Parameters:
  • name (str) – Name of the property (e.g., “density”, “kbi”, “activity_coefficient”)

  • value (np.ndarray) – Calculated property values.

  • property_type (str, optional) – Type of property calculated.

  • units (str, optional) – Units of the property (e.g., “kg/m^3”, “kJ/mol”).

  • metadata (dict) – Additional calculation metadata (e.g., mixing rules, KBI metadata).

name: str
value: ndarray
metadata: dict[str, Any] | None = None
property_type: str | None = None
units: str | None = None
to(units: str) PropertyResult[source]

Convert property to desired units.

For KBI properties, also converts KBIMetadata values.

Parameters:

units (str) – Target units for conversion.

Returns:

New PropertyResult with converted values and units.

Return type:

PropertyResult