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

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

Open
andthum opened this issue Jan 2, 2024 · 0 comments
Open

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

andthum opened this issue Jan 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@andthum
Copy link
Owner

andthum commented Jan 2, 2024

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

@andthum andthum added the bug Something isn't working label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant