Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for core.(molecular_orbitals|operations|sites|spectrum|tensor|xcfunc) #3829

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def points_wcs_csc(self, permutation=None):
"""
if permutation is None:
return self._points_wcs_csc
return np.concatenate((self._points_wcs_csc[0:1], self._points_wocs_csc.take(permutation, axis=0)))
return np.concatenate((self._points_wcs_csc[:1], self._points_wocs_csc.take(permutation, axis=0)))

def points_wocs_csc(self, permutation=None):
"""
Expand All @@ -238,7 +238,7 @@ def points_wcs_ctwcc(self, permutation=None):
return self._points_wcs_ctwcc
return np.concatenate(
(
self._points_wcs_ctwcc[0:1],
self._points_wcs_ctwcc[:1],
self._points_wocs_ctwcc.take(permutation, axis=0),
)
)
Expand All @@ -261,7 +261,7 @@ def points_wcs_ctwocc(self, permutation=None):
return self._points_wcs_ctwocc
return np.concatenate(
(
self._points_wcs_ctwocc[0:1],
self._points_wcs_ctwocc[:1],
self._points_wocs_ctwocc.take(permutation, axis=0),
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def project_and_to2dim(self, pps, plane_center):
xypps = []
for pp in proj:
xyzpp = np.dot(pp, PP)
xypps.append(xyzpp[0:2])
xypps.append(xyzpp[:2])
if str(plane_center) == "mean":
mean = np.zeros(2, float)
for pp in xypps:
Expand All @@ -910,7 +910,7 @@ def project_and_to2dim(self, pps, plane_center):
xypps = [pp - mean for pp in xypps]
elif plane_center is not None:
projected_plane_center = self.projectionpoints([plane_center])[0]
xy_projected_plane_center = np.dot(projected_plane_center, PP)[0:2]
xy_projected_plane_center = np.dot(projected_plane_center, PP)[:2]
xypps = [pp - xy_projected_plane_center for pp in xypps]
return xypps

Expand Down Expand Up @@ -960,7 +960,7 @@ def coefficients(self):
@property
def abcd(self):
"""A tuple with the plane coefficients."""
return tuple(self._coefficients[0:4])
return tuple(self._coefficients[:4])

@property
def a(self):
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 @@ -130,7 +130,7 @@ def get_nearest_site(struct: Structure, coords: Sequence[float], site: PeriodicS
# Sort by distance to coords
ns.sort(key=lambda x: x[1])
# Return PeriodicSite and distance of closest image
return ns[0][0:2]
return ns[0][:2]


class Polarization:
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/magnetism/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ def _add_structures(ordered_structures, ordered_structures_origins, structures_t

# ...and decide which ones to keep
if len(max_symmetries) > self.truncate_by_symmetry:
max_symmetries = max_symmetries[0:5]
max_symmetries = max_symmetries[:5]
structs_to_keep = [(idx, num) for idx, num in enumerate(num_sym_ops) if num in max_symmetries]

# sort so that highest symmetry structs are first
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/command_line/gulp_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def get_relaxed_structure(gout: str):
# read the site coordinates in the following lines
idx += 6
line = output_lines[idx]
while line[0:2] != "--":
while line[:2] != "--":
structure_lines.append(line)
idx += 1
line = output_lines[idx]
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/command_line/mcsqs_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _parse_clusters(filename):
for point in range(cluster_dict["num_points_in_cluster"]):
line = cluster[3 + point].split(" ")
point_dict = {}
point_dict["coordinates"] = [float(line) for line in line[0:3]]
point_dict["coordinates"] = [float(line) for line in line[:3]]
point_dict["num_possible_species"] = int(line[3]) + 2 # see ATAT manual for why +2
point_dict["cluster_function"] = float(line[4]) # see ATAT manual for what "function" is
points.append(point_dict)
Expand Down
Loading
Loading