Skip to content

Commit 37501a1

Browse files
authored
Merge pull request Auto-Mech#325 from avcopan/dev
Fix: Logic for canonical enantiomer handling
2 parents 18dafc7 + a16e088 commit 37501a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mechanalyzer/parser/new_spc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ def fill_spc_dct(spc_dct, spc, chk_ste=True, chk_match=True, canon_ent=True):
273273
# add AMChI
274274
full_spc_dct = mech_inchi_to_amchi({spc: full_spc_dct}, convert=canon_ent)[spc]
275275

276-
if canon_ent and 'canon_enant_ich' not in full_spc_dct:
276+
if not canon_ent:
277+
full_spc_dct['canon_enant_ich'] = full_spc_dct['inchi']
278+
elif 'canon_enant_ich' not in full_spc_dct:
277279
full_spc_dct = add_canonical_enantiomer(
278280
{spc: full_spc_dct})[spc]
279-
else:
280-
full_spc_dct['canon_enant_ich'] = full_spc_dct['inchi']
281281

282282
# Add charge and exc_flag if missing; assume 0 for both
283283
if 'charge' not in full_spc_dct or full_spc_dct['charge'] == '':

0 commit comments

Comments
 (0)