Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rakowski committed Nov 8, 2023
1 parent 58fb60a commit 8720de8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions py4DSTEM/process/diffraction/crystal_ACOM.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,9 @@ 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] == False) # noqa: E712,E501
inds_cand = np.delete(
inds_cand, mark.ravel()[inds_cand] == False # noqa: E712
)

if inds_cand.size == 0:
grow = False
Expand Down Expand Up @@ -1893,7 +1895,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] == False) #noqa: E712
np.delete(inds_new, mark.ravel()[inds_new] == False) # noqa: E712
)

if inds_cand.size == 0:
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/polar/polar_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def find_peaks_single_pattern(
if remove_masked_peaks:
peaks = np.delete(
peaks,
mask_bool[peaks[:, 0], peaks[:, 1]] == False, # noqa: E712
mask_bool[peaks[:, 0], peaks[:, 1]] == False, # noqa: E712
axis=0,
)

Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/strain/latticevectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] == False # noqa:E712
deletemask = braggpeaks.data["index_mask"] == False # noqa:E712
braggpeaks.remove(deletemask)

# Check to ensure enough peaks are present
Expand Down
11 changes: 7 additions & 4 deletions py4DSTEM/process/strain/strain.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,17 +791,20 @@ def show_strain(

# Get images
e_xx = np.ma.array(
self.get_slice("exx").data, mask=self.get_slice("mask").data == False # noqa: E712,E501
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 == False # noqa: E712,E501
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 == False # noqa: E712,E501
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 == False, # noqa: E712
mask=self.get_slice("mask").data == False, # noqa: E712
)

## Plot
Expand Down

0 comments on commit 8720de8

Please sign in to comment.