Recently, the 2.0.0 version of Numpy was released. Crappy's behavior seems to be overall unaffected by this upgrade, but a bug caused by a breaking change was already discovered.
It is unknown whether similar bugs are present elsewhere in the codebase, so the camera-related code will need to be thoroughly reviewed. I'm not favorable to restricting the compatible versions of numpy to <2.0.0, even temporarily, as this would slow down bug detection, and users can always quickly fix by downgrading to numpy 1.26. If any bugs are reported, users can be directed towards this issue.
Recently, the 2.0.0 version of Numpy was released. Crappy's behavior seems to be overall unaffected by this upgrade, but a bug caused by a breaking change was already discovered.
Specifically, the
numpy.max()
function used to return a value with a builtinfloat
orint
type. It now returns a scalar of the same numpy type as the array on which the function is applied. When using it on images with typeuint8
, this means thatnumpy.max(x) + 1
can now take values between 0 and 255, versus 1 to 256 previously. This is the cause of a bug identified in theCameraConfig
class, when an 8-bits image takes values equal to 255: https://github.com/LaboratoireMecaniqueLille/crappy/blob/e069fd4c6cf7209c56833290a24f3f4235c9684c/src/crappy/tool/camera_config/camera_config.py#L866-L868It is unknown whether similar bugs are present elsewhere in the codebase, so the camera-related code will need to be thoroughly reviewed. I'm not favorable to restricting the compatible versions of numpy to
<2.0.0
, even temporarily, as this would slow down bug detection, and users can always quickly fix by downgrading to numpy1.26
. If any bugs are reported, users can be directed towards this issue.