Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent bf7f6df commit 627d83a
Show file tree
Hide file tree
Showing 29 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions WFacer/convergence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convergence checks."""

import numpy as np
from pymatgen.analysis.structure_matcher import StructureMatcher
from smol.cofe import ClusterExpansion
Expand Down
1 change: 1 addition & 0 deletions WFacer/fit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fit ECIs from Wrangler."""

from warnings import warn

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions WFacer/jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unitary jobs used by an atomate2 workflow."""

import importlib
import logging
from copy import deepcopy
Expand Down
1 change: 1 addition & 0 deletions WFacer/maker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatic cluster expansion workflow maker."""

from dataclasses import dataclass, field
from warnings import warn

Expand Down
1 change: 1 addition & 0 deletions WFacer/sample_generators/mc_generators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Monte-carlo to estimate ground states and sample structures."""

import itertools
from abc import ABCMeta, abstractmethod
from warnings import warn
Expand Down
1 change: 1 addition & 0 deletions WFacer/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines the standard output schema for automated cluster expansion workflows."""

from typing import Any, Dict, List, Union

from pydantic import BaseModel, Field
Expand Down
2 changes: 1 addition & 1 deletion WFacer/specie_decorators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions WFacer/specie_decorators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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])
Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/convex_hull.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities to obtain minimum energies per composition and the convex hull."""

from collections import defaultdict

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/duplicacy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Check duplicacy between structures."""

import numpy as np
from pymatgen.analysis.structure_matcher import StructureMatcher
from pymatgen.core import DummySpecies, Element, Species, Structure
Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/occu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Random occupancy generation."""

import numpy as np


Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Rules to query nested task documents and dictionaries."""

import random
from warnings import warn

Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/selection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Structure selection methods from feature matrices."""

from warnings import warn

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions WFacer/utils/sparselm_estimators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility functions to prepare sparse-lm estimators."""

from warnings import warn

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parse and fit cluster expansion."""

import json

from emmet.core.tasks import TaskDoc # emmet-core >= 0.60.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate structures for a next iteration."""

from warnings import warn

from fireworks import LaunchPad
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""An example to semi-automate with fireworks. Generate initial document."""

import json

from monty.json import jsanitize
Expand Down
1 change: 1 addition & 0 deletions tests/test_convergence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test convergence functions."""

import numpy as np
from pymatgen.entries.computed_entries import ComputedStructureEntry
from smol.cofe import ClusterExpansion
Expand Down
3 changes: 2 additions & 1 deletion tests/test_enumeration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test enumerating functions."""

from collections import defaultdict
from itertools import chain
from warnings import warn
Expand Down Expand Up @@ -170,7 +171,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

Expand Down
1 change: 1 addition & 0 deletions tests/test_fit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the fitting functions."""

import os

import cvxpy as cp
Expand Down
1 change: 1 addition & 0 deletions tests/test_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test running jobs."""

from copy import deepcopy
from itertools import chain

Expand Down
1 change: 1 addition & 0 deletions tests/test_maker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the trigger job and the flow maker."""

import numpy as np
import pytest
from jobflow import Flow, Job, Response
Expand Down
1 change: 1 addition & 0 deletions tests/test_mc_generators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test sample generators."""

import random
from itertools import chain

Expand Down
1 change: 1 addition & 0 deletions tests/test_preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test preprocessing functions."""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test initialization of the CeOutputsDocument schema."""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_occu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test occupancy generation."""

import numpy as np
import numpy.testing as npt
from smol.moca.occu_utils import get_dim_ids_table, occu_to_counts
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test query rules."""

import numpy as np
import numpy.testing as npt
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_sparselm_estimators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test sparselm estimator utilities."""

from itertools import chain

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_task_document.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test single_taskdocument utilities."""

import numpy as np
import pytest
from emmet.core.tasks import TaskDoc
Expand Down

0 comments on commit 627d83a

Please sign in to comment.