Skip to content

Commit 7b79956

Browse files
committed
MAINT: update ThermalElectronic docstrings
1 parent 7d3329c commit 7b79956

File tree

1 file changed

+32
-49
lines changed

1 file changed

+32
-49
lines changed

dfttk/thermal_electronic/thermal_electronic.py

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,16 @@ def read_total_electron_dos(
141141
Reads the total electron DOS data from VASP calculations for different volumes.
142142
143143
Args:
144-
path (str):
145-
Path to the directory containing the specific folders with
146-
CONTCAR and vasprun.xml files.
147-
folder_prefix (str, optional):
148-
Prefix of the electronic folders. Defaults to ``"elec"``.
149-
vasprun_name (str, optional):
150-
Name of the vasprun.xml file. Defaults to ``"vasprun.xml.elec_dos"``.
151-
selected_volumes (np.ndarray, optional):
152-
List of selected volumes to keep the electron DOS data. Defaults
153-
to None.
144+
path (str): Path to the directory containing the specific folders with
145+
vasprun.xml files.
146+
folder_prefix (str, optional): Prefix of the electronic folders. Defaults to ``"elec"``.
147+
vasprun_name (str, optional): Name of the vasprun.xml file. Defaults to ``"vasprun.xml.elec_dos"``.
148+
selected_volumes (np.ndarray, optional): List of selected volumes to keep the electron DOS data. Defaults to None.
154149
155150
Raises:
156-
ValueError:
157-
If selected volumes are not found.
158-
ValueError:
159-
If the number of atoms is not the same for all volumes.
160-
ValueError:
161-
If the number of electrons is not the same for all volumes.
151+
ValueError: If selected volumes are not found.
152+
ValueError: If the number of atoms is not the same for all volumes.
153+
ValueError: If the number of electrons is not the same for all volumes.
162154
"""
163155

164156
self.path = path
@@ -272,19 +264,14 @@ def set_total_electron_dos(
272264
Set the total electron DOS directly.
273265
274266
Args:
275-
number_of_atoms (int):
276-
Number of atoms corresponding to the DOS data.
277-
volumes (np.ndarray):
278-
1D array of volumes, shape (n_volumes,), in ų.
279-
energies_list (list[np.ndarray]):
280-
List of 1D arrays of energies referenced to the Fermi level
267+
number_of_atoms (int): Number of atoms corresponding to the DOS data.
268+
volumes (np.ndarray): 1D array of volumes, shape (n_volumes,), in ų.
269+
energies_list (list[np.ndarray]): List of 1D arrays of energies referenced to the Fermi level
281270
(:math:`E - E_F`) for each volume, in eV.
282-
dos_list (list[np.ndarray]):
283-
List of 1D arrays of DOS values for each volume, in states/eV.
271+
dos_list (list[np.ndarray]): List of 1D arrays of DOS values for each volume, in states/eV.
284272
285273
Raises:
286-
ValueError:
287-
Lengths of volumes, energies_list, and dos_list must be the same.
274+
ValueError: Lengths of volumes, energies_list, and dos_list must be the same.
288275
"""
289276

290277
self.number_of_atoms = number_of_atoms
@@ -308,12 +295,10 @@ def process(
308295
internal energy, entropy, and heat capacity.
309296
310297
Args:
311-
temperatures (np.ndarray):
312-
1D array of temperatures in K, shape (n_temperatures,).
298+
temperatures (np.ndarray): 1D array of temperatures in K, shape (n_temperatures,).
313299
314300
Raises:
315-
ValueError:
316-
If DOS data is not found.
301+
ValueError: If DOS data is not found.
317302
"""
318303

319304
self.temperatures = temperatures
@@ -369,15 +354,12 @@ def fit(
369354
of volume for various fixed temperatures.
370355
371356
Args:
372-
volumes_fit (np.ndarray):
373-
1D array of volumes used for fitting the properties, shape
357+
volumes_fit (np.ndarray): 1D array of volumes used for fitting the properties, shape
374358
(n_volumes_fit,), in ų.
375-
order (int):
376-
Order of the polynomial fit. Defaults to 1 (linear fit).
359+
order (int): Order of the polynomial fit. Defaults to 1 (linear fit).
377360
378361
Raises:
379-
ValueError:
380-
Thermodynamic properties have not been calculated.
362+
ValueError: Thermodynamic properties have not been calculated.
381363
"""
382364

383365
# If helmholtz_energies is None, raise an error
@@ -445,8 +427,7 @@ def plot_total_dos(self) -> go.Figure:
445427
Plots the total electron DOS for different volumes.
446428
447429
Raises:
448-
ValueError:
449-
DOS data not found. Please read or set the total electron DOS first
430+
ValueError: DOS data not found. Please read or set the total electron DOS first
450431
using `read_total_electron_dos()` or `set_total_electron_dos()`.
451432
452433
Returns:
@@ -496,10 +477,8 @@ def plot_vt(self, type: str, selected_temperatures: np.ndarray = None) -> go.Fig
496477
(n_selected_temperatures,). Defaults to None.
497478
498479
Raises:
499-
ValueError:
500-
Thermodynamic properties have not been calculated.
501-
ValueError:
502-
The `type` argument is not one of the allowed values.
480+
ValueError: Thermodynamic properties have not been calculated.
481+
ValueError: The `type` argument is not one of the allowed values.
503482
504483
Returns:
505484
go.Figure:
@@ -890,8 +869,9 @@ def calculate_internal_energies(
890869
ValueError: If `plot_temperature` is not in `temperatures` when `plot=True`.
891870
892871
Returns:
893-
np.ndarray | tuple[np.ndarray, go.Figure, go.Figure]: Internal energy values, in eV and
894-
optionally the Plotly figures if `plot=True`.
872+
np.ndarray | tuple[np.ndarray, go.Figure, go.Figure]:
873+
Internal energy values, in eV
874+
and optionally the Plotly figures if `plot=True`.
895875
"""
896876

897877
# If there are negative temperatures, raise an error
@@ -1000,7 +980,8 @@ def plot_internal_energy_integral(
1000980
plot_temperature (float): Temperature at which the integrand is plotted, in K.
1001981
1002982
Returns:
1003-
tuple[go.Figure, go.Figure]: Plotly figure objects containing the integrand curves.
983+
tuple[go.Figure, go.Figure]:
984+
Plotly figure objects containing the integrand curves.
1004985
"""
1005986

1006987
plot_temperature = float(plot_temperature)
@@ -1061,8 +1042,9 @@ def calculate_entropies(
10611042
ValueError: If plot_temperature is not in `temperatures` when `plot=True`.
10621043
10631044
Returns:
1064-
np.ndarray | tuple[np.ndarray, go.Figure]: Entropy values as a function of temperature, in eV/K
1065-
and optionally the Plotly figure if `plot=True`.
1045+
np.ndarray | tuple[np.ndarray, go.Figure]:
1046+
Entropy values as a function of temperature, in eV/K
1047+
and optionally the Plotly figure if `plot=True`.
10661048
"""
10671049

10681050
# If there are negative temperatures, raise an error
@@ -1212,8 +1194,9 @@ def calculate_heat_capacities(
12121194
ValueError: If plot_temperature is not in `temperatures` when `plot=True`.
12131195
12141196
Returns:
1215-
np.ndarray | tuple[np.ndarray, go.Figure]: Heat capacity values in eV/K
1216-
and optionally the Plotly figure if `plot=True`.
1197+
np.ndarray | tuple[np.ndarray, go.Figure]:
1198+
Heat capacity values in eV/K
1199+
and optionally the Plotly figure if `plot=True`.
12171200
"""
12181201

12191202
# If there are negative temperatures, raise an error

0 commit comments

Comments
 (0)