From 892b04e0fd8d64d56a63c1d85aff5630ef96e034 Mon Sep 17 00:00:00 2001 From: "ken.shirakawa" Date: Fri, 22 May 2026 13:54:27 +0900 Subject: [PATCH] Fix string identity comparison in BrainData Replace `is` / `is not` with `==` / `!=` for string literal comparison on BrainData.__dtype. The previous code emitted SyntaxWarning on Python 3.8+ and relied on CPython's string interning, which is not guaranteed behavior. - bdpy/mri/fmriprep.py:388 (xyz property) - bdpy/mri/fmriprep.py:398 (n_vertex property) --- bdpy/mri/fmriprep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bdpy/mri/fmriprep.py b/bdpy/mri/fmriprep.py index 6ebff3a2..e0ed2f40 100644 --- a/bdpy/mri/fmriprep.py +++ b/bdpy/mri/fmriprep.py @@ -385,7 +385,7 @@ def data(self): @property def xyz(self): - if self.__dtype is 'surface': + if self.__dtype == 'surface': raise NotImplementedError('Vertex xyz coordinates are not implemented yet.') return self.__xyz @@ -395,7 +395,7 @@ def index(self): @property def n_vertex(self): - if self.__dtype is not 'surface': + if self.__dtype != 'surface': raise TypeError('Not surface data.') return self.__n_vertex