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

Aperta
#675 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia nel percorso di inizializzazione di ARCSpecies in arc.species che gestisce species_dict e ricostruisce mol.atoms, quindi riproduci l'esempio usando ARCSpecies.as_dict(). Conferma che le etichette degli atomi ricostruiti corrispondano alle etichette in species_dict e verifica lo stesso comportamento con un test mirato o rieseguendo l'esempio fornito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Good first issue Module: Species Topic: 2D representation Topic: RMG Type: Bug Type: Error Type: Risk of Error

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.
😄

Lingua principale
Python
Stelle
55
Fork
26
Merge medio
7g 8h
PR unite (30g)
12

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ReactionMechanismGenerator/ARC

Tutte le issue di ReactionMechanismGenerator/ARC

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.