Skip to content

Commit

Permalink
fix all pydocstyle D202 (#2715)
Browse files Browse the repository at this point in the history
No blank lines allowed after function docstring
  • Loading branch information
janosh committed Nov 1, 2022
1 parent c1f1e95 commit ece9949
Show file tree
Hide file tree
Showing 100 changed files with 0 additions and 493 deletions.
2 changes: 0 additions & 2 deletions pymatgen/alchemy/transmuters.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def __init__(
Uses multiprocessing.Pool. Default is None, which implies
serial.
"""

self.transformed_structures = transformed_structures
self.ncores = ncores
if transformations is not None:
Expand Down Expand Up @@ -288,7 +287,6 @@ def from_filenames(filenames, transformations=None, primitive=True, extend_colle
primitive: Same meaning as in __init__.
extend_collection: Same meaning as in __init__.
"""

allcifs = []
for fname in filenames:
with open(fname) as f:
Expand Down
3 changes: 0 additions & 3 deletions pymatgen/analysis/adsorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def find_surface_sites_by_height(self, slab, height=0.9, xy_tol=0.05):
Returns:
list of sites selected to be within a threshold of the highest
"""

# Get projection of coordinates along the miller index
m_projs = np.array([np.dot(site.coords, self.mvec) for site in slab.sites])

Expand Down Expand Up @@ -482,7 +481,6 @@ def adsorb_both_surfaces(
find_args (dict): dictionary of arguments to be passed to the
call to self.find_adsorption_sites, e.g. {"distance":2.0}
"""

# Get the adsorbed surfaces first
find_args = find_args or {}
ad_slabss = self.generate_adsorption_structures(
Expand Down Expand Up @@ -545,7 +543,6 @@ def generate_substitution_structures(
dist_from_surf (float): Distance from the surface to find viable
substitution sites, defaults to 0 to substitute at the surface
"""

target_species = target_species or []

# Get symmetrized structure in case we want to substitute both sides
Expand Down
1 change: 0 additions & 1 deletion pymatgen/analysis/bond_dissociation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(
of self.expected_charges below for more specific information.
multibreak (bool): If True, additionally attempt to break pairs of bonds. Defaults to False.
"""

self.molecule_entry = molecule_entry
self.filter_fragment_entries(fragment_entries)
print(str(len(self.filtered_entries)) + " filtered entries")
Expand Down
14 changes: 0 additions & 14 deletions pymatgen/analysis/chemenv/connectivity/connected_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def __len__(self):

def compute_periodicity(self, algorithm="all_simple_paths"):
"""
Args:
algorithm ():
Expand All @@ -399,7 +398,6 @@ def compute_periodicity(self, algorithm="all_simple_paths"):

def compute_periodicity_all_simple_paths_algorithm(self):
"""
Returns:
"""
self_loop_nodes = list(nx.nodes_with_selfloops(self._connected_subgraph))
Expand Down Expand Up @@ -487,7 +485,6 @@ def compute_periodicity_all_simple_paths_algorithm(self):

def compute_periodicity_cycle_basis(self):
"""
Returns:
"""
my_simple_graph = nx.Graph(self._connected_subgraph)
Expand Down Expand Up @@ -534,7 +531,6 @@ def compute_periodicity_cycle_basis(self):

def make_supergraph(self, multiplicity):
"""
Args:
multiplicity ():
Expand All @@ -545,7 +541,6 @@ def make_supergraph(self, multiplicity):

def show_graph(self, graph=None, save_file=None, drawing_type="internal", pltshow=True):
"""
Args:
graph ():
save_file ():
Expand Down Expand Up @@ -597,15 +592,13 @@ def graph(self):
@property
def is_periodic(self):
"""
Returns:
"""
return not self.is_0d

@property
def is_0d(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand All @@ -615,7 +608,6 @@ def is_0d(self):
@property
def is_1d(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand All @@ -625,7 +617,6 @@ def is_1d(self):
@property
def is_2d(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand All @@ -635,7 +626,6 @@ def is_2d(self):
@property
def is_3d(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand Down Expand Up @@ -673,7 +663,6 @@ def _order_periodicity_vectors(self):
@property
def periodicity_vectors(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand All @@ -683,7 +672,6 @@ def periodicity_vectors(self):
@property
def periodicity(self):
"""
Returns:
"""
if self._periodicity_vectors is None:
Expand All @@ -692,7 +680,6 @@ def periodicity(self):

def elastic_centered_graph(self, start_node=None):
"""
Args:
start_node ():
Expand Down Expand Up @@ -917,7 +904,6 @@ def from_graph(cls, g):

def description(self, full=False):
"""
Args:
full ():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def __init__(

def environment_subgraph(self, environments_symbols=None, only_atoms=None):
"""
Args:
environments_symbols ():
only_atoms ():
Expand Down Expand Up @@ -262,7 +261,6 @@ def setup_environment_subgraph(self, environments_symbols, only_atoms=None):

def setup_connectivity_description(self):
"""
Returns:
"""

Expand All @@ -283,7 +281,6 @@ def get_connected_components(self, environments_symbols=None, only_atoms=None):

def setup_atom_environment_subgraph(self, atom_environment):
"""
Args:
atom_environment ():
Expand All @@ -293,7 +290,6 @@ def setup_atom_environment_subgraph(self, atom_environment):

def setup_environments_subgraph(self, environments_symbols):
"""
Args:
environments_symbols ():
Expand All @@ -303,7 +299,6 @@ def setup_environments_subgraph(self, environments_symbols):

def setup_atom_environments_subgraph(self, atoms_environments):
"""
Args:
atoms_environments ():
Expand All @@ -313,7 +308,6 @@ def setup_atom_environments_subgraph(self, atoms_environments):

def print_links(self):
"""
Returns:
"""
nodes = self.environment_subgraph().nodes()
Expand All @@ -334,7 +328,6 @@ def print_links(self):

def as_dict(self):
"""
Returns:
"""
return {
Expand All @@ -351,7 +344,6 @@ def as_dict(self):
@classmethod
def from_dict(cls, d):
"""
Args:
d ():
Expand Down
2 changes: 0 additions & 2 deletions pymatgen/analysis/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def get_lowest_decomposition(self, composition):
Returns:
Decomposition as a dict of {Entry: amount}
"""

entries_list = []
elements = [e.symbol for e in composition.elements]
for i in range(len(elements)):
Expand All @@ -180,7 +179,6 @@ def get_cost_per_mol(self, comp):
Returns:
float of cost/mol
"""

comp = comp if isinstance(comp, Composition) else Composition(comp)
decomp = self.get_lowest_decomposition(comp)
return sum(k.energy_per_atom * v * comp.num_atoms for k, v in decomp.items())
Expand Down
2 changes: 0 additions & 2 deletions pymatgen/analysis/elasticity/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def energy_density(self, strain, convert_GPa_to_eV=True):
@classmethod
def from_diff_fit(cls, strains, stresses, eq_stress=None, order=2, tol: float = 1e-10):
"""
Args:
strains ():
stresses ():
Expand Down Expand Up @@ -155,7 +154,6 @@ def __new__(cls, input_array, tol: float = 1e-4):
tol (float): tolerance for initial symmetry test of tensor
"""

obj = super().__new__(cls, input_array, check_rank=4, tol=tol)
return obj.view(cls)

Expand Down
1 change: 0 additions & 1 deletion pymatgen/analysis/elasticity/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def piola_kirchoff_2(self, def_grad):
Args:
def_grad (3x3 array-like): rate of deformation tensor
"""

def_grad = SquareTensor(def_grad)
if not self.is_symmetric:
raise ValueError(
Expand Down
1 change: 0 additions & 1 deletion pymatgen/analysis/ewald.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ def as_dict(self, verbosity: int = 0) -> dict:
verbosity (int): Verbosity level. Default of 0 only includes the
matrix representation. Set to 1 for more details.
"""

d = {
"@module": type(self).__module__,
"@class": type(self).__name__,
Expand Down
2 changes: 0 additions & 2 deletions pymatgen/analysis/ferroelectricity/polarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def get_pelecs_and_pions(self, convert_to_muC_per_cm2=False):
convert_to_muC_per_cm2: Convert from electron * Angstroms to microCoulomb
per centimeter**2
"""

if not convert_to_muC_per_cm2:
return self.p_elecs, self.p_ions

Expand Down Expand Up @@ -269,7 +268,6 @@ def get_same_branch_polarization_data(self, convert_to_muC_per_cm2=True, all_in_
microCoulomb per centimeter**2
all_in_polar: convert polarization to be in polar (final structure) polarization lattice
"""

p_elec, p_ion = self.get_pelecs_and_pions()
p_tot = p_elec + p_ion
p_tot = np.array(p_tot)
Expand Down
7 changes: 0 additions & 7 deletions pymatgen/analysis/functional_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __init__(self, molecule, optimize=False):
modified, adding Hydrogens, performing a simple conformer search,
etc.
"""

self.molgraph = None

if isinstance(molecule, str):
Expand Down Expand Up @@ -108,7 +107,6 @@ def get_heteroatoms(self, elements=None):
functional groups are of interest).
:return: set of ints representing node indices
"""

heteroatoms = set()

for node in self.molgraph.graph.nodes():
Expand Down Expand Up @@ -139,7 +137,6 @@ def get_special_carbon(self, elements=None):
Default None.
:return: set of ints representing node indices
"""

specials = set()

# For this function, only carbons are considered
Expand Down Expand Up @@ -205,7 +202,6 @@ def link_marked_atoms(self, atoms):
using other functions in this class.
:return: list of sets of ints, representing groups of connected atoms
"""

# We will add hydrogens to functional groups
hydrogens = {n for n in self.molgraph.graph.nodes if str(self.species[n]) == "H"}

Expand Down Expand Up @@ -241,7 +237,6 @@ def get_basic_functional_groups(self, func_groups=None):
defined in this function will be sought.
:return: list of sets of ints, representing groups of connected atoms
"""

strat = OpenBabelNN()

hydrogens = {n for n in self.molgraph.graph.nodes if str(self.species[n]) == "H"}
Expand Down Expand Up @@ -306,7 +301,6 @@ def get_all_functional_groups(self, elements=None, func_groups=None, catch_basic
other methods
:return: list of sets of ints, representing groups of connected atoms
"""

heteroatoms = self.get_heteroatoms(elements=elements)
special_cs = self.get_special_carbon(elements=elements)
groups = self.link_marked_atoms(heteroatoms.union(special_cs))
Expand All @@ -325,7 +319,6 @@ def categorize_functional_groups(self, groups):
where the group occurs in the MoleculeGraph, and how many of each
type of group there is.
"""

categories = {}

em = iso.numerical_edge_match("weight", 1) # pylint: disable=E1102
Expand Down
1 change: 0 additions & 1 deletion pymatgen/analysis/gb/grain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,6 @@ def slab_from_csl(csl, surface, normal, trans_cry, max_search=20, quick_gen=Fals
Returns:
t_matrix: a slab lattice ( 3 by 3 integer array):
"""

# set the transform matrix in real space
trans = trans_cry
# transform matrix in reciprocal space
Expand Down
Loading

0 comments on commit ece9949

Please sign in to comment.