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

[pre-commit.ci] pre-commit autoupdate #77

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: fix-encoding-pragma
Expand All @@ -18,33 +18,33 @@ repos:
args: ['--maxkb=3000']

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]
exclude: README.md

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args:
- --profile=black

- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
args:
Expand All @@ -56,7 +56,7 @@ repos:

# Temporarily downgrade flake8 because it gives 'str' is not callable error.
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 7.1.1
hooks:
- id: flake8
files: ^WFacer/
Expand All @@ -80,9 +80,9 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
stages: [commit, commit-msg]
stages: [pre-commit, commit-msg]
exclude_types: [html]
args: [--ignore-words-list, 'nd, tread, mater, titel, atomate, Atomate', --skip, "*.ipynb"]
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
Loading