Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element symbol lookup for some transuranics returns incorrect results #2784

Closed
LeanAndMean opened this issue Nov 13, 2019 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@LeanAndMean
Copy link

Configuration:

  • RDKit Version: 2019.09.1.0
  • Operating system: Ubuntu 19.04
  • Python version (if relevant): 3.7.5
  • Are you using conda? Yes
  • If you are using conda, which channel did you install the rdkit from? rdkit
  • If you are not using conda: how did you install the RDKit? N/A

Description:
Element symbol lookup via PeriodicTable.GetElementSymbol returns incorrect results.

Elements with atomic number > 114 are incorrectly labeled. There are additional entries above 118. It appears that some of the old symbols were not removed when the new symbols were added.

from rdkit.Chem import PeriodicTable
from rdkit.Chem import GetPeriodicTable
expected_atomic_nums_and_symbols = [
    (1, 'H'),
    (2, 'He'),
    (3, 'Li'),
    (4, 'Be'),
    (5, 'B'),
    (6, 'C'),
    (7, 'N'),
    (8, 'O'),
    (9, 'F'),
    (10, 'Ne'),
    (11, 'Na'),
    (12, 'Mg'),
    (13, 'Al'),
    (14, 'Si'),
    (15, 'P'),
    (16, 'S'),
    (17, 'Cl'),
    (18, 'Ar'),
    (19, 'K'),
    (20, 'Ca'),
    (21, 'Sc'),
    (22, 'Ti'),
    (23, 'V'),
    (24, 'Cr'),
    (25, 'Mn'),
    (26, 'Fe'),
    (27, 'Co'),
    (28, 'Ni'),
    (29, 'Cu'),
    (30, 'Zn'),
    (31, 'Ga'),
    (32, 'Ge'),
    (33, 'As'),
    (34, 'Se'),
    (35, 'Br'),
    (36, 'Kr'),
    (37, 'Rb'),
    (38, 'Sr'),
    (39, 'Y'),
    (40, 'Zr'),
    (41, 'Nb'),
    (42, 'Mo'),
    (43, 'Tc'),
    (44, 'Ru'),
    (45, 'Rh'),
    (46, 'Pd'),
    (47, 'Ag'),
    (48, 'Cd'),
    (49, 'In'),
    (50, 'Sn'),
    (51, 'Sb'),
    (52, 'Te'),
    (53, 'I'),
    (54, 'Xe'),
    (55, 'Cs'),
    (56, 'Ba'),
    (57, 'La'),
    (58, 'Ce'),
    (59, 'Pr'),
    (60, 'Nd'),
    (61, 'Pm'),
    (62, 'Sm'),
    (63, 'Eu'),
    (64, 'Gd'),
    (65, 'Tb'),
    (66, 'Dy'),
    (67, 'Ho'),
    (68, 'Er'),
    (69, 'Tm'),
    (70, 'Yb'),
    (71, 'Lu'),
    (72, 'Hf'),
    (73, 'Ta'),
    (74, 'W'),
    (75, 'Re'),
    (76, 'Os'),
    (77, 'Ir'),
    (78, 'Pt'),
    (79, 'Au'),
    (80, 'Hg'),
    (81, 'Tl'),
    (82, 'Pb'),
    (83, 'Bi'),
    (84, 'Po'),
    (85, 'At'),
    (86, 'Rn'),
    (87, 'Fr'),
    (88, 'Ra'),
    (89, 'Ac'),
    (90, 'Th'),
    (91, 'Pa'),
    (92, 'U'),
    (93, 'Np'),
    (94, 'Pu'),
    (95, 'Am'),
    (96, 'Cm'),
    (97, 'Bk'),
    (98, 'Cf'),
    (99, 'Es'),
    (100, 'Fm'),
    (101, 'Md'),
    (102, 'No'),
    (103, 'Lr'),
    (104, 'Rf'),
    (105, 'Db'),
    (106, 'Sg'),
    (107, 'Bh'),
    (108, 'Hs'),
    (109, 'Mt'),
    (110, 'Ds'),
    (111, 'Rg'),
    (112, 'Cn'),
    (113, 'Nh'),
    (114, 'Fl'),
    (115, 'Mc'),
    (116, 'Lv'),
    (117, 'Ts'),
    (118, 'Og')
]
# Iterate to 120 to get additional 2 entries.
rdkit_element_symbols = ([PeriodicTable.GetElementSymbol(periodic_table, atomic_num) for atomic_num in range(1, 121)])
print(rdkit_element_symbols)
for atomic_number, element_symbol in expected_atomic_nums_and_symbols:
    assert rdkit_element_symbols[atomic_number - 1] == element_symbol
@greglandrum greglandrum added this to the 2019_09_2 milestone Nov 14, 2019
@greglandrum
Copy link
Member

Confirmed. And the problem is, in fact, due to the fact that I left a couple of old entries in when I added the new names in #1575
I'll fix it.

@greglandrum greglandrum self-assigned this Nov 14, 2019
@greglandrum greglandrum changed the title Element symbol lookup via PeriodicTable.GetElementSymbol returns incorrect results Element symbol lookup for some transuranics returns incorrect results Nov 14, 2019
greglandrum added a commit to greglandrum/rdkit that referenced this issue Nov 14, 2019
greglandrum added a commit that referenced this issue Dec 3, 2019
* Fixes #2784

* changes in response to review.

* clarifying comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants