Skip to content

Overflow Error on returnMask #10

Description

@Jomithy

Hello,

When running find_maxima.ipynb, I encountered OverflowError: Python int too large to convert to C long traced back to:

y = pListy[0:listlen].astype(np.int32)

-->types[y,x] &= resetMask

types[y,x] |= PROCESSED

Downgrading to numpy 1.26.4 from 2.3.3 temporarily fixed to issue, so it seems like the error is due to stricter type handling in bitwise operations in newer numpy versions. I am not terribly familiar with bitwise operations, but chat suggested the following change which fixed the issue for numpy 2.3.3

if maxPossible == 1:
	resetMask = ~(LISTED) & 0xFF
else:
	resetMask = ~(LISTED|EQUAL) & 0xFF

I am assuming this is more of a bandaid fix and that the type of some of the variables involved may need to change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions