Skip to content

Commit

Permalink
del parens around doc string return type
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Oct 17, 2023
1 parent b6fd1c0 commit 72326ae
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.1.0
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -26,7 +26,7 @@ repos:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.0
hooks:
- id: mypy

Expand Down
3 changes: 2 additions & 1 deletion pymatgen/analysis/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,8 @@ def _extract_nn_info(self, structure: Structure, nns):
nns ([dicts]): Nearest neighbor information for a structure
Returns:
(list of tuples (Site, array, float)): See nn_info
list[tuple[PeriodicSite, np.ndarray, float]]: tuples of the form
(site, image, weight). See nn_info.
"""
# Get the target information
targets = structure.elements if self.targets is None else self.targets
Expand Down
10 changes: 5 additions & 5 deletions pymatgen/analysis/surface_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def wulff_from_chempot(
no_clean (bool): Consider stability of doped slabs only.
Returns:
(WulffShape): The WulffShape at u_ref and u_ads.
WulffShape: The WulffShape at u_ref and u_ads.
"""
latt = SpacegroupAnalyzer(self.ucell_entry.structure).get_conventional_standard_structure().lattice

Expand Down Expand Up @@ -628,7 +628,7 @@ def get_surface_equilibrium(self, slab_entries, delu_dict=None):
format: Symbol("delu_el") where el is the name of the element.
Returns:
(array): Array containing a solution to x equations with x
array: Array containing a solution to x equations with x
variables (x-1 chemical potential and 1 surface energy)
"""
# Generate all possible coefficients
Expand Down Expand Up @@ -930,7 +930,7 @@ def chempot_vs_gamma(
no_label (bool): Option to turn off labels.
Returns:
(Plot): Plot of surface energy vs chempot for all entries.
Plot: Plot of surface energy vs chempot for all entries.
"""
if delu_dict is None:
delu_dict = {}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ def monolayer_vs_BE(self, plot_eads=False):
energy multiplied by number of adsorbates) instead.
Returns:
(Plot): Plot of binding energy vs monolayer for all facets.
Plot: Plot of binding energy vs monolayer for all facets.
"""
ax = pretty_plot(width=8, height=7)
for hkl in self.all_slab_entries:
Expand Down Expand Up @@ -1098,7 +1098,7 @@ def BE_vs_clean_SE(
eV/A^2 (False)
Returns:
(Plot): Plot of clean surface energy vs binding energy for
Plot: Plot of clean surface energy vs binding energy for
all facets.
"""
ax = pretty_plot(width=8, height=7)
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/core/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ def get_miller_index_from_coords(
verbose (bool, optional): Whether to print warnings.
Returns:
(tuple): The Miller index.
tuple: The Miller index.
"""
if coords_are_cartesian:
coords = [self.get_fractional_coords(c) for c in coords] # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@ def get_miller_index_from_site_indexes(self, site_ids, round_dp=4, verbose=True)
verbose (bool, optional): Whether to print warnings.
Returns:
(tuple): The Miller index.
tuple: The Miller index.
"""
return self.lattice.get_miller_index_from_coords(
self.frac_coords[site_ids],
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/core/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def symmetrically_add_atom(self, specie, point, coords_are_cartesian=False):
coords_are_cartesian (bool): Is the point in Cartesian coordinates
Returns:
(Slab): The modified slab
Slab: The modified slab
"""
# For now just use the species of the
# surface atom as the element to add
Expand Down Expand Up @@ -1440,7 +1440,7 @@ def build_slabs(self):
(4) Add any specified sites to both surfaces.
Returns:
(Slab): The reconstructed slab.
Slab: The reconstructed slab.
"""
slabs = self.get_unreconstructed_slabs()
recon_slabs = []
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/electronic_structure/bandstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def get_kpoint_degeneracy(self, kpoint, cartesian=False, tol: float = 1e-2):
tol (float): tolerance below which coordinates are considered equal.
Returns:
(int or None): degeneracy or None if structure is not available
int | None: degeneracy or None if structure is not available
"""
all_kpts = self.get_sym_eq_kpoints(kpoint, cartesian, tol=tol)
if all_kpts is not None:
Expand Down
3 changes: 1 addition & 2 deletions pymatgen/electronic_structure/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ def get_interpolated_gap(self, tol: float = 0.001, abs_tol: bool = False, spin:
Down - finds the gap in the down spin channel.
Returns:
(gap, cbm, vbm):
Tuple of floats in eV corresponding to the gap, cbm and vbm.
(gap, cbm, vbm): Tuple of floats in eV corresponding to the gap, cbm and vbm.
"""
tdos = self.get_densities(spin)
if not abs_tol:
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/abinit/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def format_list2d(values, float_decimal=0):
if all(f == 0 or (abs(f) > 1e-3 and abs(f) < 1e4) for f in flattened_list):
fmt_spec = f">{n_dec + 5}.{n_dec}f"
else:
fmt_spec = f">{n_dec + 8}.{n_dec}e" # noqa: F841
fmt_spec = f">{n_dec + 8}.{n_dec}e"

line = "\n"
for lst in values:
Expand Down
12 changes: 6 additions & 6 deletions pymatgen/symmetry/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ def get_space_group_symbol(self) -> str:
"""Get the spacegroup symbol (e.g., Pnma) for structure.
Returns:
(str): Spacegroup symbol for structure.
str: Spacegroup symbol for structure.
"""
return self._space_group_data["international"]

def get_space_group_number(self) -> int:
"""Get the international spacegroup number (e.g., 62) for structure.
Returns:
(int): International spacegroup number for structure.
int: International spacegroup number for structure.
"""
return int(self._space_group_data["number"])

Expand All @@ -151,15 +151,15 @@ def get_hall(self) -> str:
"""Returns Hall symbol for structure.
Returns:
(str): Hall symbol
str: Hall symbol
"""
return self._space_group_data["hall"]

def get_point_group_symbol(self) -> str:
"""Get the point group associated with the structure.
Returns:
(Pointgroup): Point group for structure.
Pointgroup: Point group for structure.
"""
rotations = self._space_group_data["rotations"]
# passing a 0-length rotations list to spglib can segfault
Expand All @@ -175,7 +175,7 @@ def get_crystal_system(self) -> CrystalSystem:
ValueError: on invalid space group numbers < 1 or > 230.
Returns:
(str): Crystal system for structure
str: Crystal system for structure
"""
n = self._space_group_data["number"]

Expand Down Expand Up @@ -206,7 +206,7 @@ def get_lattice_type(self) -> LatticeType:
ValueError: on invalid space group numbers < 1 or > 230.
Returns:
(str): Lattice type for structure
str: Lattice type for structure
"""
n = self._space_group_data["number"]
system = self.get_crystal_system()
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/symmetry/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def __str__(self) -> str:
def to_pretty_string(self) -> str:
"""
Returns:
(str): A pretty string representation of the space group.
str: A pretty string representation of the space group.
"""
return self.symbol

Expand Down

0 comments on commit 72326ae

Please sign in to comment.