Skip to content

[Bug]: IndexError in script extract_renewal_events.py #214

@andthum

Description

@andthum

MDTools version

0.0.7.0

Python version

3.8.6

Operating system

CentOS Linux 7 (Core)

Expected behavior

The script should run without raising an IndexError.

Actual behavior

Sometimes, the script raises an IndexError:

Traceback (most recent call last):
  File "mdtools/scripts/dynamics/extract_renewal_events.py", line 902, in <module>
    data = extract_renewal_events(
  File "mdtools/scripts/dynamics/extract_renewal_events.py", line 423, in extract_renewal_events
    selix_t0[rix_t0] = selix_t0[rix_t0][0]
IndexError: index 0 is out of bounds for axis 0 with size 0

Steps to reproduce

Difficult, sometimes the IndexError is raised, sometimes not.

I suppose that the error happens if in any trajectory frame none of the reference compounds is attached to a selection compound.

Supposed bug location

The IndexError is raised in line 423:

selix_t0[rix_t0] = selix_t0[rix_t0][0]

It indicates that there are not any reference compounds that are attached to a selection compound. However, in this case the if clause in line 405 should not have been entered. So, till now I do not really understand why this IndexError happens.

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions