Skip to content

BitRound codec returns NaN if keepbits has dtype int32 instead of int64 #793

@huard

Description

@huard

This one took a while to track down...

Version: 0.15.1
Numpy: 2.2.6
Python 3.12.11

Also tested on 0.16.1 with the same results.

Note that on a different machine with a different OS, I can't reproduce the bug.

import numpy as np
from numcodecs.bitround import BitRound

codec = BitRound(keepbits=np.int32(10))
a = np.array([0.])
codec.decode(codec.encode(a))

yields

array([nan])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions