Skip to content

Commit

Permalink
pydocstyle D411
Browse files Browse the repository at this point in the history
Missing blank line before section ('Args')
  • Loading branch information
janosh committed Nov 7, 2022
1 parent fb2fc72 commit cc0a0b3
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def safe_separation_permutations(self, ordered_plane=False, ordered_point_groups
Simple and safe permutations for this separation plane.
This is not meant to be used in production. Default configuration for ChemEnv does not use this method.
Args:
ordered_plane: Whether the order of the points in the plane can be used to reduce the
number of permutations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,7 @@ def get_site_info_for_specie_allces(self, specie, min_fraction=0.0):
def get_statistics(self, statistics_fields=DEFAULT_STATISTICS_FIELDS, bson_compatible=False):
"""
Get the statistics of environments for this structure.
Args:
statistics_fields: Which statistics to get.
bson_compatible: Whether to make the dictionary BSON-compatible.
Expand Down Expand Up @@ -1974,6 +1975,7 @@ def site_has_clear_environment(self, isite, conditions=None):
def structure_has_clear_environments(self, conditions=None, skip_none=True, skip_empty=False):
"""
Whether all sites in a structure have "clear" environments.
Args:
conditions: Conditions to be checked for an environment to be "clear".
skip_none: Whether to skip sites for which no environments have been computed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ def dp_func(dp):
def get_sadf_figure(self, isite, normalized=True, figsize=None, step_function=None):
"""
Get the Solid Angle Distribution Figure for a given site.
Args:
isite: Index of the site.
normalized: Whether to normalize angles.
Expand Down
19 changes: 19 additions & 0 deletions pymatgen/analysis/diffraction/tem.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def wavelength_rel(self) -> float:
"""
Calculates the wavelength of the electron beam with relativistic kinematic effects taken
into account.
Args:
none
Returns:
Expand All @@ -101,6 +102,7 @@ def wavelength_rel(self) -> float:
def generate_points(coord_left: int = -10, coord_right: int = 10) -> np.ndarray:
"""
Generates a bunch of 3D points that span a cube.
Args:
coord_left (int): The minimum coordinate value.
coord_right (int): The maximum coordinate value.
Expand All @@ -119,6 +121,7 @@ def zone_axis_filter(
) -> list[tuple[int, int, int]]:
"""
Filters out all points that exist within the specified Laue zone according to the zone axis rule.
Args:
points (np.ndarray): The list of points to be filtered.
laue_zone (int): The desired Laue zone.
Expand Down Expand Up @@ -156,6 +159,7 @@ def bragg_angles(
) -> dict[tuple[int, int, int], float]:
"""
Gets the Bragg angles for every hkl point passed in (where n = 1).
Args:
interplanar_spacings (dict): dictionary of hkl to interplanar spacing
Returns:
Expand All @@ -170,6 +174,7 @@ def bragg_angles(
def get_s2(self, bragg_angles: dict[tuple[int, int, int], float]) -> dict[tuple[int, int, int], float]:
"""
Calculates the s squared parameter (= square of sin theta over lambda) for each hkl plane.
Args:
bragg_angles (dict): The bragg angles for each hkl plane.
Returns:
Expand All @@ -188,6 +193,7 @@ def x_ray_factors(
"""
Calculates x-ray factors, which are required to calculate atomic scattering factors. Method partially inspired
by the equivalent process in the xrd module.
Args:
structure (Structure): The input structure.
bragg_angles (dict): Dictionary of hkl plane to Bragg angle.
Expand All @@ -214,6 +220,7 @@ def electron_scattering_factors(
) -> dict[str, dict[tuple[int, int, int], float]]:
"""
Calculates atomic scattering factors for electrons using the Mott-Bethe formula (1st order Born approximation).
Args:
structure (Structure): The input structure.
bragg_angles (dict of 3-tuple to float): The Bragg angles for each hkl plane.
Expand All @@ -239,6 +246,7 @@ def cell_scattering_factors(
) -> dict[tuple[int, int, int], int]:
"""
Calculates the scattering factor for the whole cell.
Args:
structure (Structure): The input structure.
bragg_angles (dict of 3-tuple to float): The Bragg angles for each hkl plane.
Expand All @@ -264,6 +272,7 @@ def cell_intensity(
) -> dict[tuple[int, int, int], float]:
"""
Calculates cell intensity for each hkl plane. For simplicity's sake, take I = |F|**2.
Args:
structure (Structure): The input structure.
bragg_angles (dict of 3-tuple to float): The Bragg angles for each hkl plane.
Expand All @@ -285,6 +294,7 @@ def get_pattern(
) -> pd.DataFrame:
"""
Returns all relevant TEM DP info in a pandas dataframe.
Args:
structure (Structure): The input structure.
scaled (boolean): Required value for inheritance, does nothing in TEM pattern
Expand Down Expand Up @@ -322,6 +332,7 @@ def normalized_cell_intensity(
) -> dict[tuple[int, int, int], float]:
"""
Normalizes the cell_intensity dict to 1, for use in plotting.
Args:
structure (Structure): The input structure.
bragg_angles (dict of 3-tuple to float): The Bragg angles for each hkl plane.
Expand All @@ -344,6 +355,7 @@ def is_parallel(
) -> bool:
"""
Checks if two hkl planes are parallel in reciprocal space.
Args:
structure (Structure): The input structure.
plane (3-tuple): The first plane to be compared.
Expand All @@ -357,6 +369,7 @@ def is_parallel(
def get_first_point(self, structure: Structure, points: list) -> dict[tuple[int, int, int], float]:
"""
Gets the first point to be plotted in the 2D DP, corresponding to maximum d/minimum R.
Args:
structure (Structure): The input structure.
points (list): All points to be checked.
Expand All @@ -378,6 +391,7 @@ def get_interplanar_angle(structure: Structure, p1: tuple[int, int, int], p2: tu
"""
Returns the interplanar angle (in degrees) between the normal of two crystal planes.
Formulas from International Tables for Crystallography Volume C pp. 2-9.
Args:
structure (Structure): The input structure.
p1 (3-tuple): plane 1
Expand Down Expand Up @@ -434,6 +448,7 @@ def get_plot_coeffs(
"""
Calculates coefficients of the vector addition required to generate positions for each DP point
by the Moore-Penrose inverse method.
Args:
p1 (3-tuple): The first point. Fixed.
p2 (3-tuple): The second point. Fixed.
Expand All @@ -451,6 +466,7 @@ def get_positions(self, structure: Structure, points: list) -> dict[tuple[int, i
"""
Calculates all the positions of each hkl point in the 2D diffraction pattern by vector addition.
Distance in centimeters.
Args:
structure (Structure): The input structure.
points (list): All points to be checked.
Expand Down Expand Up @@ -501,6 +517,7 @@ def get_positions(self, structure: Structure, points: list) -> dict[tuple[int, i
def tem_dots(self, structure: Structure, points) -> list:
"""
Generates all TEM_dot as named tuples that will appear on the 2D diffraction pattern.
Args:
structure (Structure): The input structure.
points (list): All points to be checked.
Expand All @@ -524,6 +541,7 @@ def tem_dots(self, structure: Structure, points) -> list:
def get_plot_2d(self, structure: Structure) -> go.Figure:
"""
Generates the 2D diffraction pattern of the input structure.
Args:
structure (Structure): The input structure.
Returns:
Expand Down Expand Up @@ -602,6 +620,7 @@ def get_plot_2d_concise(self, structure: Structure) -> go.Figure:
"""
Generates the concise 2D diffraction pattern of the input structure of a smaller size and without layout.
Does not display.
Args:
structure (Structure): The input structure.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/ferroelectricity/polarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def get_total_ionic_dipole(structure, zval_dict):
center (np.array with shape [3,1]) : dipole center used by VASP
tiny (float) : tolerance for determining boundary of calculation.
"""

tot_ionic = []
for site in structure:
zval = zval_dict[str(site.specie)]
Expand All @@ -112,6 +111,7 @@ class PolarizationLattice(Structure):
def get_nearest_site(self, coords, site, r=None):
"""
Given coords and a site, find closet site to coords.
Args:
coords (3x1 array): Cartesian coords of center of sphere
site: site to find closest to coords
Expand Down
2 changes: 2 additions & 0 deletions pymatgen/analysis/gb/grain.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def get_sorted_structure(self, key=None, reverse=False):
meaning as in list.sort. By default, sites are sorted by the
electronegativity of the species. Note that Slab has to override this
because of the different __init__ args.
Args:
key: Specifies a function of one argument that is used to extract
a comparison key from each list element: key=str.lower. The
Expand Down Expand Up @@ -811,6 +812,7 @@ def gb_from_parameters(
def get_ratio(self, max_denominator=5, index_none=None):
"""
find the axial ratio needed for GB generator input.
Args:
max_denominator (int): the maximum denominator for
the computed ratio, default to be 5.
Expand Down
1 change: 1 addition & 0 deletions pymatgen/analysis/interfaces/zsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def get_equiv_transformations(self, transformation_sets, film_vectors, substrate
Applies the transformation_sets to the film and substrate vectors
to generate super-lattices and checks if they matches.
Returns all matching vectors sets.
Args:
transformation_sets(array): an array of transformation sets:
each transformation set is an array with the (i,j)
Expand Down
2 changes: 2 additions & 0 deletions pymatgen/analysis/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3856,6 +3856,7 @@ def molecules_allowed(self):
def get_nn_info(self, structure: Structure, n: int) -> list[dict]:
"""
Get all near-neighbor information.
Args:
structure: (Structure) pymatgen Structure
n: (int) index of target site
Expand Down Expand Up @@ -4071,6 +4072,7 @@ def _semicircle_integral(dist_bins, idx):
"""
An internal method to get an integral between two bounds of a unit
semicircle. Used in algorithm to determine bond probabilities.
Args:
dist_bins: (float) list of all possible bond weights
idx: (float) index of starting bond weight
Expand Down
1 change: 1 addition & 0 deletions pymatgen/analysis/structure_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ def _anonymous_match(
):
"""
Tries all permutations of matching struct1 to struct2.
Args:
struct1, struct2 (Structure): Preprocessed input structures
Returns:
Expand Down
2 changes: 2 additions & 0 deletions pymatgen/analysis/structure_prediction/volume_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def get_predicted_structure(self, structure: Structure, ref_structure):
"""
Given a structure, returns back the structure scaled to predicted
volume.
Args:
structure (Structure): structure w/unknown volume
ref_structure (Structure): A reference structure with a similar
Expand Down Expand Up @@ -237,6 +238,7 @@ def get_predicted_structure(self, structure: Structure, icsd_vol=False):
"""
Given a structure, returns back the structure scaled to predicted
volume.
Args:
structure (Structure): structure w/unknown volume
Expand Down
6 changes: 6 additions & 0 deletions pymatgen/analysis/surface_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def gibbs_binding_energy(self, eads=False):
def surface_energy(self, ucell_entry, ref_entries=None):
"""
Calculates the surface energy of this SlabEntry.
Args:
ucell_entry (entry): An entry object for the bulk
ref_entries (list: [entry]): A list of entries for each type
Expand Down Expand Up @@ -419,6 +420,7 @@ def __init__(self, all_slab_entries, ucell_entry, ref_entries=None):
"""
Object for plotting surface energy in different ways for clean and
adsorbed surfaces.
Args:
all_slab_entries (dict or list): Dictionary or list containing
all entries for slab calculations. See attributes.
Expand Down Expand Up @@ -660,6 +662,7 @@ def get_surface_equilibrium(self, slab_entries, delu_dict=None):
building surface phase diagrams. Note that to solve for x equations
(x slab_entries), there must be x free variables (chemical potentials).
Adjust delu_dict as need be to get the correct number of free variables.
Args:
slab_entries (array): The coefficients of the first equation
delu_dict (dict): Dictionary of the chemical potentials to be set as
Expand Down Expand Up @@ -1137,6 +1140,7 @@ def BE_vs_clean_SE(
"""
For each facet, plot the clean surface energy against the most
stable binding energy.
Args:
delu_dict (dict): Dictionary of the chemical potentials to be set as
constant. Note the key should be a sympy Symbol object of the
Expand Down Expand Up @@ -1199,6 +1203,7 @@ def surface_chempot_range_map(
and determines the chempot rangeo fht e second element for each
SlabEntry. Future implementation will determine the chempot range
map first by solving systems of equations up to 3 instead of 2.
Args:
elements (list): Sequence of elements to be considered as independent
variables. E.g., if you want to show the stability ranges of
Expand Down Expand Up @@ -1644,6 +1649,7 @@ def is_converged(self, min_points_frac=0.015, tol: float = 0.0025):
potential within some distance (min_point) about where the peak
electrostatic potential is found along the c direction of the
slab. This is dependent on the size of the slab.
Args:
min_point (fractional coordinates): The number of data points
+/- the point of where the electrostatic potential is at
Expand Down
1 change: 1 addition & 0 deletions pymatgen/analysis/topological/spillage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SOCSpillage:
def __init__(self, wf_noso="", wf_so=""):
"""
Requires path to WAVECAR files with and without LSORBIT = .TRUE.
Args:
wf_noso : WAVECAR without spin-orbit coupling
wf_so : WAVECAR with spin-orbit coupling
Expand Down
1 change: 1 addition & 0 deletions pymatgen/apps/battery/battery_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def get_sub_electrodes(self, adjacent_only=True):
If this electrode contains multiple voltage steps, then it is possible
to use only a subset of the voltage steps to define other electrodes.
Must be implemented for each electrode object.
Args:
adjacent_only: Only return electrodes from compounds that are
adjacent on the convex hull, i.e. no electrodes returned
Expand Down
1 change: 1 addition & 0 deletions pymatgen/command_line/critic2_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def structure_graph(self, include_critical_points=("bond", "ring", "cage")):
"""
A StructureGraph object describing bonding information
in the crystal.
Args:
include_critical_points: add DummySpecies for
the critical points themselves, a list of
Expand Down
1 change: 1 addition & 0 deletions pymatgen/core/bonds.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def get_bond_order(self, tol: float = 0.2, default_bl: float | None = None) -> f
def is_bonded(site1, site2, tol: float = 0.2, bond_order: float | None = None, default_bl: float | None = None):
"""
Test if two sites are bonded, up to a certain limit.
Args:
site1 (Site): First site
site2 (Site): Second site
Expand Down
1 change: 1 addition & 0 deletions pymatgen/electronic_structure/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ def get_site_orbital_dos(self, site: PeriodicSite, orbital: str) -> Dos: # type
def get_site_t2g_eg_resolved_dos(self, site: PeriodicSite) -> dict[str, Dos]:
"""
Get the t2g, eg projected DOS for a particular site.
Args:
site: Site in Structure associated with CompleteDos.
Expand Down
1 change: 1 addition & 0 deletions pymatgen/electronic_structure/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,7 @@ def __init__(
def get_plot(self, bs: BandStructureSymmLine, dos: Dos | CompleteDos | None = None):
"""
Get a matplotlib plot object.
Args:
bs (BandStructureSymmLine): the bandstructure to plot. Projection
data must exist for projected plots.
Expand Down
1 change: 1 addition & 0 deletions pymatgen/io/cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ def get_lattice_no_exception(
):
"""
Generate the lattice from the provided lattice parameters.
Args:
data:
length_strings:
Expand Down
1 change: 1 addition & 0 deletions pymatgen/io/packmol.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class PackmolSet(InputSet):

def run(self, path: str | Path, timeout=30):
"""Run packmol and write out the packed structure.
Args:
path: The path in which packmol input files are located.
timeout: Timeout in seconds.
Expand Down

0 comments on commit cc0a0b3

Please sign in to comment.