Skip to content

Commit

Permalink
pre-commit autoupdate & fix typos (#3371)
Browse files Browse the repository at this point in the history
* pre-commit autoupdate

updates:
- [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](codespell-project/codespell@v2.2.5...v2.2.6)
- [github.com/igorshubovych/markdownlint-cli: v0.36.0 → v0.37.0](igorshubovych/markdownlint-cli@v0.36.0...v0.37.0)

* fix typos

---------

Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and janosh authored Oct 3, 2023
1 parent 7cc629d commit 679fe1c
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2653,7 +2653,7 @@ package <https://pypi.python.org/pypi/monty>`\_, 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/diffraction/tem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/gb/grain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/apps/battery/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/core/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/electronic_structure/boltztrap2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/abinit/abitimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/abinit/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/lammps/inputs.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/io/lobster/lobsterenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions pymatgen/io/zeopp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/symmetry/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/io/test_zeopp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 679fe1c

Please sign in to comment.