Skip to content

Unsafe numpy downcasting #3

@parejkoj

Description

@parejkoj

If I create my mask like this, mask = (int_mask & VALUE), I get a numpy exception in PyGuide.findStars:

Cannot cast array data from dtype('uint8') to dtype('bool') according to the rule 'safe'

Doing mask = (int_mask & VALUE) != 0 will get rid of the error, but it might be good to have PyGuide either force the downcast, or just handle int mask arrays (with all 0s "good" and all non-zeros" bad).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions