diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03b141eb762..0a32a6cccc5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - id: mypy - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell stages: [commit, commit-msg] @@ -51,7 +51,7 @@ repos: - id: blacken-docs - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.36.0 + rev: v0.37.0 hooks: - id: markdownlint # MD013: line too long diff --git a/CHANGES.md b/CHANGES.md index 37ee6a3112f..9b18425d02e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2653,7 +2653,7 @@ package `\_, which is now a dependency Previously, the parsing was done incorrectly because VASP actually provides data by running through the x-axis first, followed by y, then z. - Bug fix for reverse_readline so that it works for gzipped and bzipped - strucutures (courtesy of Anubhav Jain). + structures (courtesy of Anubhav Jain). - Fix "lossy" composition to_dict method. Now composition.to_dict properly returns a correct species string as a key for compositions using species, instead of just the element symbols. diff --git a/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py b/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py index d559ecaa6c3..bc9d32ef009 100644 --- a/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py +++ b/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py @@ -620,32 +620,32 @@ def compute_structure_environments( else: self.valences = valences - # Get a list of indices of unequivalent sites from the initial structure + # Get a list of indices of nonequivalent sites from the initial structure self.equivalent_sites = [[site] for site in self.structure] self.struct_sites_to_irreducible_site_list_map = list(range(len(self.structure))) self.sites_map = list(range(len(self.structure))) indices = list(range(len(self.structure))) - # Get list of unequivalent sites with valence >= 0 + # Get list of nonequivalent sites with valence >= 0 if only_cations and self.valences != "undefined": - sites_indices = [isite for isite in indices if self.valences[isite] >= 0] + sites_indices = [idx for idx in indices if self.valences[idx] >= 0] else: sites_indices = list(indices) # Include atoms that are in the list of "only_atoms" if it is provided if only_atoms is not None: sites_indices = [ - isite - for isite in sites_indices - if any(at in [sp.symbol for sp in self.structure[isite].species] for at in only_atoms) + idx + for idx in sites_indices + if any(at in [sp.symbol for sp in self.structure[idx].species] for at in only_atoms) ] # Exclude atoms that are in the list of excluded atoms if excluded_atoms: sites_indices = [ - isite - for isite in sites_indices - if not any(at in [sp.symbol for sp in self.structure[isite].species] for at in excluded_atoms) + idx + for idx in sites_indices + if not any(at in [sp.symbol for sp in self.structure[idx].species] for at in excluded_atoms) ] if only_indices is not None: diff --git a/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py b/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py index 14e24318eb1..109ee287cf5 100644 --- a/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py +++ b/pymatgen/analysis/chemenv/coordination_environments/structure_environments.py @@ -411,7 +411,7 @@ def __init__( Args: voronoi: VoronoiContainer object for the structure. valences: Valences provided. - sites_map: Mapping of equivalent sites to the unequivalent sites that have been computed. + sites_map: Mapping of equivalent sites to the nonequivalent sites that have been computed. equivalent_sites: List of list of equivalent sites of the structure. ce_list: List of chemical environments. structure: Structure object. diff --git a/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py b/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py index 0a2d5b96748..10d5dc1dfae 100644 --- a/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py +++ b/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py @@ -450,7 +450,7 @@ def changebasis(uu, vv, nn, pps): expressed in the basis (uu, vv, nn), which is supposed to be orthonormal. :param uu: First vector of the basis :param vv: Second vector of the basis - :param nn: Third vector of the bais + :param nn: Third vector of the basis :param pps: List of points in basis (e1, e2, e3) Returns: List of points in basis (uu, vv, nn). @@ -473,7 +473,7 @@ def collinear(p1, p2, p3=None, tolerance=0.25): checked by computing the area of the triangle defined by the three points p1, p2 and p3. If the area of this triangle is less than (tolerance x largest_triangle), then the three points are considered collinear. The largest_triangle is defined as the right triangle whose legs are the two smallest distances between the three - points ie, its area is : 0.5 x (min(|p2-p1|,|p3-p1|,|p3-p2|) x secondmin(|p2-p1|,|p3-p1|,|p3-p2|)) + points ie, its area is : 0.5 x (min(|p2-p1|,|p3-p1|,|p3-p2|) x second_min(|p2-p1|,|p3-p1|,|p3-p2|)) :param p1: First point :param p2: Second point :param p3: Third point (origin [0.0, 0.0, 0.0 if not given]) diff --git a/pymatgen/analysis/diffraction/tem.py b/pymatgen/analysis/diffraction/tem.py index e504d42bd45..f2a7048d26d 100644 --- a/pymatgen/analysis/diffraction/tem.py +++ b/pymatgen/analysis/diffraction/tem.py @@ -444,7 +444,7 @@ def get_plot_coeffs( Args: p1 (3-tuple): The first point. Fixed. p2 (3-tuple): The second point. Fixed. - p3 (3-tuple): The point whose coefficients are to be calculted. + p3 (3-tuple): The point whose coefficients are to be calculated. Returns: Numpy array diff --git a/pymatgen/analysis/gb/grain.py b/pymatgen/analysis/gb/grain.py index 8d5f419503f..0c5dbce5bb9 100644 --- a/pymatgen/analysis/gb/grain.py +++ b/pymatgen/analysis/gb/grain.py @@ -642,7 +642,7 @@ def gb_from_parameters( # top grain top_grain = fix_pbc(parent_structure * t1) - # obtain the smallest oriended cell + # obtain the smallest oriented cell if normal and not quick_gen: t_temp = self.get_trans_mat( r_axis=rotation_axis, diff --git a/pymatgen/apps/battery/plotter.py b/pymatgen/apps/battery/plotter.py index 0f08591d568..2e321bee728 100644 --- a/pymatgen/apps/battery/plotter.py +++ b/pymatgen/apps/battery/plotter.py @@ -23,7 +23,7 @@ def __init__(self, xaxis="capacity", hide_negative=False): """ Args: xaxis: The quantity to use as the xaxis. Can be either - - capacity_grav: the graviometric capcity + - capacity_grav: the gravimetric capacity - capacity_vol: the volumetric capacity - x_form: the number of working ions per formula unit of the host - frac_x: the atomic fraction of the working ion diff --git a/pymatgen/core/lattice.py b/pymatgen/core/lattice.py index 3ecb2b56358..654a828b299 100644 --- a/pymatgen/core/lattice.py +++ b/pymatgen/core/lattice.py @@ -1386,7 +1386,7 @@ def get_points_in_sphere_py( Algorithm: 1. place sphere of radius r in crystal and determine minimum supercell - (parallelpiped) which would contain a sphere of radius r. for this + (parallelepiped) which would contain a sphere of radius r. for this we need the projection of a_1 on a unit vector perpendicular to a_2 & a_3 (i.e. the unit vector in the direction b_1) to determine how many a_1"s it will take to contain the sphere. @@ -1443,7 +1443,7 @@ def get_points_in_sphere_old( Algorithm: 1. place sphere of radius r in crystal and determine minimum supercell - (parallelpiped) which would contain a sphere of radius r. for this + (parallelepiped) which would contain a sphere of radius r. for this we need the projection of a_1 on a unit vector perpendicular to a_2 & a_3 (i.e. the unit vector in the direction b_1) to determine how many a_1"s it will take to contain the sphere. diff --git a/pymatgen/electronic_structure/boltztrap2.py b/pymatgen/electronic_structure/boltztrap2.py index 98102022516..521429dc567 100644 --- a/pymatgen/electronic_structure/boltztrap2.py +++ b/pymatgen/electronic_structure/boltztrap2.py @@ -775,7 +775,7 @@ def compute_properties_doping(self, doping, temp_r=None): cond_Effective_mass_doping are dictionaries with 'n' and 'p' keys and arrays of dim (len(temp_r),len(doping),3,3) as values. Carriers_conc_doping: carriers concentration for each doping level and T. - mu_doping_eV: the chemical potential corrispondent to each doping level. + mu_doping_eV: the chemical potential correspondent to each doping level. """ if temp_r is None: temp_r = self.temp_r diff --git a/pymatgen/io/abinit/abitimer.py b/pymatgen/io/abinit/abitimer.py index 0cdd1df35b8..b040ee2bfb4 100644 --- a/pymatgen/io/abinit/abitimer.py +++ b/pymatgen/io/abinit/abitimer.py @@ -495,7 +495,7 @@ class ParallelEfficiency(dict): def __init__(self, filenames, ref_idx, *args, **kwargs): """ Args: - filennames: List of filenames + filenames: List of filenames ref_idx: Index of the Reference time (calculation done with the smallest number of cpus). """ self.update(*args, **kwargs) diff --git a/pymatgen/io/abinit/inputs.py b/pymatgen/io/abinit/inputs.py index 1b42e3736b4..e7a88ada490 100644 --- a/pymatgen/io/abinit/inputs.py +++ b/pymatgen/io/abinit/inputs.py @@ -422,7 +422,7 @@ def ion_ioncell_relax_input( shift_mode="Monkhorst-pack", ): """ - Returns a |BasicMultiDataset| for a structural relaxation. The first dataset optmizes the + Returns a |BasicMultiDataset| for a structural relaxation. The first dataset optimizes the atomic positions at fixed unit cell. The second datasets optimizes both ions and unit cell parameters. Args: diff --git a/pymatgen/io/lammps/inputs.py b/pymatgen/io/lammps/inputs.py index 6b6a910628c..5cecec3f59e 100644 --- a/pymatgen/io/lammps/inputs.py +++ b/pymatgen/io/lammps/inputs.py @@ -1,5 +1,5 @@ """ -This module implements methods for reading/manupilating/writing LAMMPS input files. +This module implements methods for reading/manipulating/writing LAMMPS input files. It does not implement methods for automatically creating inputs based on a structure and computation type. For this, see the InputSet and InputGenerator in sets.py, or https://github.com/Matgenix/atomate2-lammps. diff --git a/pymatgen/io/lobster/lobsterenv.py b/pymatgen/io/lobster/lobsterenv.py index 44341a83cdb..b5cdd88247a 100644 --- a/pymatgen/io/lobster/lobsterenv.py +++ b/pymatgen/io/lobster/lobsterenv.py @@ -106,7 +106,7 @@ def __init__( additional condition add_additional_data_sg: (bool) will add the information from filename_add_bondinglist_sg1, filename_blist_sg1: (str) Path to additional ICOOP, ICOBI data for structure graphs - filename_blist_sg2: (str) Path to dditional ICOOP, ICOBI data for structure graphs + filename_blist_sg2: (str) Path to additional ICOOP, ICOBI data for structure graphs id_blist_sg1: (str) Identity of data in filename_blist_sg1, e.g., "icoop" or "icobi" id_blist_sg2: (str) Identity of data in filename_blist_sg2, @@ -695,7 +695,7 @@ def _evaluate_ce( only_bonds_to: restricts the types of bonds that will be considered additional_condition: Additional condition for the evaluation perc_strength_ICOHP: will be used to determine how strong the ICOHPs (percentage*strongest ICOHP) will be - that are still considered for the evalulation + that are still considered for the evaluation adapt_extremum_to_add_cond: will recalculate the limit based on the bonding type and not on the overall extremum. diff --git a/pymatgen/io/vasp/outputs.py b/pymatgen/io/vasp/outputs.py index 2d6dfc5d9f7..8f8c22ed749 100644 --- a/pymatgen/io/vasp/outputs.py +++ b/pymatgen/io/vasp/outputs.py @@ -4953,7 +4953,7 @@ class WSWQ(MSONable): r""" Class for reading a WSWQ file. The WSWQ file is used to calculation the wave function overlaps between - - W: Wavefunctions in the currenct directory's WAVECAR file + - W: Wavefunctions in the current directory's WAVECAR file - WQ: Wavefunctions stored in a filed named the WAVECAR.qqq. The overlap is computed using the overlap operator S diff --git a/pymatgen/io/zeopp.py b/pymatgen/io/zeopp.py index c8b84b6ccc5..1ca931b222c 100644 --- a/pymatgen/io/zeopp.py +++ b/pymatgen/io/zeopp.py @@ -253,9 +253,9 @@ def get_voronoi_nodes(structure, rad_dict=None, probe_rad=0.1): for el in rad_dict: fp.write(f"{el} {rad_dict[el].real}\n") - atmnet = AtomNetwork.read_from_CSSR(zeo_inp_filename, rad_flag=rad_flag, rad_file=rad_file) - vornet, vor_edge_centers, vor_face_centers = atmnet.perform_voronoi_decomposition() - vornet.analyze_writeto_XYZ(name, probe_rad, atmnet) + atom_net = AtomNetwork.read_from_CSSR(zeo_inp_filename, rad_flag=rad_flag, rad_file=rad_file) + vor_net, vor_edge_centers, vor_face_centers = atom_net.perform_voronoi_decomposition() + vor_net.analyze_writeto_XYZ(name, probe_rad, atom_net) voro_out_filename = name + "_voro.xyz" voro_node_mol = ZeoVoronoiXYZ.from_file(voro_out_filename).molecule @@ -276,12 +276,12 @@ def get_voronoi_nodes(structure, rad_dict=None, probe_rad=0.1): site_properties={"voronoi_radius": prop}, ) - # PMG-Zeo c<->a transformation for voronoi face centers + # PMG-Zeo c<->a transformation for Voronoi face centers rot_face_centers = [(center[1], center[2], center[0]) for center in vor_face_centers] rot_edge_centers = [(center[1], center[2], center[0]) for center in vor_edge_centers] species = ["X"] * len(rot_face_centers) - prop = [0.0] * len(rot_face_centers) # Vor radius not evaluated for fc + prop = [0.0] * len(rot_face_centers) # Voronoi radius not evaluated for fc vor_facecenter_struct = Structure( lattice, species, @@ -292,7 +292,7 @@ def get_voronoi_nodes(structure, rad_dict=None, probe_rad=0.1): ) species = ["X"] * len(rot_edge_centers) - prop = [0.0] * len(rot_edge_centers) # Vor radius not evaluated for fc + prop = [0.0] * len(rot_edge_centers) # Voronoi radius not evaluated for fc vor_edgecenter_struct = Structure( lattice, species, diff --git a/pymatgen/symmetry/settings.py b/pymatgen/symmetry/settings.py index 0a7cdb8d4ad..8e5b2328a56 100644 --- a/pymatgen/symmetry/settings.py +++ b/pymatgen/symmetry/settings.py @@ -37,7 +37,7 @@ def __init__(self, P, p): hexagonal setting) * `a,b,c;-1/4,-1/4,-1/4` is Pnnn:1 to Pnnn:2 (change in origin choice) - * `b,c,a;-1/2,-1/2,-1/2` is Bbab:1 to Ccca:2 (change settin + * `b,c,a;-1/2,-1/2,-1/2` is Bbab:1 to Ccca:2 (change setting and origin) Can transform points (coords), lattices and symmetry operations. diff --git a/pyproject.toml b/pyproject.toml index 2800939e982..a69f1cf4f2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,8 +134,8 @@ ignore_missing_imports = true [tool.codespell] ignore-words-list = """ -titel,alls,ans,nd,mater,nwo,te,hart,ontop,ist,ot,fo,nax,coo,coul,ser,leary,thre, -fase,rute,reson,titels,ges,scalr,strat,struc,hda,nin,ons,pres,kno,loos,lamda,lew +titel,alls,ans,nd,mater,nwo,te,hart,ontop,ist,ot,fo,nax,coo,coul,ser,leary,thre,fase, +rute,reson,titels,ges,scalr,strat,struc,hda,nin,ons,pres,kno,loos,lamda,lew,atomate """ skip = "pymatgen/analysis/aflow_prototypes.json" check-filenames = true diff --git a/tests/io/test_zeopp.py b/tests/io/test_zeopp.py index 8c9ccc89c1b..79d1d26483a 100644 --- a/tests/io/test_zeopp.py +++ b/tests/io/test_zeopp.py @@ -146,8 +146,8 @@ def test_str(self): def test_from_file(self): filename = f"{TEST_FILES_DIR}/EDI_voro.xyz" - vor = ZeoVoronoiXYZ.from_file(filename) - assert isinstance(vor.molecule, Molecule) + voronoi = ZeoVoronoiXYZ.from_file(filename) + assert isinstance(voronoi.molecule, Molecule) @unittest.skipIf(not zeo, "zeo not present.")