From 58fb60aa5f7cfe2443f9bca20bc58c211151d857 Mon Sep 17 00:00:00 2001 From: alex-rakowski Date: Wed, 8 Nov 2023 09:02:05 -0800 Subject: [PATCH] changing is Bool to == Bool --- py4DSTEM/process/diffraction/crystal_ACOM.py | 4 ++-- py4DSTEM/process/polar/polar_peaks.py | 2 +- py4DSTEM/process/strain/latticevectors.py | 2 +- py4DSTEM/process/strain/strain.py | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/py4DSTEM/process/diffraction/crystal_ACOM.py b/py4DSTEM/process/diffraction/crystal_ACOM.py index 94d7a98cb..f84bffe4e 100644 --- a/py4DSTEM/process/diffraction/crystal_ACOM.py +++ b/py4DSTEM/process/diffraction/crystal_ACOM.py @@ -1840,7 +1840,7 @@ def cluster_grains( xr = np.clip(x + np.arange(-1, 2, dtype="int"), 0, sig.shape[0] - 1) yr = np.clip(y + np.arange(-1, 2, dtype="int"), 0, sig.shape[1] - 1) inds_cand = inds_all[xr[:, None], yr[None], :].ravel() - inds_cand = np.delete(inds_cand, mark.ravel()[inds_cand] is False) + inds_cand = np.delete(inds_cand, mark.ravel()[inds_cand] == False) # noqa: E712,E501 if inds_cand.size == 0: grow = False @@ -1893,7 +1893,7 @@ def cluster_grains( inds_grain = np.append(inds_grain, inds_cand[keep]) inds_cand = np.unique( - np.delete(inds_new, mark.ravel()[inds_new] is False) + np.delete(inds_new, mark.ravel()[inds_new] == False) #noqa: E712 ) if inds_cand.size == 0: diff --git a/py4DSTEM/process/polar/polar_peaks.py b/py4DSTEM/process/polar/polar_peaks.py index b923ba45f..9650361d7 100644 --- a/py4DSTEM/process/polar/polar_peaks.py +++ b/py4DSTEM/process/polar/polar_peaks.py @@ -167,7 +167,7 @@ def find_peaks_single_pattern( if remove_masked_peaks: peaks = np.delete( peaks, - mask_bool[peaks[:, 0], peaks[:, 1]] is False, + mask_bool[peaks[:, 0], peaks[:, 1]] == False, # noqa: E712 axis=0, ) diff --git a/py4DSTEM/process/strain/latticevectors.py b/py4DSTEM/process/strain/latticevectors.py index b29d8f69e..68a3ddd45 100644 --- a/py4DSTEM/process/strain/latticevectors.py +++ b/py4DSTEM/process/strain/latticevectors.py @@ -182,7 +182,7 @@ def fit_lattice_vectors(braggpeaks, x0=0, y0=0, minNumPeaks=5): # Remove unindexed peaks if "index_mask" in braggpeaks.dtype.names: - deletemask = braggpeaks.data["index_mask"] is False + deletemask = braggpeaks.data["index_mask"] == False # noqa:E712 braggpeaks.remove(deletemask) # Check to ensure enough peaks are present diff --git a/py4DSTEM/process/strain/strain.py b/py4DSTEM/process/strain/strain.py index 2175ba11d..91d6a8ecc 100644 --- a/py4DSTEM/process/strain/strain.py +++ b/py4DSTEM/process/strain/strain.py @@ -791,17 +791,17 @@ def show_strain( # Get images e_xx = np.ma.array( - self.get_slice("exx").data, mask=self.get_slice("mask").data is False + self.get_slice("exx").data, mask=self.get_slice("mask").data == False # noqa: E712,E501 ) e_yy = np.ma.array( - self.get_slice("eyy").data, mask=self.get_slice("mask").data is False + self.get_slice("eyy").data, mask=self.get_slice("mask").data == False # noqa: E712,E501 ) e_xy = np.ma.array( - self.get_slice("exy").data, mask=self.get_slice("mask").data is False + self.get_slice("exy").data, mask=self.get_slice("mask").data == False # noqa: E712,E501 ) theta = np.ma.array( self.get_slice("theta").data, - mask=self.get_slice("mask").data is False, + mask=self.get_slice("mask").data == False, # noqa: E712 ) ## Plot