diff --git a/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py b/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py index 495a8bb668e..5709df6317a 100644 --- a/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py +++ b/dev_scripts/chemenv/strategies/multi_weights_strategy_parameters.py @@ -51,7 +51,9 @@ def __init__(self, initial_environment_symbol, expected_final_environment_symbol self.abstract_geometry = AbstractGeometry.from_cg(self.coordination_geometry) @classmethod - def simple_expansion(cls, initial_environment_symbol, expected_final_environment_symbol, neighbors_indices): + def simple_expansion( + cls, initial_environment_symbol, expected_final_environment_symbol, neighbors_indices + ) -> CoordinationEnvironmentMorphing: """Simple expansion of a coordination environment. Args: diff --git a/dev_scripts/update_spacegroup_data.py b/dev_scripts/update_spacegroup_data.py index b0f1c348ab9..07cd5d66344 100644 --- a/dev_scripts/update_spacegroup_data.py +++ b/dev_scripts/update_spacegroup_data.py @@ -30,7 +30,7 @@ def convert_symmops_to_sg_encoding(symbol: str) -> str: Args: symbol (str): "hermann_mauguin" or "universal_h_m" key of symmops.json Returns: - symbol in the format of SYMM_DATA["space_group_encoding"] keys + str: symbol in the format of SYMM_DATA["space_group_encoding"] keys """ symbol_representation = symbol.split(":") representation = ":" + "".join(symbol_representation[1].split(" ")) if len(symbol_representation) > 1 else "" @@ -51,7 +51,7 @@ def remove_identity_from_full_hermann_mauguin(symbol: str) -> str: Args: symbol (str): "hermann_mauguin" key of symmops.json Returns: - short "hermann_mauguin" key + str: short "hermann_mauguin" key """ if symbol in ("P 1", "C 1", "P 1 "): return symbol diff --git a/src/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py b/src/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py index 5d03166f83f..65f02d2c9a7 100644 --- a/src/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py +++ b/src/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py @@ -373,7 +373,7 @@ def from_dict(cls, dct, structure: Structure, detailed_voronoi) -> Self: the structure and the DetailedVoronoiContainer. As an inner (nested) class, the NeighborsSet is not supposed to be used anywhere else that inside the - StructureEnvironments. The from_dict method is thus using the structure and detailed_voronoi when + StructureEnvironments. The from_dict method is thus using the structure and detailed_voronoi when reconstructing itself. These two are both in the StructureEnvironments object. Args: diff --git a/src/pymatgen/analysis/interface_reactions.py b/src/pymatgen/analysis/interface_reactions.py index 9c89adbc8b1..71a481e8c80 100644 --- a/src/pymatgen/analysis/interface_reactions.py +++ b/src/pymatgen/analysis/interface_reactions.py @@ -111,7 +111,7 @@ def __init__( # Factor is the compositional ratio between composition self.c1 and # processed composition self.comp1. For example, the factor for - # Composition('SiO2') and Composition('O') is 2.0. This factor will be used + # Composition('SiO2') and Composition('O') is 2.0. This factor will be used # to convert mixing ratio in self.comp1 - self.comp2 tie line to that in # self.c1 - self.c2 tie line. self.factor1 = 1.0 diff --git a/src/pymatgen/analysis/local_env.py b/src/pymatgen/analysis/local_env.py index 6f6701f1ce8..ac27b579472 100644 --- a/src/pymatgen/analysis/local_env.py +++ b/src/pymatgen/analysis/local_env.py @@ -1984,7 +1984,7 @@ def get_okeeffe_distance_prediction(el1, el2): """Get an estimate of the bond valence parameter (bond length) using the derived parameters from 'Atoms Sizes and Bond Lengths in Molecules and Crystals' (O'Keeffe & Brese, 1991). The estimate is based on two - experimental parameters: r and c. The value for r is based off radius, + experimental parameters: r and c. The value for r is based off radius, while c is (usually) the Allred-Rochow electronegativity. Values used are *not* generated from pymatgen, and are found in 'okeeffe_params.json'. diff --git a/src/pymatgen/analysis/magnetism/analyzer.py b/src/pymatgen/analysis/magnetism/analyzer.py index 6c10495630b..720a427a0d5 100644 --- a/src/pymatgen/analysis/magnetism/analyzer.py +++ b/src/pymatgen/analysis/magnetism/analyzer.py @@ -476,7 +476,7 @@ def ordering(self) -> Ordering: ferro/ferrimagnetic is self.threshold_ordering and defaults to 1e-8. Returns: - Ordering: Enum with values FM: ferromagnetic, FiM: ferrimagnetic, + Ordering: Enum with values FM: ferromagnetic, FiM: ferrimagnetic, AFM: antiferromagnetic, NM: non-magnetic or Unknown. Unknown is returned if magnetic moments are not defined or structure is not collinear (in which case a warning is issued). diff --git a/src/pymatgen/analysis/molecule_matcher.py b/src/pymatgen/analysis/molecule_matcher.py index 10f8110da8a..0474bfd88a4 100644 --- a/src/pymatgen/analysis/molecule_matcher.py +++ b/src/pymatgen/analysis/molecule_matcher.py @@ -589,7 +589,7 @@ def fit(self, mol1, mol2): mol2: Second molecule. OpenBabel OBMol or pymatgen Molecule object Returns: - bool: Whether two molecules are the same. + bool: True if two molecules are the same. """ return self.get_rmsd(mol1, mol2) < self._tolerance @@ -598,7 +598,7 @@ def get_rmsd(self, mol1, mol2): Returns: RMSD if topology of the two molecules are the same - Infinite if the topology is different + Infinite if the topology is different """ label1, label2 = self._mapper.uniform_labels(mol1, mol2) if label1 is None or label2 is None: diff --git a/src/pymatgen/analysis/phase_diagram.py b/src/pymatgen/analysis/phase_diagram.py index 520691bb9f3..c5632f82812 100644 --- a/src/pymatgen/analysis/phase_diagram.py +++ b/src/pymatgen/analysis/phase_diagram.py @@ -853,7 +853,7 @@ def get_decomp_and_phase_separation_energy( **kwargs: Passed to get_decomp_and_e_above_hull. Returns: - tuple[decomp, energy]: The decomposition is given as a dict of {PDEntry, amount} + tuple[decomp, energy]: The decomposition is given as a dict of {PDEntry, amount} for all entries in the decomp reaction where amount is the amount of the fractional composition. The phase separation energy is given per atom. """ @@ -1547,7 +1547,7 @@ class PatchedPhaseDiagram(PhaseDiagram): Note that this does not mean that all these entries are actually used in the phase diagram. For example, this includes the positive formation energy entries that are filtered out before Phase Diagram construction. - min_entries (list[PDEntry]): List of the lowest energy entries for each composition + min_entries (list[PDEntry]): List of the lowest energy entries for each composition in the data provided for Phase Diagram construction. el_refs (list[PDEntry]): List of elemental references for the phase diagrams. These are entries corresponding to the lowest energy element entries for diff --git a/src/pymatgen/analysis/quasiharmonic.py b/src/pymatgen/analysis/quasiharmonic.py index d1c7612fecf..e41e072acad 100644 --- a/src/pymatgen/analysis/quasiharmonic.py +++ b/src/pymatgen/analysis/quasiharmonic.py @@ -146,7 +146,7 @@ def optimize_gibbs_free_energy(self): def optimizer(self, temperature): """Evaluate G(V, T, P) at the given temperature(and pressure) and minimize it w.r.t. V. - 1. Compute the vibrational Helmholtz free energy, A_vib. + 1. Compute the vibrational Helmholtz free energy, A_vib. 2. Compute the Gibbs free energy as a function of volume, temperature and pressure, G(V,T,P). 3. Perform an equation of state fit to get the functional form of @@ -248,7 +248,7 @@ def debye_temperature(self, volume: float) -> float: @staticmethod def debye_integral(y): """ - Debye integral. Eq(5) in doi.org/10.1016/j.comphy.2003.12.001. + Debye integral. Eq(5) in doi.org/10.1016/j.comphy.2003.12.001. Args: y (float): Debye temperature / T, upper limit diff --git a/src/pymatgen/analysis/structure_matcher.py b/src/pymatgen/analysis/structure_matcher.py index 54f4864c739..cf6e890c9e7 100644 --- a/src/pymatgen/analysis/structure_matcher.py +++ b/src/pymatgen/analysis/structure_matcher.py @@ -53,7 +53,7 @@ def are_equal(self, sp1, sp2) -> bool: definition in Site and PeriodicSite. Returns: - bool: Whether species are considered equal. + bool: True if species are considered equal. """ return False @@ -122,7 +122,7 @@ def are_equal(self, sp1, sp2) -> bool: definition in Site and PeriodicSite. Returns: - bool: Whether species are equal. + bool: True if species are equal. """ return sp1 == sp2 @@ -151,7 +151,7 @@ def are_equal(self, sp1, sp2) -> bool: definition in Site and PeriodicSite. Returns: - bool: Whether species are equal. + bool: True if species are equal. """ for s1 in sp1: spin1 = getattr(s1, "spin", 0) or 0 @@ -188,7 +188,7 @@ def are_equal(self, sp1, sp2) -> bool: definition in Site and PeriodicSite. Returns: - bool: Whether species are the same based on element and amounts. + bool: True if species are the same based on element and amounts. """ comp1 = Composition(sp1) comp2 = Composition(sp2) @@ -1051,7 +1051,7 @@ def fit_anonymous( If True, skip to get a primitive structure and perform Niggli reduction for struct1 and struct2 Returns: - bool: Whether a species mapping can map struct1 to struct2 + bool: True if a species mapping can map struct1 to struct2 """ struct1, struct2 = self._process_species([struct1, struct2]) struct1, struct2, fu, s1_supercell = self._preprocess(struct1, struct2, niggli, skip_structure_reduction) diff --git a/src/pymatgen/core/bonds.py b/src/pymatgen/core/bonds.py index 7faed475c54..6c1ced8fa47 100644 --- a/src/pymatgen/core/bonds.py +++ b/src/pymatgen/core/bonds.py @@ -103,7 +103,7 @@ def is_bonded( bond length. If None, a ValueError will be thrown. Returns: - bool: whether two sites are bonded. + bool: True if two sites are bonded. """ sp1 = next(iter(site1.species)) sp2 = next(iter(site2.species)) diff --git a/src/pymatgen/core/composition.py b/src/pymatgen/core/composition.py index 4ab44893088..ba29e686a44 100644 --- a/src/pymatgen/core/composition.py +++ b/src/pymatgen/core/composition.py @@ -536,7 +536,7 @@ def contains_element_type(self, category: str) -> bool: "actinoid", "radioactive", "quadrupolar", "s-block", "p-block", "d-block", "f-block". Returns: - bool: Whether any elements in Composition match category. + bool: True if any elements in Composition match category. """ allowed_categories = [element.value for element in ElementType] diff --git a/src/pymatgen/core/interface.py b/src/pymatgen/core/interface.py index 0ac14fd1453..14421832b34 100644 --- a/src/pymatgen/core/interface.py +++ b/src/pymatgen/core/interface.py @@ -1768,7 +1768,7 @@ def enum_sigma_ort( e.g. mu:lam:mv = c2,None,a2, means b2 is irrational. Returns: - dict: sigmas dictionary with keys as the possible integer sigma values + dict: sigmas dictionary with keys as the possible integer sigma values and values as list of the possible rotation angles to the corresponding sigma values. e.g. the format as {sigma1: [angle11,angle12,...], sigma2: [angle21, angle22,...],...} diff --git a/src/pymatgen/core/sites.py b/src/pymatgen/core/sites.py index a703c79a335..1e948a2d3e1 100644 --- a/src/pymatgen/core/sites.py +++ b/src/pymatgen/core/sites.py @@ -46,7 +46,7 @@ def __init__( Args: species: Species on the site. Can be: i. A Composition-type object (preferred) - ii. An element / species specified either as a string + ii. An element / species specified either as a string symbols, e.g. "Li", "Fe2+", "P" or atomic numbers, e.g. 3, 56, or actual Element or Species objects. iii.Dict of elements/species and occupancies, e.g. @@ -305,7 +305,7 @@ def __init__( Args: species: Species on the site. Can be: i. A Composition-type object (preferred) - ii. An element / species specified either as a string + ii. An element / species specified either as a string symbols, e.g. "Li", "Fe2+", "P" or atomic numbers, e.g. 3, 56, or actual Element or Species objects. iii.Dict of elements/species and occupancies, e.g. diff --git a/src/pymatgen/core/surface.py b/src/pymatgen/core/surface.py index 7e8e969e405..6bc5678f70d 100644 --- a/src/pymatgen/core/surface.py +++ b/src/pymatgen/core/surface.py @@ -290,7 +290,7 @@ def is_symmetric(self, symprec: float = 0.1) -> bool: symprec (float): Symmetry precision used for SpaceGroup analyzer. Returns: - bool: Whether surfaces are symmetric. + bool: True if surfaces are symmetric. """ spg_analyzer = SpacegroupAnalyzer(self, symprec=symprec) symm_ops = spg_analyzer.get_point_group_operations() diff --git a/src/pymatgen/ext/optimade.py b/src/pymatgen/ext/optimade.py index d1cddb85206..5221e0bc0d1 100644 --- a/src/pymatgen/ext/optimade.py +++ b/src/pymatgen/ext/optimade.py @@ -500,7 +500,7 @@ def _parse_provider(self, provider: str, provider_url: str) -> dict[str, Provide It does not raise exceptions but will instead _logger.warning and provide an empty dictionary in the case of invalid data. - In future, when the specification is sufficiently well adopted, + In future, when the specification is sufficiently well adopted, we might be more strict here. Args: diff --git a/src/pymatgen/io/fiesta.py b/src/pymatgen/io/fiesta.py index 45ad8954c72..1c17ced40fa 100644 --- a/src/pymatgen/io/fiesta.py +++ b/src/pymatgen/io/fiesta.py @@ -39,7 +39,7 @@ class Nwchem2Fiesta(MSONable): If nwchem.nw is the input, nwchem.out the output, and structure.movecs the "movecs" file, the syntax to run NWCHEM2FIESTA is: NWCHEM2FIESTA - nwchem.nw nwchem.nwout structure.movecs > log_n2f + nwchem.nw nwchem.nwout structure.movecs > log_n2f """ def __init__(self, folder, filename="nwchem", log_file="log_n2f"): diff --git a/src/pymatgen/io/gaussian.py b/src/pymatgen/io/gaussian.py index ca150bab18a..39e7417beec 100644 --- a/src/pymatgen/io/gaussian.py +++ b/src/pymatgen/io/gaussian.py @@ -1003,7 +1003,7 @@ def _parse_hessian(self, file, structure): structure: structure in the output file """ # read Hessian matrix under "Force constants in Cartesian coordinates" - # Hessian matrix is in the input orientation framework + # Hessian matrix is in the input orientation framework # WARNING : need #P in the route line ndf = 3 * len(structure) diff --git a/src/pymatgen/io/lobster/outputs.py b/src/pymatgen/io/lobster/outputs.py index 322fcbf261f..e671fa03fe2 100644 --- a/src/pymatgen/io/lobster/outputs.py +++ b/src/pymatgen/io/lobster/outputs.py @@ -1503,7 +1503,7 @@ def has_good_quality_maxDeviation(self, limit_maxDeviation: float = 0.1) -> bool limit_maxDeviation: limit of the maxDeviation Returns: - bool: Whether the quality of the projection is good. + bool: True if the quality of the projection is good. """ return all(deviation <= limit_maxDeviation for deviation in self.max_deviation) @@ -1525,7 +1525,7 @@ def has_good_quality_check_occupied_bands( limit_deviation (float): limit of the maxDeviation Returns: - bool: Whether the quality of the projection is good. + bool: True if the quality of the projection is good. """ for matrix in self.band_overlaps_dict[Spin.up]["matrices"]: for iband1, band1 in enumerate(matrix): diff --git a/src/pymatgen/io/xtb/inputs.py b/src/pymatgen/io/xtb/inputs.py index cbc6a413dbe..b5bcca3b4b6 100644 --- a/src/pymatgen/io/xtb/inputs.py +++ b/src/pymatgen/io/xtb/inputs.py @@ -23,7 +23,7 @@ class CRESTInput(MSONable): """ - An object representing CREST input files. + An object representing CREST input files. Because CREST is controlled through command line flags and external files, the CRESTInput class mainly consists of methods for containing and writing external files. diff --git a/src/pymatgen/phonon/bandstructure.py b/src/pymatgen/phonon/bandstructure.py index d56ff99df89..f8354fdb743 100644 --- a/src/pymatgen/phonon/bandstructure.py +++ b/src/pymatgen/phonon/bandstructure.py @@ -254,7 +254,7 @@ def asr_breaking(self, tol_eigendisplacements: float = 1e-5) -> np.ndarray | Non """Get the breaking of the acoustic sum rule for the three acoustic modes, if Gamma is present. None otherwise. If eigendisplacements are available they are used to determine the acoustic - modes: selects the bands corresponding to the eigendisplacements that + modes: selects the bands corresponding to the eigendisplacements that represent to a translation within tol_eigendisplacements. If these are not identified or eigendisplacements are missing the first 3 modes will be used (indices [:3]). diff --git a/src/pymatgen/symmetry/analyzer.py b/src/pymatgen/symmetry/analyzer.py index 228bef4fe9e..375a9214a98 100644 --- a/src/pymatgen/symmetry/analyzer.py +++ b/src/pymatgen/symmetry/analyzer.py @@ -1346,7 +1346,7 @@ def is_valid_op(self, symm_op: SymmOp) -> bool: symm_op (SymmOp): Symmetry operation to test. Returns: - bool: Whether SymmOp is valid for Molecule. + bool: True if SymmOp is valid for Molecule. """ coords = self.centered_mol.cart_coords for site in self.centered_mol: @@ -1674,7 +1674,7 @@ def are_symmetrically_equivalent( are symmetrically similar. Returns: - bool: Whether the two sets of sites are symmetrically equivalent. + bool: True if the two sets of sites are symmetrically equivalent. """ def in_sites(site): diff --git a/src/pymatgen/symmetry/groups.py b/src/pymatgen/symmetry/groups.py index dd1510c0289..375fd17d5f6 100644 --- a/src/pymatgen/symmetry/groups.py +++ b/src/pymatgen/symmetry/groups.py @@ -255,7 +255,7 @@ def __init__(self, int_symbol: str, hexagonal: bool = True) -> None: notation is a LaTeX-like string, with screw axes being represented by an underscore. For example, "P6_3/mmc". Alternative settings can be accessed by adding a ":identifier". - For example, the hexagonal setting for rhombohedral cells can be + For example, the hexagonal setting for rhombohedral cells can be accessed by adding a ":H", e.g. "R-3m:H". To find out all possible settings for a spacegroup, use the get_settings() classmethod. Alternative origin choices can be indicated by a diff --git a/src/pymatgen/transformations/advanced_transformations.py b/src/pymatgen/transformations/advanced_transformations.py index 82d5af9f3c4..d68a10425f7 100644 --- a/src/pymatgen/transformations/advanced_transformations.py +++ b/src/pymatgen/transformations/advanced_transformations.py @@ -820,7 +820,7 @@ def apply_transformation( Structure | list[Structure]: Structure(s) after MagOrderTransformation. """ if not structure.is_ordered: - raise ValueError("Create an ordered approximation of your input structure first.") + raise ValueError("Create an ordered approximation of your input structure first.") # retrieve order parameters order_parameters = [MagOrderParameterConstraint.from_dict(op_dict) for op_dict in self.order_parameter] diff --git a/src/pymatgen/transformations/standard_transformations.py b/src/pymatgen/transformations/standard_transformations.py index 59a99fe9f8a..e27406ec574 100644 --- a/src/pymatgen/transformations/standard_transformations.py +++ b/src/pymatgen/transformations/standard_transformations.py @@ -426,7 +426,7 @@ class OrderDisorderedStructureTransformation(AbstractTransformation): these will be treated separately if the difference is above a threshold tolerance. currently this is .1 - For example, if a fraction of .25 Li is on sites 0, 1, 2, 3 and .5 on sites + For example, if a fraction of .25 Li is on sites 0, 1, 2, 3 and .5 on sites 4, 5, 6, 7 then 1 site from [0, 1, 2, 3] will be filled and 2 sites from [4, 5, 6, 7] will be filled, even though a lower energy combination might be found by putting all lithium in sites [4, 5, 6, 7]. @@ -457,7 +457,7 @@ def apply_transformation(self, structure: Structure, return_ranked_list: bool | """For this transformation, the apply_transformation method will return only the ordered structure with the lowest Ewald energy, to be consistent with the method signature of the other transformations. - However, all structures are stored in the all_structures attribute in + However, all structures are stored in the all_structures attribute in the transformation object for easy access. Args: diff --git a/src/pymatgen/util/due.py b/src/pymatgen/util/due.py index de388604aa6..44c77b94611 100644 --- a/src/pymatgen/util/due.py +++ b/src/pymatgen/util/due.py @@ -8,7 +8,7 @@ See https://github.com/duecredit/duecredit/blob/master/README.md for examples. Origin: Originally a part of the duecredit -Copyright: 2015-2021 DueCredit developers +Copyright: 2015-2021 DueCredit developers License: BSD-2 """ diff --git a/src/pymatgen/util/plotting.py b/src/pymatgen/util/plotting.py index 13958cc9b22..5cf33601c21 100644 --- a/src/pymatgen/util/plotting.py +++ b/src/pymatgen/util/plotting.py @@ -712,7 +712,7 @@ def wrapper(*args, **kwargs): tight_layout True to call fig.tight_layout (default: False) ax_grid True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged. - ax_annotate Add labels to subplots e.g. (a), (b). + ax_annotate Add labels to subplots e.g. (a), (b). Default: False fig_close Close figure. Default: False. ================ ==================================================== diff --git a/src/pymatgen/vis/structure_vtk.py b/src/pymatgen/vis/structure_vtk.py index c2329591744..86ed42265e5 100644 --- a/src/pymatgen/vis/structure_vtk.py +++ b/src/pymatgen/vis/structure_vtk.py @@ -517,7 +517,7 @@ def add_triangle( color: Color for triangle as RGB. center: The "central atom" of the triangle opacity: opacity of the triangle - draw_edges: If set to True, the a line will be drawn at each edge + draw_edges: If set to True, the a line will be drawn at each edge edges_color: Color of the line for the edges edges_linewidth: Width of the line drawn for the edges """