Skip to content

Commit

Permalink
Replace range(len(...)) with enumerate(...) (#410)
Browse files Browse the repository at this point in the history
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
deepsource-autofix[bot] authored Dec 12, 2022
1 parent 5bf6780 commit 97fa791
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mofdscribe/featurizers/chemistry/aprdf.py
Original file line number Diff line number Diff line change
@@ -111,14 +111,14 @@ def _featurize(self, s: Union[Structure, IStructure]) -> np.array:
aprdfs = np.zeros((len(self.properties), len(self.aggregations), len(bins)))

# todo: use numba to speed up
for i in range(len(s)):
for i, item in enumerate(s):
for j in range(i + 1, len(s)):
dist = s.get_distance(i, j)
if dist < self.cutoff and dist > self.lower_lim:
bin_idx = int((dist - self.lower_lim) // self.bin_size)
for pi, prop in enumerate(self.properties):
for ai, agg in enumerate(self.aggregations):
p0 = encode(s[i].specie, prop)
p0 = encode(item.specie, prop)
p1 = encode(s[j].specie, prop)

agg_func = AGGREGATORS[agg]

0 comments on commit 97fa791

Please sign in to comment.