flavor_engine

Vape Cart Flavor Engine — 11D gustatory interpolation and NCM coupling.

Implements the 6-phase blend pipeline:
  1. Raw weighted vector summation

  2. Interaction matrix corrections (suppression/synergy/cross-modal)

  3. Temporal phase reconstruction → TDS string

  4. NCM cascade computation (Hill saturation + receptor synergies)

  5. Nearest-neighbor classification + novelty score

  6. Derived metrics (palatability, reward_density, cling, nostalgia)

Also: morph, temperature modification, cascade trigger detection, emergence.

class flavor_engine.FlavorProfile(name, vector, delta_str, temporal, norimaki_inv=None, retronasal=0.5, category='other')[source]

Bases: object

A single flavour from the cart.

Parameters:
name: str
vector: List[float]
delta_str: str
temporal: Dict[str, Any]
norimaki_inv: List[float] | None = None
retronasal: float = 0.5
category: str = 'other'
property dominant_axis: str

Dominant axis.

Returns:

Result string.

Return type:

str

class flavor_engine.CompositeResult(vector, raw_vector, ncm_deltas, tds_string, temporal_phases, derived_metrics, nearest_flavor, nearest_similarity, novelty_score, emergence_flags, cascade_triggers, attractor=None, ingredients=<factory>)[source]

Bases: object

Output of a blend/morph computation.

Parameters:
vector: List[float]
raw_vector: List[float]
ncm_deltas: Dict[str, float]
tds_string: str
temporal_phases: List[Dict[str, Any]]
derived_metrics: Dict[str, float]
nearest_flavor: str
nearest_similarity: float
novelty_score: float
emergence_flags: List[str]
cascade_triggers: List[str]
attractor: str | None = None
ingredients: List[Dict[str, Any]]
to_dict()[source]

Convert to dict representation.

Returns:

Result dictionary.

Return type:

dict

class flavor_engine.FlavorEngine(yaml_path=None)[source]

Bases: object

11-dimensional gustatory computation engine.

Parameters:

yaml_path (Optional[str])

__init__(yaml_path=None)[source]

Initialize the instance.

Parameters:

yaml_path (Optional[str]) – The yaml path value.

get_flavor(name)[source]

Look up a single flavor by name (case-insensitive).

Return type:

Optional[FlavorProfile]

Parameters:

name (str)

list_flavors()[source]

List flavors.

Returns:

The result.

Return type:

List[str]

blend(recipe)[source]

Run the full 6-phase blend pipeline.

Parameters:

recipe (List[Dict[str, Any]]) – Each dict: {flavor: str, weight: float, prep: str?, temp_c: float?}

Return type:

CompositeResult

morph(flavor_a, flavor_b, t=0.5)[source]

Interpolate between two flavors at point t ∈ [0, 1].

Return type:

CompositeResult

Parameters:
apply_temperature(profile, temp_c)[source]

Return a new FlavorProfile with temperature modifications.

Return type:

FlavorProfile

Parameters: