add lanthanide and actinide support to xyz2mol_tmc#2
Merged
corinwagen merged 3 commits intomasterfrom Mar 10, 2026
Merged
Conversation
Member
corinwagen
commented
Mar 6, 2026
- Extend TRANSITION_METALS/TRANSITION_METALS_NUM to include Ce-Yb (58-70) and Ac-Lr (89-103); add missing Lu to ALLOWED_OXIDATION_STATES
- Add oxidation states for all new f-block elements
- Add atomic_valence_electrons for all metals in both xyz2mol_tmc.py and xyz2mol_local.py (required to avoid KeyError in charge assignment)
- Extend ATOM_LIST in xyz2mol_local.py with Am-Lr (was missing, causing ValueError for any actinide heavier than Pu)
- Rebuild MetalNon_Hg and fix_NO2 SMARTS programmatically from TRANSITION_METALS_NUM so future additions are automatic
- Route Ln/An through get_tmc_mol in steamroll.py (previously fell back to geometry-only xyz2ac_obabel); empty _SKIP_XYZ2MOL
- Add tests: lookup completeness, SMARTS validity, Ce 18-crown-6 end-to-end, [UCl6]2- actinide end-to-end, ferrocene regression
- Extend TRANSITION_METALS/TRANSITION_METALS_NUM to include Ce-Yb (58-70) and Ac-Lr (89-103); add missing Lu to ALLOWED_OXIDATION_STATES - Add oxidation states for all new f-block elements - Add atomic_valence_electrons for all metals in both xyz2mol_tmc.py and xyz2mol_local.py (required to avoid KeyError in charge assignment) - Extend __ATOM_LIST__ in xyz2mol_local.py with Am-Lr (was missing, causing ValueError for any actinide heavier than Pu) - Rebuild MetalNon_Hg and fix_NO2 SMARTS programmatically from TRANSITION_METALS_NUM so future additions are automatic - Route Ln/An through get_tmc_mol in steamroll.py (previously fell back to geometry-only xyz2ac_obabel); empty _SKIP_XYZ2MOL - Add tests: lookup completeness, SMARTS validity, Ce 18-crown-6 end-to-end, [UCl6]2- actinide end-to-end, ferrocene regression Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jevandezande
approved these changes
Mar 6, 2026
Contributor
jevandezande
left a comment
There was a problem hiding this comment.
LGTM, with soft request to clean up prior code.
|
|
||
| # Lanthanides — 4f electrons treated as core-like; dominant +3 chemistry. | ||
| # Note: only used in get_proposed_ligand_charge() which runs on metal-free fragments. | ||
| atomic_valence_electrons[58] = 3 # Ce |
Contributor
There was a problem hiding this comment.
Can we rewrite this section so that the whole dictionary gets built at once?
| atomic_valence_electrons[53] = 7 | ||
|
|
||
| # d-block TMs — match values in xyz2mol_tmc.py | ||
| atomic_valence_electrons[21] = 3 # Sc |
Contributor
There was a problem hiding this comment.
Can we rewrite this section so that the whole dictionary gets built at once?
jevandezande
approved these changes
Mar 9, 2026
Comment on lines
+147
to
+150
| **{z: [20] for z in range(21, 31)}, # Sc–Zn | ||
| **{z: [20] for z in range(39, 49)}, # Y–Cd | ||
| **{z: [20] for z in range(57, 81)}, # La–Hg | ||
| **{z: [20] for z in range(89, 104)}, # Ac–Lr |
Member
Author
There was a problem hiding this comment.
yeah, it's much clearer this way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.