From 78af7a452d45ffc847d749c5740ca907423ba423 Mon Sep 17 00:00:00 2001
From: Yannick DAYER <yannick.dayer@idiap.ch>
Date: Mon, 27 May 2024 12:18:49 +0200
Subject: [PATCH] fix: adapt to numpy deprecation of int and float.

`numpy.int` and `numpy.float` have been dropped in numpy 1.24.
Using `int` and `float` instead.
---
 src/bob/measure/__init__.py | 2 +-
 tests/test_error.py         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bob/measure/__init__.py b/src/bob/measure/__init__.py
index 264d74f..1446f62 100644
--- a/src/bob/measure/__init__.py
+++ b/src/bob/measure/__init__.py
@@ -303,7 +303,7 @@ def cmc(cmc_scores):
     # compute MC
     match_characteristic = numpy.zeros(
         (max([len(neg) for neg, _ in cmc_scores if neg is not None]) + 1,),
-        numpy.int,
+        dtype=int,
     )
 
     for neg, pos in cmc_scores:
diff --git a/tests/test_error.py b/tests/test_error.py
index f1655e3..7248968 100644
--- a/tests/test_error.py
+++ b/tests/test_error.py
@@ -495,7 +495,7 @@ def test_open_set_rates():
             for key in fh.keys():
                 which = negative if "neg" in key else positive
                 val = fh[key][:]
-                if val.dtype == numpy.float and len(val) == 1:
+                if val.dtype is float and len(val) == 1:
                     val = val[0]
                 if val.dtype.char == "S" and val[0].decode() == "None":
                     val = None
-- 
GitLab