Skip to content

Commit

Permalink
fix RUF017
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Aug 21, 2024
1 parent 9fdaede commit b6dbf20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dev_scripts/update_pt_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

from __future__ import annotations

import functools
import json
import operator
import re
from collections import defaultdict
from itertools import product
Expand Down Expand Up @@ -217,7 +219,7 @@ def gen_iupac_ordering():
([17], range(6, 1, -1)),
] # At -> F

order = sum((list(product(x, y)) for x, y in order), []) # noqa: RUF017
order = functools.reduce(operator.iadd, (list(product(x, y)) for x, y in order), [])
iupac_ordering_dict = dict(
zip([Element.from_row_and_group(row, group) for group, row in order], range(len(order)), strict=False)
)
Expand Down
4 changes: 3 additions & 1 deletion src/pymatgen/analysis/adsorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

from __future__ import annotations

import functools
import itertools
import operator
import os
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -300,7 +302,7 @@ def find_adsorption_sites(
sites = [site + distance * np.asarray(self.mvec) for site in sites]

ads_sites[key] = sites
ads_sites["all"] = sum(ads_sites.values(), []) # noqa: RUF017
ads_sites["all"] = functools.reduce(operator.iadd, ads_sites.values(), [])
return ads_sites

def symm_reduce(self, coords_set, threshold=1e-6):
Expand Down

0 comments on commit b6dbf20

Please sign in to comment.