Skip to content

Commit 3ebddf5

Browse files
committed
fix: remove deprecated use of np.NAN and np.nan
1 parent fa7dd79 commit 3ebddf5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/pyannote/metrics/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def report(self, display: bool = False) -> pd.DataFrame:
164164
if total > 0:
165165
row[key, "%"] = 100 * value / total
166166
else:
167-
row[key, "%"] = np.NaN
167+
row[key, "%"] = np.nan
168168

169169
report.append(row)
170170
uris.append(uri)
@@ -186,7 +186,7 @@ def report(self, display: bool = False) -> pd.DataFrame:
186186
if total > 0:
187187
row[key, "%"] = 100 * value / total
188188
else:
189-
row[key, "%"] = np.NaN
189+
row[key, "%"] = np.nan
190190

191191
row[self.name, "%"] = 100 * abs(self)
192192
report.append(row)

src/pyannote/metrics/spotting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ def _variable_latency(self, reference: Union[Timeline, Annotation],
166166
**kwargs) -> Details:
167167

168168
# pre-compute latencies
169-
speaker_latency = np.NAN * np.ones((len(timestamps), 1))
170-
absolute_latency = np.NAN * np.ones((len(timestamps), 1))
169+
speaker_latency = np.nan * np.ones((len(timestamps), 1))
170+
absolute_latency = np.nan * np.ones((len(timestamps), 1))
171171
if isinstance(reference, Annotation):
172172
reference = reference.get_timeline(copy=False)
173173
if reference:
@@ -206,8 +206,8 @@ def _variable_latency(self, reference: Union[Timeline, Annotation],
206206
target_trial = False
207207

208208
# the notion of "latency" is not applicable to non-target trials
209-
absolute_latency = np.NAN
210-
speaker_latency = np.NAN
209+
absolute_latency = np.nan
210+
speaker_latency = np.nan
211211

212212
return {
213213
SPOTTING_TARGET: target_trial,

0 commit comments

Comments
 (0)