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

Fix IndexError #29

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Fix IndexError #29

merged 6 commits into from
Jan 23, 2025

Conversation

maxibor
Copy link
Owner

@maxibor maxibor commented Jan 23, 2025

Fixing the following error:

Traceback (most recent call last):
  File "/path/to/envs/pydamage/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/path/to/envs/pydamage/lib/python3.12/site-packages/pydamage/damage.py", line 215, in test_damage
    ) = al.compute_damage()
        ^^^^^^^^^^^^^^^^^^^
  File "/path/to/envs/pydamage/lib/python3.12/site-packages/pydamage/damage.py", line 125, in compute_damage
    CT_damage_amount[CT_pos] = CT_counts / C_counts[CT_pos]
                                           ~~~~~~~~^^^^^^^^
IndexError: index 8 is out of bounds for axis 0 with size 6

This error occured in edge cases when the indicing of C_counts by CT_pos was discordant.

@maxibor maxibor merged commit ff29afa into master Jan 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant