Skip to content

Commit

Permalink
double-quote-cython-strings
Browse files Browse the repository at this point in the history
following black
  • Loading branch information
janosh committed Dec 6, 2022
1 parent 411f146 commit a080203
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ repos:
hooks:
- id: cython-lint
args: [--no-pycodestyle]
- id: double-quote-cython-strings
2 changes: 1 addition & 1 deletion pymatgen/optimization/linear_assignment.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LinearAssignment:
"""

def __init__(self, costs, epsilon=1e-13):
self.orig_c = np.array(costs, dtype=np.float_, copy=False, order='C')
self.orig_c = np.array(costs, dtype=np.float_, copy=False, order="C")
self.nx, self.ny = self.orig_c.shape
self.n = self.ny

Expand Down
8 changes: 4 additions & 4 deletions pymatgen/util/coord_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def pbc_shortest_vectors(lattice, fcoords1, fcoords2, mask=None, return_d2=False
frac_im[k] = images_view[i]
k += 1

cdef np.float_t[:, ::1] lat = np.array(matrix, dtype=np.float_, copy=False, order='C')
cdef np.float_t[:, ::1] lat = np.array(matrix, dtype=np.float_, copy=False, order="C")

I = len(fcoords1)
J = len(fcoords2)
Expand All @@ -124,12 +124,12 @@ def pbc_shortest_vectors(lattice, fcoords1, fcoords2, mask=None, return_d2=False
cdef bint has_mask = mask is not None
cdef np.int_t[:, :] m
if has_mask:
m = np.array(mask, dtype=np.int_, copy=False, order='C')
m = np.array(mask, dtype=np.int_, copy=False, order="C")

cdef bint has_ftol = (lll_frac_tol is not None)
cdef np.float_t[:] ftol
if has_ftol:
ftol = np.array(lll_frac_tol, dtype=np.float_, order='C', copy=False)
ftol = np.array(lll_frac_tol, dtype=np.float_, order="C", copy=False)


dot_2d_mod(fc1, lat, cart_f1)
Expand Down Expand Up @@ -207,7 +207,7 @@ def is_coord_subset_pbc(subset, superset, atol, mask, pbc=(True, True, True)):
cdef np.float_t[:, :] fc1 = subset
cdef np.float_t[:, :] fc2 = superset
cdef np.float_t[:] t = atol
cdef np.int_t[:, :] m = np.array(mask, dtype=np.int_, copy=False, order='C')
cdef np.int_t[:, :] m = np.array(mask, dtype=np.int_, copy=False, order="C")

cdef int i, j, k, len_fc1, len_fc2
cdef np.float_t d
Expand Down

0 comments on commit a080203

Please sign in to comment.