Skip to content

Commit 2c5a913

Browse files
committed
black formatting
1 parent d65ffda commit 2c5a913

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

py4DSTEM/process/diffraction/crystal_phase.py

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,8 @@ def plot_phase_weights(
966966
if total_intensity_normalize:
967967
sub = self.int_total > 0.0
968968
for a0 in range(self.num_fits):
969-
phase_weights[:, :, a0][sub] /= (self.int_total[sub]+1e-12)
970-
phase_residuals[sub] /= (self.int_total[sub]+1e-12)
969+
phase_weights[:, :, a0][sub] /= self.int_total[sub] + 1e-12
970+
phase_residuals[sub] /= self.int_total[sub] + 1e-12
971971

972972
# intensity range for plotting
973973
if weight_normalize:
@@ -1112,7 +1112,7 @@ def plot_phase_maps(
11121112
if total_intensity_normalize:
11131113
sub = self.int_total > 0.0
11141114
for a0 in range(self.num_fits):
1115-
phase_weights[:, :, a0][sub] /= (self.int_total[sub]+1e-12)
1115+
phase_weights[:, :, a0][sub] /= self.int_total[sub] + 1e-12
11161116

11171117
# intensity range for plotting
11181118
if weight_normalize:
@@ -1276,7 +1276,6 @@ def plot_dominant_phase(
12761276
12771277
"""
12781278

1279-
12801279
if phase_colors is None:
12811280
phase_colors = np.array(
12821281
[
@@ -1327,34 +1326,36 @@ def plot_dominant_phase(
13271326
sub = phase_sig[a0] > phase_corr
13281327
phase_map[sub] = a0
13291328
phase_corr[sub] = phase_sig[a0][sub]
1330-
self.phase_corr_total = np.sum(phase_corr,axis=0)
1329+
self.phase_corr_total = np.sum(phase_corr, axis=0)
13311330

1332-
phase_scale = np.ones((
1333-
self.phase_sig.shape[1],
1334-
self.phase_sig.shape[2],
1335-
))
1331+
phase_scale = np.ones(
1332+
(
1333+
self.phase_sig.shape[1],
1334+
self.phase_sig.shape[2],
1335+
)
1336+
)
13361337
# if self.single_phase:
1337-
# if reliability_range is not None:
1338-
# phase_scale *= np.clip(
1339-
# (self.phase_reliability - reliability_range[0])
1340-
# / (reliability_range[1] - reliability_range[0]),
1341-
# 0,
1342-
# 1,
1343-
# )
1344-
# if correlation_range is not None:
1345-
# phase_scale *= np.clip(
1346-
# (self.phase_corr_total - correlation_range[0])
1347-
# / (correlation_range[1] - correlation_range[0]),
1348-
# 0,
1349-
# 1,
1350-
# )
1351-
1352-
# phase_scale = np.clip(
1353-
# (self.phase_reliability - reliability_range[0])
1354-
# / (reliability_range[1] - reliability_range[0]),
1355-
# 0,
1356-
# 1,
1357-
# )
1338+
# if reliability_range is not None:
1339+
# phase_scale *= np.clip(
1340+
# (self.phase_reliability - reliability_range[0])
1341+
# / (reliability_range[1] - reliability_range[0]),
1342+
# 0,
1343+
# 1,
1344+
# )
1345+
# if correlation_range is not None:
1346+
# phase_scale *= np.clip(
1347+
# (self.phase_corr_total - correlation_range[0])
1348+
# / (correlation_range[1] - correlation_range[0]),
1349+
# 0,
1350+
# 1,
1351+
# )
1352+
1353+
# phase_scale = np.clip(
1354+
# (self.phase_reliability - reliability_range[0])
1355+
# / (reliability_range[1] - reliability_range[0]),
1356+
# 0,
1357+
# 1,
1358+
# )
13581359

13591360
# else:
13601361
if not self.single_phase:
@@ -1371,7 +1372,7 @@ def plot_dominant_phase(
13711372

13721373
# normalize the reliability by the intensity of each experimental pattern
13731374
if normalize_exp_intensity:
1374-
phase_rel /= (self.int_total+1e-12)
1375+
phase_rel /= self.int_total + 1e-12
13751376

13761377
# phase_scale = np.clip(
13771378
# (phase_rel - reliability_range[0])

0 commit comments

Comments
 (0)