Commit 111b822
committed
refactor(data): resolve names from master_enrichment, the one base table (#224)
app.py built its own name lookup from properties.parquet and then merged iupac_backfill.parquet
itself. build_enrichment.py had already done that work — and better — so the two diverged in three
ways, all silent:
1. The enrichment build resolves a name curated-list-first, then PubChem common name, then IUPAC
name, then a molecular-formula fallback, un-inverting CAS-style ordering along the way. None
of that reached app.py's table.
2. The merge read only `iupac_name` from the backfill and ignored the `common_name` column, so
every PubChem Title the crawler recovered was thrown away on arrival.
3. Nothing carried the formula fallback, so the molecules that only have one resolved to nothing.
Measured before the change: 754 molecules had a name in master_enrichment that app._NAME_TABLE did
not know — and not obscure ones. cedrol, fenchyl alcohol, hydroxycitronellal and musk ketone all
rendered by name in the grid and came back empty from the UI's own lookup. After: 0.
Sourcing the resolved name straight off the base table makes the grid and the lookup agree by
construction instead of by coincidence, and deletes a whole merge function rather than adding one.
That is what #224 is actually asking for, applied where the duplication genuinely was.
Note what is deliberately NOT folded in. profile_index.npz is an 8,850 x 183 matrix — that 183 is
the FLAVOUR-PROFILE vector (6 taste + 172 aroma + 5 mouthfeel), not the head count, which is 195.
The 12 Tox21 heads are excluded on purpose: safety is not a flavour-match dimension and must never
steer "what tastes similar". flavor_map.parquet is a UMAP embedding. Different shapes serving
different questions; forcing either into a row-oriented molecule table would be worse, not tidier.
odor_notes/taste_notes are documented-text SOURCES the enrichment build consumes — upstream of the
base table, not competitors to it.
Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>1 parent 7e58b84 commit 111b822
1 file changed
Lines changed: 24 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
234 | 244 | | |
235 | 245 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 246 | + | |
252 | 247 | | |
253 | 248 | | |
254 | 249 | | |
| |||
0 commit comments