Skip to content

bug when using gaussian logs for seminario  #76

@landreola

Description

@landreola

Description

When using Gaussian logs to run seminario.py the atoms cannot be read from the archive because the atoms property of the structure has been initialized as None and it is trying to append to a list.

Traceback

Traceback (most recent call last):
  File "/afs/crc.nd.edu/user/l/landreol/q2mm/q2mm/seminario.py", line 921, in <module>
    main(sys.argv[1:])
  File "/afs/crc.nd.edu/user/l/landreol/q2mm/q2mm/seminario.py", line 858, in main
    mw_hessian = copy.deepcopy(log.structures[-1].hess)
  File "/afs/crc.nd.edu/user/l/landreol/q2mm/q2mm/schrod_indep_filetypes.py", line 1076, in structures
    self.read_archive()
  File "/afs/crc.nd.edu/user/l/landreol/q2mm/q2mm/schrod_indep_filetypes.py", line 1417, in read_archive
    struct._atoms.append(Atom(element=ele, x=float(x), y=float(y), z=float(z)))
AttributeError: 'NoneType' object has no attribute 'append'

To Reproduce

I ran this command (a single structure to make it simpler, it reproduces the issue):

seminario.py -i mm3.fld -o project.seminario.fld --mol Small_system_alkene_ligand_me_substrate.mol2 --log Small_system_alkene_ligand_me_substrate.log

Files

These files should be all you need to reproduce it.
seminario_bug_1.zip

My fix

I put a try/except at line 1417 of schro_indep_filetypes.py:

            try:
                struct._atoms.append(Atom(element=ele, x=float(x), y=float(y), z=float(z)))
            except AttributeError:
                struct._atoms=[Atom(element=ele, x=float(x), y=float(y), z=float(z))]

But I figured you might want to change how the property is initialized in case it affects anything else, so I did not push the change myself.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions