Skip to content

Commit ce12075

Browse files
committed
lint
1 parent 52ae436 commit ce12075

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pymatgen/analysis/defects/corrections/freysoldt.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def get_freysoldt_correction(
9898
dielectric = float(np.mean(dielectric))
9999
elif np.ndim(dielectric) == 2: # pragma: no cover
100100
dielectric = float(np.mean(dielectric.diagonal()))
101-
else:
102-
msg = f"Dielectric constant is cannot be converted into a scalar. Currently of type {type(dielectric)}"
101+
else: # pragma: no cover
102+
msg = f"Dielectric constant cannot be converted into a scalar. Currently of type {type(dielectric)}"
103103
raise ValueError(
104104
msg,
105105
)
@@ -133,13 +133,12 @@ def get_freysoldt_correction(
133133
msg = "defect_locpot must be of type Locpot or dict"
134134
raise ValueError(msg)
135135

136-
# TODO this can be done with regridding later
137136
if isinstance(bulk_locpot, VolumetricData):
138137
list_bulk_plnr_avg_esp = [*map(bulk_locpot.get_average_along_axis, [0, 1, 2])]
139138
elif isinstance(bulk_locpot, dict):
140139
bulk_locpot_ = {int(k): v for k, v in bulk_locpot.items()}
141140
list_bulk_plnr_avg_esp = [bulk_locpot_[i] for i in range(3)]
142-
else:
141+
else: # pragma: no cover
143142
msg = "bulk_locpot must be of type Locpot or dict"
144143
raise ValueError(msg)
145144

@@ -405,7 +404,7 @@ def plot_plnr_avg(
405404
If True then saves plot as str(title) + "FreyplnravgPlot.pdf"
406405
ax (matplotlib.axes.Axes): Axes object to plot on. If None, makes new figure.
407406
"""
408-
if not plot_data["pot_plot_data"]:
407+
if not plot_data["pot_plot_data"]: # pragma: no cover
409408
msg = "Cannot plot potential alignment before running correction!"
410409
raise ValueError(msg)
411410

@@ -442,9 +441,9 @@ def plot_plnr_avg(
442441
ax.set_ylabel("Potential (V)", fontsize=15)
443442
ax.legend(loc=9)
444443
ax.axhline(y=0, linewidth=0.2, color="black")
445-
if title is not None:
444+
if title is not None: # pragma: no cover
446445
ax.set_title(str(title), fontsize=18)
447446
ax.set_xlim(0, max(x))
448-
if saved:
447+
if saved: # pragma: no cover
449448
fig.savefig(str(title) + "FreyplnravgPlot.pdf")
450449
return ax

0 commit comments

Comments
 (0)