Activity Metadata

Containers for storing activity coefficient properties and their polynomial fit functions.

class kbkit.schema.activity_metadata.ActivityCoefficientResult(mol: str, x: ndarray, y: ndarray, property_type: Literal['derivative', 'integrated'], fn: poly1d | None = None)[source]

Bases: object

Containor for activity coefficient results and derivatives.

Stores polynomial functions if activity_integration_type is polynomial and evaluates function from \(x_i\): 0 \(\rightarrow\) 1.

Parameters:
  • mol (str) – Molecule name.

  • x (np.ndarray) – Array of mole fractions for mol.

  • y (np.ndarray) – Array of values corresponding to x.

  • property_type (str) – Type of activity coefficient property. Tags result object with derivative or integrated.

  • fn (Callable, optional) – Optional function that describes activity coefficients. Only if activity_integration_type is polynomial.

mol: str
x: ndarray
y: ndarray
property_type: Literal['derivative', 'integrated']
fn: poly1d | None = None
property x_eval

Values to evaluate function at.

Type:

np.ndarray

property y_eval

Result of the function evaluated at x_eval.

Type:

np.ndarray

property has_fn: bool

Check if a fit function is defined.

Type:

bool

class kbkit.schema.activity_metadata.ActivityMetadata(results: list[ActivityCoefficientResult])[source]

Bases: object

Container for collection of ActivityCoefficientResult objects.

Parameters:

results (list[ActivityCoefficientResult]) – List of ActivityCoefficientResult objects.

results: list[ActivityCoefficientResult]
property by_types: dict[str, dict[str, ActivityCoefficientResult]]

Group the ActivityCoefficientResult by their type, e.g., if they are a derivative or integrated property.

Returns:

Nested dictionary of ActivityCoefficientResult sorted by property, then by molecule name.

Return type:

dict

get(mol: str, property_type: Literal['derivative', 'integrated']) ActivityCoefficientResult[source]

Get an ActivityCoefficientResult object for a given property_type and mol.

Parameters:
  • mol (str) – Molecule name.

  • property_type (str) – Type of activity coefficient property.