Commit a752fb6
committed
fix(data): recover 524 silently-unnamed molecules; prefer flavorist names
Three naming defects, found by auditing what the grid and cards actually render.
1. NaN IS TRUTHY. `pr.get("common_name") or pr.get("iupac_name")` returns NaN whenever
the common name is missing, so it never fell through to the IUPAC name — leaving
~500 molecules with no name at all even though a perfectly good one sat in the
table. They rendered as raw SMILES. Replaced with an explicit _pick_name() that
type-checks each candidate, with a comment explaining why the idiomatic `or` is
wrong here so nobody "simplifies" it back.
2. CURATED NAMES LOST TO SYSTEMATIC ONES. PubChem's "common_name" is frequently
systematic — spilanthol's is "N-(2-Methylpropyl)-2,6,8-decatrienamide" — so our
hand-picked flavorist names were being overridden by worse ones. Curated names
(flavors + aroma/mouthfeel supplements, 836 of them) now take precedence: those
were chosen deliberately as what a flavorist calls the molecule. spilanthol now
reads "spilanthol".
3. CAS-INVERTED NAMES READ BACKWARDS. "Carvone, (+-)-", "Cyclohexanol, 5-methyl-2-
(1-methylethenyl)-" — an ordering that exists for alphabetised print indexes.
_uninvert_cas() handles the three cases separately (stereo descriptor -> prefix
keeping the parent's case; derivative word -> suffix; substituent -> prefix with
the parent lowercased) and returns anything it doesn't recognise untouched, since
a wrong "fix" is worse than none. 124 -> 16.
Net: 7,559 -> 8,083 named of 8,853. The remaining 770 genuinely have no name in any
source we hold and need the PubChem crawl (#209).
Part of #217.
Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>1 parent 43bf224 commit a752fb6
1 file changed
Lines changed: 72 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
123 | 187 | | |
124 | 188 | | |
125 | 189 | | |
| |||
150 | 214 | | |
151 | 215 | | |
152 | 216 | | |
| 217 | + | |
153 | 218 | | |
154 | | - | |
| 219 | + | |
155 | 220 | | |
156 | 221 | | |
157 | 222 | | |
158 | 223 | | |
159 | 224 | | |
160 | 225 | | |
161 | 226 | | |
162 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
163 | 232 | | |
164 | 233 | | |
165 | 234 | | |
| |||
221 | 290 | | |
222 | 291 | | |
223 | 292 | | |
224 | | - | |
| 293 | + | |
225 | 294 | | |
226 | 295 | | |
227 | 296 | | |
| |||
0 commit comments