Skip to content

Commit

Permalink
fix doc string indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Oct 17, 2023
1 parent cfd47ad commit 8ab2261
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 128 deletions.
201 changes: 92 additions & 109 deletions pymatgen/analysis/gb/grain.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pymatgen/analysis/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ def get_nn_info(self, structure: Structure, n: int):
n: index of site for which to determine near neighbors.
Returns:
(dict): representing a neighboring site and the type of
dict: representing a neighboring site and the type of
bond present between site n and the neighboring site.
"""
from pymatgen.io.babel import BabelMolAdaptor
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/wulff.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def weighted_surface_energy(self):
def area_fraction_dict(self):
"""
Returns:
(dict): {hkl: area_hkl/total area on wulff}.
dict: {hkl: area_hkl/total area on wulff}.
"""
return {hkl: area / self.surface_area for hkl, area in self.miller_area_dict.items()}

Expand Down
7 changes: 3 additions & 4 deletions pymatgen/electronic_structure/boltztrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,11 +899,10 @@ def check_acc_bzt_bands(sbs_bz, sbs_ref, warn_thr=(0.03, 0.03)):
- "avg_corr": average of correlation coefficient over the 8 bands
- "avg_dist": average of energy distance over the 8 bands
- "nb_list": list of indexes of the 8 compared bands
- "acc_thr": list of two float corresponding to the two warning
thresholds in input
- "acc_thr": list of two float corresponding to the two warning thresholds in input
- "acc_err": list of two bools:
True if the avg_corr > warn_thr[0], and
True if the avg_dist > warn_thr[1]
True if the avg_corr > warn_thr[0], and
True if the avg_dist > warn_thr[1]
See also compare_sym_bands function doc.
"""
if not sbs_ref.is_metal() and not sbs_bz.is_metal():
Expand Down
2 changes: 0 additions & 2 deletions pymatgen/io/cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,8 +1168,6 @@ def get_structures(
Returns:
list[Structure]: All structures in CIF file.
"""
print(len(self._cif.data))

if not check_occu: # added in https://github.com/materialsproject/pymatgen/pull/2836
warnings.warn("Structures with unphysical site occupancies are not compatible with many pymatgen features.")
if primitive and symmetrized:
Expand Down
12 changes: 6 additions & 6 deletions pymatgen/io/lammps/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ def set_charge_atom(self, charges: dict[int, float]) -> None:
Args:
charges: A dictionary with atom indexes as keys and
charges as values, e.g., to set the charge
of the atom with index 3 to -2, use `{3: -2}`.
charges as values, e.g., to set the charge
of the atom with index 3 to -2, use `{3: -2}`.
"""
for iat, q in charges.items():
self.atoms.loc[iat, "q"] = q
Expand All @@ -886,10 +886,10 @@ def set_charge_atom_type(self, charges: dict[str | int, float]) -> None:
Args:
charges: Dict containing the charges for the atom types to set.
The dict should contain atom types as integers or labels and charges.
Example: change the charge of Li atoms to +3:
charges={"Li": 3}
charges={1: 3} if Li atoms are of type 1
The dict should contain atom types as integers or labels and charges.
Example: change the charge of Li atoms to +3:
charges={"Li": 3}
charges={1: 3} if Li atoms are of type 1
"""
for iat, q in charges.items():
if isinstance(iat, str):
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/io/lammps/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class BaseLammpsGenerator(InputGenerator):
calc_type: Human-readable string used to briefly describe the type of computations performed by LAMMPS.
settings: Dictionary containing the values of the parameters to replace in the template.
keep_stages: If True, the string is formatted in a block structure with stage names
and newlines that differentiate commands in the respective stages of the InputFile.
If False, stage names are not printed and all commands appear in a single block.
and newlines that differentiate commands in the respective stages of the InputFile.
If False, stage names are not printed and all commands appear in a single block.
/!\ This InputSet and InputGenerator implementation is based on templates and is not intended to be very flexible.
For instance, pymatgen will not detect whether a given variable should be adapted based on others
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/qchem/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(
Ex:
1. For a single-state calculation with two constraints:
cdft=[[
cdft=[[
{"value": 1.0, "coefficients": [1.0], "first_atoms": [1], "last_atoms": [2], "types": [None]},
{"value": 2.0, "coefficients": [1.0, -1.0], "first_atoms": [1, 17], "last_atoms": [3, 19],
"types": ["s"]}
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/phonon/gruneisen.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
multiplicities: list of multiplicities
structure: The crystal structure (as a pymatgen Structure object) associated with the gruneisen parameters.
lattice: The reciprocal lattice as a pymatgen Lattice object. Pymatgen uses the physics convention of
reciprocal lattice vectors WITH a 2*pi coefficient.
reciprocal lattice vectors WITH a 2*pi coefficient.
"""
self.qpoints = qpoints
self.gruneisen = gruneisen
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/symmetry/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def get_symmetry_dataset(self):
"""Returns the symmetry dataset as a dict.
Returns:
(dict): With the following properties:
dict: With the following properties:
number: International space group number
international: International symbol
hall: Hall symbol
Expand Down

0 comments on commit 8ab2261

Please sign in to comment.