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

ARCSpecies does not show atom labels for the mol object if it was generated from a species_dict #675

Open
kfir4444 opened this issue Jun 13, 2023 · 0 comments

Comments

@kfir4444
Copy link
Collaborator

kfir4444 commented Jun 13, 2023

Describe the bug
ARCSpecies does not show atom labels for the mol object if it was generated from a species_dict

How to reproduce

>>> from arc.species import ARCSpecies
>>> spc = ARCSpecies(label="fail", smiles="CC")
>>> for index, atom in enumerate(spc.mol.atoms):
...     atom.label = str(index)
... 
>>> new_spc = ARCSpecies(species_dict=spc.as_dict())
>>> print([atom.label for atom in new_spc.mol.atoms])
['', '', '', '', '', '', '', '']

even though the species_dict does have atom labels:

'mol': {'atoms': [{'element': {'number': 6, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '0',
    'lone_pairs': 0,
    'id': -27544,
    'props': {'inRing': False},
    'atomtype': 'Cs',
    'edges': {-27543: 1.0, -27542: 1.0, -27541: 1.0, -27540: 1.0}},
   {'element': {'number': 6, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '1',
    'lone_pairs': 0,
    'id': -27543,
    'props': {'inRing': False},
    'atomtype': 'Cs',
    'edges': {-27544: 1.0, -27539: 1.0, -27538: 1.0, -27537: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '2',
    'lone_pairs': 0,
    'id': -27542,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27544: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '3',
    'lone_pairs': 0,
    'id': -27541,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27544: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '4',
    'lone_pairs': 0,
    'id': -27540,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27544: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '5',
    'lone_pairs': 0,
    'id': -27539,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27543: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '6',
    'lone_pairs': 0,
    'id': -27538,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27543: 1.0}},
   {'element': {'number': 1, 'isotope': -1},
    'radical_electrons': 0,
    'charge': 0,
    'label': '7',
    'lone_pairs': 0,
    'id': -27537,
    'props': {'inRing': False},
    'atomtype': 'H',
    'edges': {-27543: 1.0}}],

(see the 'labels' on the atom list)
Expected behavior
return the same labels.

Additional context
Accurate parsing of the species object is important for restarts and for testing, as they help to avoid obsolete callings of other functions while performing tests, which may cause unrelated failures.
😄

kfir4444 added a commit that referenced this issue Sep 21, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 22, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 22, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 26, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 26, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 26, 2023
This due to issue #675, this function also moved the atom indices when copying.(#675)
kfir4444 added a commit that referenced this issue Sep 26, 2023
This due to issue #675, this function also moved the atom indices when copying.
kfir4444 added a commit that referenced this issue Sep 27, 2023
This due to issue #675, this function also moved the atom indices when copying.
kfir4444 added a commit that referenced this issue Oct 2, 2023
This due to issue #675, this function also moved the atom indices when copying.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant