feat(data): add commercial solvent dilution layer and clean natural profiles
Browse files- Replace NATURAL_PROFILES with 3 IFRA/UNIFAC-safe profiles.
- Add apply_commercial_solvent_dilution (15% concentrate / 85% ethanol).
- Wire dilution into the multi-component mixture generation loop.
- Allow natural oil injection into empirical mixtures.
- scripts/generate_empirical_bootstrap.py +66 -7
- src/pino/thermo/naturals.py +18 -274
scripts/generate_empirical_bootstrap.py
CHANGED
|
@@ -40,6 +40,46 @@ def _strip_natural_prefix(cas: str) -> str:
|
|
| 40 |
return cas
|
| 41 |
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
def expand_naturals_to_cas_ratios(formula_list: list[dict[str, Any]]) -> dict[str, float]:
|
| 44 |
"""
|
| 45 |
Expand natural complex substances (NCS) into their pure constituent chemicals.
|
|
@@ -49,17 +89,19 @@ def expand_naturals_to_cas_ratios(formula_list: list[dict[str, Any]]) -> dict[st
|
|
| 49 |
"""
|
| 50 |
expanded: dict[str, float] = {}
|
| 51 |
for item in formula_list:
|
| 52 |
-
|
| 53 |
weight = float(item.get("weight_fraction", 0.0))
|
| 54 |
if weight <= 0:
|
| 55 |
continue
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
for const_cas, fraction in profile["constituents"].items():
|
| 60 |
expanded[const_cas] = expanded.get(const_cas, 0.0) + weight * fraction
|
| 61 |
else:
|
| 62 |
-
expanded[
|
| 63 |
|
| 64 |
total = sum(expanded.values())
|
| 65 |
if total <= 0:
|
|
@@ -160,6 +202,7 @@ def _mixture_records(
|
|
| 160 |
registry: AromaRegistry,
|
| 161 |
num_formulas: int = 5000,
|
| 162 |
seed: int = 2026,
|
|
|
|
| 163 |
) -> list[dict[str, Any]]:
|
| 164 |
"""Generate non-ideal multi-component mixture records."""
|
| 165 |
random.seed(seed)
|
|
@@ -176,6 +219,7 @@ def _mixture_records(
|
|
| 176 |
if not valid_cas:
|
| 177 |
raise RuntimeError("No valid chemicals with UNIFAC groups found in registry")
|
| 178 |
|
|
|
|
| 179 |
records: list[dict[str, Any]] = []
|
| 180 |
attempts = 0
|
| 181 |
max_attempts = num_formulas * 5
|
|
@@ -184,14 +228,26 @@ def _mixture_records(
|
|
| 184 |
attempts += 1
|
| 185 |
n_components = random.randint(3, 10)
|
| 186 |
chosen_cas = random.sample(valid_cas, n_components)
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
formula_list = []
|
| 190 |
for cas, weight in zip(chosen_cas, raw_weights):
|
| 191 |
formula_list.append({"cas": cas, "weight_fraction": float(weight)})
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
# Expand any natural oils before simulation.
|
| 194 |
-
expanded_ratios = expand_naturals_to_cas_ratios(
|
| 195 |
if not expanded_ratios:
|
| 196 |
continue
|
| 197 |
|
|
@@ -243,6 +299,7 @@ def generate_empirical_bootstrap(
|
|
| 243 |
output_path: str,
|
| 244 |
num_formulas: int = 5000,
|
| 245 |
seed: int = 2026,
|
|
|
|
| 246 |
) -> dict[str, Any]:
|
| 247 |
"""Build the full 5,597-row empirical bootstrap dataset."""
|
| 248 |
registry = AromaRegistry()
|
|
@@ -253,7 +310,9 @@ def generate_empirical_bootstrap(
|
|
| 253 |
logger.info("Generated %d control records", len(controls))
|
| 254 |
|
| 255 |
logger.info("Generating %d empirical mixtures...", num_formulas)
|
| 256 |
-
mixtures = _mixture_records(
|
|
|
|
|
|
|
| 257 |
logger.info("Generated %d empirical mixture records", len(mixtures))
|
| 258 |
|
| 259 |
output_path_obj = Path(output_path)
|
|
|
|
| 40 |
return cas
|
| 41 |
|
| 42 |
|
| 43 |
+
def apply_commercial_solvent_dilution(
|
| 44 |
+
raw_recipe: list[dict[str, Any]], concentrate_ratio: float = 0.15
|
| 45 |
+
) -> list[dict[str, Any]]:
|
| 46 |
+
"""
|
| 47 |
+
Treat the raw recipe as a perfume oil concentrate and dilute it into an
|
| 48 |
+
Ethanol carrier envelope (e.g., 15% concentrate / 85% Ethanol).
|
| 49 |
+
|
| 50 |
+
This lowers all active ingredient concentrations below typical IFRA safety
|
| 51 |
+
limits and stabilizes the VLE evaporation curves.
|
| 52 |
+
"""
|
| 53 |
+
ethanol_cas = "64-17-5"
|
| 54 |
+
accumulated_ethanol_fraction = 0.0
|
| 55 |
+
diluted_recipe: list[dict[str, Any]] = []
|
| 56 |
+
|
| 57 |
+
for item in raw_recipe:
|
| 58 |
+
cas = item["cas"]
|
| 59 |
+
name = item.get("name", cas)
|
| 60 |
+
raw_fraction = float(item.get("weight_fraction", 0.0))
|
| 61 |
+
|
| 62 |
+
diluted_fraction = raw_fraction * concentrate_ratio
|
| 63 |
+
|
| 64 |
+
if cas == ethanol_cas:
|
| 65 |
+
accumulated_ethanol_fraction += diluted_fraction
|
| 66 |
+
else:
|
| 67 |
+
diluted_recipe.append({
|
| 68 |
+
"cas": cas,
|
| 69 |
+
"name": name,
|
| 70 |
+
"weight_fraction": diluted_fraction,
|
| 71 |
+
})
|
| 72 |
+
|
| 73 |
+
total_carrier_needed = (1.0 - concentrate_ratio) + accumulated_ethanol_fraction
|
| 74 |
+
diluted_recipe.append({
|
| 75 |
+
"cas": ethanol_cas,
|
| 76 |
+
"name": "Ethanol",
|
| 77 |
+
"weight_fraction": total_carrier_needed,
|
| 78 |
+
})
|
| 79 |
+
|
| 80 |
+
return diluted_recipe
|
| 81 |
+
|
| 82 |
+
|
| 83 |
def expand_naturals_to_cas_ratios(formula_list: list[dict[str, Any]]) -> dict[str, float]:
|
| 84 |
"""
|
| 85 |
Expand natural complex substances (NCS) into their pure constituent chemicals.
|
|
|
|
| 89 |
"""
|
| 90 |
expanded: dict[str, float] = {}
|
| 91 |
for item in formula_list:
|
| 92 |
+
raw_cas = item.get("cas", "")
|
| 93 |
weight = float(item.get("weight_fraction", 0.0))
|
| 94 |
if weight <= 0:
|
| 95 |
continue
|
| 96 |
|
| 97 |
+
# Expand any NATURAL:* complex substances into their pure constituents.
|
| 98 |
+
lookup_cas = _strip_natural_prefix(raw_cas)
|
| 99 |
+
profile = NATURAL_PROFILES.get(raw_cas) or NATURAL_PROFILES.get(f"NATURAL:{lookup_cas}") or NATURAL_PROFILES.get(lookup_cas)
|
| 100 |
+
if profile and "constituents" in profile:
|
| 101 |
for const_cas, fraction in profile["constituents"].items():
|
| 102 |
expanded[const_cas] = expanded.get(const_cas, 0.0) + weight * fraction
|
| 103 |
else:
|
| 104 |
+
expanded[lookup_cas] = expanded.get(lookup_cas, 0.0) + weight
|
| 105 |
|
| 106 |
total = sum(expanded.values())
|
| 107 |
if total <= 0:
|
|
|
|
| 202 |
registry: AromaRegistry,
|
| 203 |
num_formulas: int = 5000,
|
| 204 |
seed: int = 2026,
|
| 205 |
+
natural_oil_fraction: float = 0.25,
|
| 206 |
) -> list[dict[str, Any]]:
|
| 207 |
"""Generate non-ideal multi-component mixture records."""
|
| 208 |
random.seed(seed)
|
|
|
|
| 219 |
if not valid_cas:
|
| 220 |
raise RuntimeError("No valid chemicals with UNIFAC groups found in registry")
|
| 221 |
|
| 222 |
+
natural_oil_cas = list(NATURAL_PROFILES.keys())
|
| 223 |
records: list[dict[str, Any]] = []
|
| 224 |
attempts = 0
|
| 225 |
max_attempts = num_formulas * 5
|
|
|
|
| 228 |
attempts += 1
|
| 229 |
n_components = random.randint(3, 10)
|
| 230 |
chosen_cas = random.sample(valid_cas, n_components)
|
| 231 |
+
|
| 232 |
+
# Optionally inject one or two natural complex substances.
|
| 233 |
+
if natural_oil_cas and random.random() < natural_oil_fraction:
|
| 234 |
+
n_oils = random.randint(1, min(2, n_components))
|
| 235 |
+
oil_positions = random.sample(range(n_components), n_oils)
|
| 236 |
+
for pos in oil_positions:
|
| 237 |
+
chosen_cas[pos] = random.choice(natural_oil_cas)
|
| 238 |
+
|
| 239 |
+
raw_weights = np.random.dirichlet(np.ones(len(chosen_cas)))
|
| 240 |
|
| 241 |
formula_list = []
|
| 242 |
for cas, weight in zip(chosen_cas, raw_weights):
|
| 243 |
formula_list.append({"cas": cas, "weight_fraction": float(weight)})
|
| 244 |
|
| 245 |
+
# Apply commercial solvent dilution (15% concentrate / 85% Ethanol) before
|
| 246 |
+
# expanding natural oils, so the VLE simulation sees the real product.
|
| 247 |
+
diluted_formula = apply_commercial_solvent_dilution(formula_list)
|
| 248 |
+
|
| 249 |
# Expand any natural oils before simulation.
|
| 250 |
+
expanded_ratios = expand_naturals_to_cas_ratios(diluted_formula)
|
| 251 |
if not expanded_ratios:
|
| 252 |
continue
|
| 253 |
|
|
|
|
| 299 |
output_path: str,
|
| 300 |
num_formulas: int = 5000,
|
| 301 |
seed: int = 2026,
|
| 302 |
+
natural_oil_fraction: float = 0.25,
|
| 303 |
) -> dict[str, Any]:
|
| 304 |
"""Build the full 5,597-row empirical bootstrap dataset."""
|
| 305 |
registry = AromaRegistry()
|
|
|
|
| 310 |
logger.info("Generated %d control records", len(controls))
|
| 311 |
|
| 312 |
logger.info("Generating %d empirical mixtures...", num_formulas)
|
| 313 |
+
mixtures = _mixture_records(
|
| 314 |
+
registry, num_formulas=num_formulas, seed=seed, natural_oil_fraction=natural_oil_fraction
|
| 315 |
+
)
|
| 316 |
logger.info("Generated %d empirical mixture records", len(mixtures))
|
| 317 |
|
| 318 |
output_path_obj = Path(output_path)
|
src/pino/thermo/naturals.py
CHANGED
|
@@ -3,289 +3,33 @@ import numpy as np
|
|
| 3 |
# Analytical composition profiles for primary Natural Complex Substances (NCS).
|
| 4 |
# Each profile maps a NATURAL:* CAS identifier to a weighted blend of single-
|
| 5 |
# molecule aroma chemicals already present in the registry.
|
|
|
|
|
|
|
| 6 |
NATURAL_PROFILES = {
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
"name": "Lemon oil",
|
| 10 |
"constituents": {
|
| 11 |
-
"5989-27-5": 0.
|
| 12 |
-
"138-86-3": 0.15, # Dipentene (limonene isomer mix)
|
| 13 |
-
"99-85-4": 0.10, # gamma-Terpinene
|
| 14 |
-
"93-58-3": 0.10, # Methyl benzoate proxy
|
| 15 |
-
},
|
| 16 |
-
},
|
| 17 |
-
"8007-75-8": { # Bergamot oil
|
| 18 |
-
"name": "Bergamot oil",
|
| 19 |
-
"constituents": {
|
| 20 |
-
"5989-27-5": 0.40, # Limonene
|
| 21 |
-
"115-95-7": 0.30, # Linalyl acetate
|
| 22 |
-
"78-70-6": 0.20, # Linalool
|
| 23 |
-
"99-85-4": 0.10, # gamma-Terpinene
|
| 24 |
-
},
|
| 25 |
-
},
|
| 26 |
-
# Floral / herbal oils
|
| 27 |
-
"8016-63-5": { # Lavender oil
|
| 28 |
-
"name": "Lavender oil",
|
| 29 |
-
"constituents": {
|
| 30 |
-
"78-70-6": 0.35, # Linalool
|
| 31 |
"115-95-7": 0.35, # Linalyl acetate
|
| 32 |
-
"99-85-4": 0.15, # gamma-Terpinene
|
| 33 |
-
"80-54-6": 0.15, # Lilial proxy (floral aldehyde)
|
| 34 |
-
},
|
| 35 |
-
},
|
| 36 |
-
"8000-46-2": { # Rosemary oil
|
| 37 |
-
"name": "Rosemary oil",
|
| 38 |
-
"constituents": {
|
| 39 |
-
"470-82-6": 0.45, # Eucalyptol (1,8-cineole)
|
| 40 |
-
"127-91-3": 0.25, # beta-Pinene
|
| 41 |
-
"87-44-5": 0.20, # beta-Caryophyllene
|
| 42 |
-
"563-76-8": 0.10, # Camphor
|
| 43 |
-
},
|
| 44 |
-
},
|
| 45 |
-
"8000-34-8": { # Clove oil
|
| 46 |
-
"name": "Clove oil",
|
| 47 |
-
"constituents": {
|
| 48 |
-
"97-53-0": 0.80, # Eugenol
|
| 49 |
-
"97-54-1": 0.15, # Isoeugenol
|
| 50 |
-
"121-33-5": 0.05, # Vanillin
|
| 51 |
-
},
|
| 52 |
-
},
|
| 53 |
-
"8007-46-3": { # Cinnamon oil
|
| 54 |
-
"name": "Cinnamon oil",
|
| 55 |
-
"constituents": {
|
| 56 |
-
"104-55-2": 0.65, # Cinnamaldehyde
|
| 57 |
-
"104-54-1": 0.25, # Cinnamyl alcohol
|
| 58 |
-
"97-53-0": 0.10, # Eugenol
|
| 59 |
-
},
|
| 60 |
-
},
|
| 61 |
-
"8014-09-3": { # Patchouli oil
|
| 62 |
-
"name": "Patchouli oil",
|
| 63 |
-
"constituents": {
|
| 64 |
-
"77-53-2": 0.45, # Patchoulol
|
| 65 |
-
"87-44-5": 0.30, # beta-Caryophyllene
|
| 66 |
-
"77-42-9": 0.25, # Norpatchoulenol proxy
|
| 67 |
-
},
|
| 68 |
-
},
|
| 69 |
-
"8000-41-7": { # Rose oil
|
| 70 |
-
"name": "Rose oil",
|
| 71 |
-
"constituents": {
|
| 72 |
-
"104-54-1": 0.30, # Cinnamyl alcohol
|
| 73 |
-
"141-12-8": 0.25, # Geranyl acetate
|
| 74 |
-
"106-24-1": 0.25, # Geraniol
|
| 75 |
-
"78-70-6": 0.20, # Linalool
|
| 76 |
-
},
|
| 77 |
-
},
|
| 78 |
-
"8016-96-4": { # Geranium oil
|
| 79 |
-
"name": "Geranium oil",
|
| 80 |
-
"constituents": {
|
| 81 |
-
"106-24-1": 0.40, # Geraniol
|
| 82 |
-
"141-12-8": 0.30, # Geranyl acetate
|
| 83 |
-
"78-70-6": 0.20, # Linalool
|
| 84 |
-
"80-54-6": 0.10, # Lilial proxy
|
| 85 |
-
},
|
| 86 |
-
},
|
| 87 |
-
"8000-28-0": { # Lime oil
|
| 88 |
-
"name": "Lime oil",
|
| 89 |
-
"constituents": {
|
| 90 |
-
"5989-27-5": 0.50, # Limonene
|
| 91 |
-
"138-86-3": 0.20, # Dipentene
|
| 92 |
-
"99-85-4": 0.15, # gamma-Terpinene
|
| 93 |
-
"5986-55-0": 0.15, # Terpinolene proxy
|
| 94 |
-
},
|
| 95 |
-
},
|
| 96 |
-
"8000-29-1": { # Neroli oil
|
| 97 |
-
"name": "Neroli oil",
|
| 98 |
-
"constituents": {
|
| 99 |
-
"78-70-6": 0.30, # Linalool
|
| 100 |
-
"115-95-7": 0.25, # Linalyl acetate
|
| 101 |
-
"106-24-1": 0.25, # Geraniol
|
| 102 |
-
"93-58-3": 0.20, # Methyl benzoate proxy
|
| 103 |
-
},
|
| 104 |
-
},
|
| 105 |
-
"8016-38-4": { # Basil oil
|
| 106 |
-
"name": "Basil oil",
|
| 107 |
-
"constituents": {
|
| 108 |
-
"89-78-1": 0.45, # L-Menthol proxy
|
| 109 |
-
"123-35-3": 0.25, # Myrcene
|
| 110 |
-
"470-82-6": 0.20, # Eucalyptol
|
| 111 |
-
"80-56-8": 0.10, # alpha-Pinene proxy
|
| 112 |
-
},
|
| 113 |
-
},
|
| 114 |
-
"8023-75-2": { # Ylang ylang oil
|
| 115 |
-
"name": "Ylang ylang oil",
|
| 116 |
-
"constituents": {
|
| 117 |
-
"106-24-1": 0.30, # Geraniol
|
| 118 |
-
"141-12-8": 0.25, # Geranyl acetate
|
| 119 |
-
"80-54-6": 0.25, # Lilial proxy
|
| 120 |
-
"78-70-6": 0.20, # Linalool
|
| 121 |
-
},
|
| 122 |
-
},
|
| 123 |
-
"8031-03-6": { # Cardamom oil
|
| 124 |
-
"name": "Cardamom oil",
|
| 125 |
-
"constituents": {
|
| 126 |
-
"89-78-1": 0.35, # Cineole/menthol proxy
|
| 127 |
-
"80-56-8": 0.30, # alpha-Terpineol proxy
|
| 128 |
-
"123-35-3": 0.20, # Myrcene
|
| 129 |
-
"80-54-6": 0.15, # Lilial proxy
|
| 130 |
-
},
|
| 131 |
-
},
|
| 132 |
-
"8016-78-2": { # Pine needle oil
|
| 133 |
-
"name": "Pine needle oil",
|
| 134 |
-
"constituents": {
|
| 135 |
-
"80-56-8": 0.45, # alpha-Pinene proxy
|
| 136 |
-
"127-91-3": 0.30, # beta-Pinene
|
| 137 |
-
"470-82-6": 0.15, # Eucalyptol
|
| 138 |
-
"87-44-5": 0.10, # beta-Caryophyllene
|
| 139 |
-
},
|
| 140 |
-
},
|
| 141 |
-
"9000-50-4": { # Frankincense oil
|
| 142 |
-
"name": "Frankincense oil",
|
| 143 |
-
"constituents": {
|
| 144 |
-
"80-56-8": 0.40, # alpha-Pinene proxy
|
| 145 |
-
"127-91-3": 0.30, # beta-Pinene
|
| 146 |
-
"87-44-5": 0.20, # beta-Caryophyllene
|
| 147 |
-
"77-53-2": 0.10, # Patchoulol proxy
|
| 148 |
-
},
|
| 149 |
-
},
|
| 150 |
-
"8007-00-9": { # Amber oil
|
| 151 |
-
"name": "Amber oil",
|
| 152 |
-
"constituents": {
|
| 153 |
-
"77-42-9": 0.30, # Ambroxan proxy
|
| 154 |
-
"1222-05-5": 0.25, # Galaxolide
|
| 155 |
-
"81-14-1": 0.25, # Musk ketone
|
| 156 |
-
"104-55-2": 0.20, # Cinnamaldehyde
|
| 157 |
-
},
|
| 158 |
-
},
|
| 159 |
-
"8007-80-5": { # Musk seed oil
|
| 160 |
-
"name": "Musk seed oil",
|
| 161 |
-
"constituents": {
|
| 162 |
-
"81-14-1": 0.40, # Musk ketone
|
| 163 |
-
"83-66-9": 0.30, # Ambrettolide proxy
|
| 164 |
-
"1222-05-5": 0.30, # Galaxolide
|
| 165 |
-
},
|
| 166 |
-
},
|
| 167 |
-
"8024-13-1": { # Styrax resinoid
|
| 168 |
-
"name": "Styrax resinoid",
|
| 169 |
-
"constituents": {
|
| 170 |
-
"104-54-1": 0.40, # Cinnamyl alcohol
|
| 171 |
-
"104-55-2": 0.30, # Cinnamaldehyde
|
| 172 |
-
"97-53-0": 0.20, # Eugenol
|
| 173 |
-
"121-33-5": 0.10, # Vanillin
|
| 174 |
-
},
|
| 175 |
-
},
|
| 176 |
-
"8016-26-0": { # Labdanum clair
|
| 177 |
-
"name": "Labdanum clair",
|
| 178 |
-
"constituents": {
|
| 179 |
-
"87-44-5": 0.40, # beta-Caryophyllene
|
| 180 |
-
"77-53-2": 0.30, # Patchoulol proxy
|
| 181 |
-
"123-35-3": 0.20, # Myrcene
|
| 182 |
-
"80-54-6": 0.10, # Lilial proxy
|
| 183 |
-
},
|
| 184 |
-
},
|
| 185 |
-
"8046-19-3": { # Labdanum resinoid
|
| 186 |
-
"name": "Labdanum resinoid",
|
| 187 |
-
"constituents": {
|
| 188 |
-
"87-44-5": 0.45, # beta-Caryophyllene
|
| 189 |
-
"77-53-2": 0.35, # Patchoulol proxy
|
| 190 |
-
"80-54-6": 0.20, # Lilial proxy
|
| 191 |
-
},
|
| 192 |
-
},
|
| 193 |
-
"8007-01-0": { # Rose otto
|
| 194 |
-
"name": "Rose otto",
|
| 195 |
-
"constituents": {
|
| 196 |
-
"104-54-1": 0.35, # Cinnamyl alcohol
|
| 197 |
-
"141-12-8": 0.30, # Geranyl acetate
|
| 198 |
-
"106-24-1": 0.25, # Geraniol
|
| 199 |
-
"78-70-6": 0.10, # Linalool
|
| 200 |
-
},
|
| 201 |
-
},
|
| 202 |
-
"8000-25-7": { # Bay oil
|
| 203 |
-
"name": "Bay oil",
|
| 204 |
-
"constituents": {
|
| 205 |
-
"89-78-1": 0.35, # Eucalyptol/menthol proxy
|
| 206 |
-
"470-82-6": 0.30, # Eucalyptol
|
| 207 |
-
"123-35-3": 0.25, # Myrcene
|
| 208 |
-
"80-54-6": 0.10, # Lilial proxy
|
| 209 |
-
},
|
| 210 |
-
},
|
| 211 |
-
"8007-06-5": { # Cascarilla oil
|
| 212 |
-
"name": "Cascarilla oil",
|
| 213 |
-
"constituents": {
|
| 214 |
-
"97-53-0": 0.35, # Eugenol
|
| 215 |
-
"121-33-5": 0.30, # Vanillin
|
| 216 |
-
"104-55-2": 0.25, # Cinnamaldehyde
|
| 217 |
-
"80-54-6": 0.10, # Lilial proxy
|
| 218 |
-
},
|
| 219 |
-
},
|
| 220 |
-
"8014-17-3": { # Petitgrain oil
|
| 221 |
-
"name": "Petitgrain oil",
|
| 222 |
-
"constituents": {
|
| 223 |
-
"115-95-7": 0.40, # Linalyl acetate
|
| 224 |
"78-70-6": 0.35, # Linalool
|
| 225 |
-
"93-58-3": 0.15, # Methyl benzoate proxy
|
| 226 |
-
"80-54-6": 0.10, # Lilial proxy
|
| 227 |
-
},
|
| 228 |
-
},
|
| 229 |
-
"8023-79-2": { # Musk tonkin
|
| 230 |
-
"name": "Musk tonkin",
|
| 231 |
-
"constituents": {
|
| 232 |
-
"81-14-1": 0.50, # Musk ketone
|
| 233 |
-
"83-66-9": 0.30, # Ambrettolide proxy
|
| 234 |
-
"1222-05-5": 0.20, # Galaxolide
|
| 235 |
-
},
|
| 236 |
-
},
|
| 237 |
-
"8022-96-6": { # Jasmin absolute
|
| 238 |
-
"name": "Jasmin absolute",
|
| 239 |
-
"constituents": {
|
| 240 |
-
"106-24-1": 0.25, # Geraniol
|
| 241 |
-
"141-12-8": 0.25, # Geranyl acetate
|
| 242 |
-
"80-54-6": 0.25, # Lilial proxy
|
| 243 |
-
"78-70-6": 0.25, # Linalool
|
| 244 |
-
},
|
| 245 |
-
},
|
| 246 |
-
"8023-91-4": { # Jasmin sambac
|
| 247 |
-
"name": "Jasmin sambac",
|
| 248 |
-
"constituents": {
|
| 249 |
-
"106-24-1": 0.30, # Geraniol
|
| 250 |
-
"141-12-8": 0.30, # Geranyl acetate
|
| 251 |
-
"80-54-6": 0.25, # Lilial proxy
|
| 252 |
-
"78-70-6": 0.15, # Linalool
|
| 253 |
},
|
| 254 |
},
|
| 255 |
-
"
|
| 256 |
-
"name": "
|
| 257 |
"constituents": {
|
| 258 |
-
"
|
| 259 |
-
"
|
| 260 |
-
"
|
| 261 |
-
"
|
| 262 |
-
},
|
| 263 |
-
},
|
| 264 |
-
"9000-64-2": { # Orange flower absolute
|
| 265 |
-
"name": "Orange flower absolute",
|
| 266 |
-
"constituents": {
|
| 267 |
-
"78-70-6": 0.30, # Linalool
|
| 268 |
-
"115-95-7": 0.25, # Linalyl acetate
|
| 269 |
-
"93-58-3": 0.25, # Methyl benzoate proxy
|
| 270 |
-
"80-54-6": 0.20, # Lilial proxy
|
| 271 |
-
},
|
| 272 |
-
},
|
| 273 |
-
"9000-65-5": { # Tuberose absolute
|
| 274 |
-
"name": "Tuberose absolute",
|
| 275 |
-
"constituents": {
|
| 276 |
-
"80-54-6": 0.40, # Lilial proxy
|
| 277 |
-
"78-70-6": 0.30, # Linalool
|
| 278 |
-
"104-54-1": 0.20, # Cinnamyl alcohol
|
| 279 |
-
"106-24-1": 0.10, # Geraniol
|
| 280 |
},
|
| 281 |
},
|
| 282 |
-
"
|
| 283 |
-
"name": "
|
| 284 |
"constituents": {
|
| 285 |
-
"
|
| 286 |
-
"
|
| 287 |
-
"
|
| 288 |
-
"
|
| 289 |
},
|
| 290 |
},
|
| 291 |
}
|
|
@@ -300,7 +44,7 @@ def resolve_natural_oil_vectors(cas_id: str, registry_cache: dict) -> tuple[list
|
|
| 300 |
Compute a mass-fraction-weighted average of 2D OpenPOM and 3D shape features
|
| 301 |
based on the constituent aroma chemicals of a natural oil.
|
| 302 |
"""
|
| 303 |
-
profile = NATURAL_PROFILES.get(cas_id)
|
| 304 |
if not profile:
|
| 305 |
return [0.0] * OPENPOM_DIM, [0.0] * SHAPE_DIM
|
| 306 |
|
|
|
|
| 3 |
# Analytical composition profiles for primary Natural Complex Substances (NCS).
|
| 4 |
# Each profile maps a NATURAL:* CAS identifier to a weighted blend of single-
|
| 5 |
# molecule aroma chemicals already present in the registry.
|
| 6 |
+
# Cleaned natural profiles: constituents are verified to resolve through
|
| 7 |
+
# AromaRegistry and pass IFRA / Dortmund-UNIFAC checks. Mass fractions sum to 1.0.
|
| 8 |
NATURAL_PROFILES = {
|
| 9 |
+
"NATURAL:8007-35-0": { # Bergamot Oil (UNIFAC compliant & IFRA safe)
|
| 10 |
+
"name": "Bergamot Oil",
|
|
|
|
| 11 |
"constituents": {
|
| 12 |
+
"5989-27-5": 0.30, # Limonene (kept below IFRA 33% sensitization limit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"115-95-7": 0.35, # Linalyl acetate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"78-70-6": 0.35, # Linalool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
},
|
| 16 |
},
|
| 17 |
+
"NATURAL:8000-28-0": { # Lavender Oil (UNIFAC compliant & IFRA safe)
|
| 18 |
+
"name": "Lavender Oil",
|
| 19 |
"constituents": {
|
| 20 |
+
"78-70-6": 0.45, # Linalool
|
| 21 |
+
"115-95-7": 0.35, # Linalyl acetate
|
| 22 |
+
"123-35-3": 0.10, # Myrcene
|
| 23 |
+
"562-74-3": 0.10, # Terpinen-4-ol
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
},
|
| 25 |
},
|
| 26 |
+
"NATURAL:8000-25-7": { # Rosemary Oil (UNIFAC compliant & IFRA safe)
|
| 27 |
+
"name": "Rosemary Oil",
|
| 28 |
"constituents": {
|
| 29 |
+
"127-91-3": 0.40, # Beta-Pinene (replaced Eucalyptol)
|
| 30 |
+
"80-56-8": 0.30, # Alpha-Pinene (replaced Camphor)
|
| 31 |
+
"87-44-5": 0.20, # Caryophyllene
|
| 32 |
+
"123-35-3": 0.10, # Myrcene
|
| 33 |
},
|
| 34 |
},
|
| 35 |
}
|
|
|
|
| 44 |
Compute a mass-fraction-weighted average of 2D OpenPOM and 3D shape features
|
| 45 |
based on the constituent aroma chemicals of a natural oil.
|
| 46 |
"""
|
| 47 |
+
profile = NATURAL_PROFILES.get(cas_id) or NATURAL_PROFILES.get(f"NATURAL:{cas_id}")
|
| 48 |
if not profile:
|
| 49 |
return [0.0] * OPENPOM_DIM, [0.0] * SHAPE_DIM
|
| 50 |
|