@@ -98,8 +98,8 @@ def get_freysoldt_correction(
98
98
dielectric = float (np .mean (dielectric ))
99
99
elif np .ndim (dielectric ) == 2 : # pragma: no cover
100
100
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 )} "
103
103
raise ValueError (
104
104
msg ,
105
105
)
@@ -133,13 +133,12 @@ def get_freysoldt_correction(
133
133
msg = "defect_locpot must be of type Locpot or dict"
134
134
raise ValueError (msg )
135
135
136
- # TODO this can be done with regridding later
137
136
if isinstance (bulk_locpot , VolumetricData ):
138
137
list_bulk_plnr_avg_esp = [* map (bulk_locpot .get_average_along_axis , [0 , 1 , 2 ])]
139
138
elif isinstance (bulk_locpot , dict ):
140
139
bulk_locpot_ = {int (k ): v for k , v in bulk_locpot .items ()}
141
140
list_bulk_plnr_avg_esp = [bulk_locpot_ [i ] for i in range (3 )]
142
- else :
141
+ else : # pragma: no cover
143
142
msg = "bulk_locpot must be of type Locpot or dict"
144
143
raise ValueError (msg )
145
144
@@ -405,7 +404,7 @@ def plot_plnr_avg(
405
404
If True then saves plot as str(title) + "FreyplnravgPlot.pdf"
406
405
ax (matplotlib.axes.Axes): Axes object to plot on. If None, makes new figure.
407
406
"""
408
- if not plot_data ["pot_plot_data" ]:
407
+ if not plot_data ["pot_plot_data" ]: # pragma: no cover
409
408
msg = "Cannot plot potential alignment before running correction!"
410
409
raise ValueError (msg )
411
410
@@ -442,9 +441,9 @@ def plot_plnr_avg(
442
441
ax .set_ylabel ("Potential (V)" , fontsize = 15 )
443
442
ax .legend (loc = 9 )
444
443
ax .axhline (y = 0 , linewidth = 0.2 , color = "black" )
445
- if title is not None :
444
+ if title is not None : # pragma: no cover
446
445
ax .set_title (str (title ), fontsize = 18 )
447
446
ax .set_xlim (0 , max (x ))
448
- if saved :
447
+ if saved : # pragma: no cover
449
448
fig .savefig (str (title ) + "FreyplnravgPlot.pdf" )
450
449
return ax
0 commit comments