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]: The script extract_renewal_events.py fails if no renewal events occur #213

Open
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

If no renewal event occurs, the script should still work and generate an output file.

The script might raise a warning but not an exception.

Actual behavior

If no renewal event occurs, the script raises an exception by construction:

Traceback (most recent call last):
  File "mdtools/scripts/dynamics/extract_renewal_events.py", line 921, in <module>
    raise ValueError("Could not detect any renewal event")
ValueError: Could not detect any renewal event

Steps to reproduce

Run the script on a trajectory without renewal events (or choose the atom groups or the cutoff such that no renewal events occur).

Supposed bug location

Turn the exception in line 921 into a warning:

raise ValueError("Could not detect any renewal event")

This requires changes in the following code, because if no renewal events occur, the array data cannot be indexed as done in the script.

Possible solution

A possible solution might be to initiate data as an array of NaN's of the appropriate shape if no renewal events occur.

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