From 414d92e3274f04f00b7fb025c595a9059faa3fcc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 00:03:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- WFacer/specie_decorators/__init__.py | 2 +- WFacer/specie_decorators/base.py | 4 ++-- tests/test_enumeration.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WFacer/specie_decorators/__init__.py b/WFacer/specie_decorators/__init__.py index f739973..46c3029 100644 --- a/WFacer/specie_decorators/__init__.py +++ b/WFacer/specie_decorators/__init__.py @@ -11,7 +11,7 @@ PmgGuessChargeDecorator, ) -allowed_decorators = defaultdict(lambda: []) +allowed_decorators = defaultdict(list) for subclass in get_subclasses(BaseDecorator).values(): prop = subclass.decorated_prop_name if subclass.required_prop_names is not None: diff --git a/WFacer/specie_decorators/base.py b/WFacer/specie_decorators/base.py index b7e669a..d75c681 100644 --- a/WFacer/specie_decorators/base.py +++ b/WFacer/specie_decorators/base.py @@ -116,7 +116,7 @@ def group_site_by_species(entries): defaultdict: (Entry index, site index) belonging to each species. """ - groups_by_species = defaultdict(lambda: []) + groups_by_species = defaultdict(list) # These entries should not contain Vacancy. for e_id, entry in enumerate(entries): @@ -249,7 +249,7 @@ def _process(self, entries, decorate_rules): species_decor.append(sp) # Preserve all information. - site_properties = defaultdict(lambda: []) + site_properties = defaultdict(list) for site in s_undecor: for p in site.properties: site_properties[p].append(site.properties[p]) diff --git a/tests/test_enumeration.py b/tests/test_enumeration.py index 9e943b3..b9539b4 100644 --- a/tests/test_enumeration.py +++ b/tests/test_enumeration.py @@ -170,7 +170,7 @@ def test_enumerate_structures(single_expansion): for occu, mid in zip(occus, mids) ] # When keeping the ground states, each composition must have at least 1 state. - count_occurences = defaultdict(lambda: 0) + count_occurences = defaultdict(int) for n in ns: count_occurences[n] += 1