From 9ffae0aeee24bae06ef96c1252275c9585cd5f30 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 19:57:58 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.31.0 → v2.32.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.32.1) - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0) - [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0) - [github.com/pre-commit/mirrors-mypy: v0.930 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.960) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a2cd7a6..d885ae77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,13 +21,13 @@ repos: - --ignore-init-module-imports - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: check-yaml exclude: pymatgen/analysis/vesta_cutoffs.yaml @@ -41,7 +41,7 @@ repos: args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.3.0 hooks: - id: black @@ -51,6 +51,6 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.930 + rev: v0.960 hooks: - id: mypy From 5f38b8ee45119b4a1ee158831b36a4b5667542b4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 19:58:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pymatgen/analysis/diffusion/aimd/rdf.py | 5 ++--- pymatgen/analysis/diffusion/aimd/tests/test_pathway.py | 5 ++++- pymatgen/analysis/diffusion/aimd/tests/test_rdf.py | 1 - pymatgen/analysis/diffusion/aimd/tests/test_van_hove.py | 7 +++++-- pymatgen/analysis/diffusion/aimd/van_hove.py | 4 ++-- pymatgen/analysis/diffusion/analyzer.py | 5 ++++- pymatgen/analysis/diffusion/neb/full_path_mapper.py | 5 ++++- pymatgen/analysis/diffusion/neb/pathfinder.py | 5 ++++- pymatgen/analysis/diffusion/neb/tests/test_pathfinder.py | 6 +++++- pymatgen/analysis/diffusion/tests/test_analyzer.py | 6 +++++- pymatgen/analysis/diffusion/utils/edge_data_from_sc.py | 9 +++++++-- pymatgen/analysis/diffusion/utils/supercells.py | 4 +++- .../diffusion/utils/tests/test_edge_data_from_sc.py | 6 +++++- requirements-ci.txt | 2 +- requirements.txt | 2 +- setup.py | 4 ++-- tasks.py | 6 +++--- 17 files changed, 57 insertions(+), 25 deletions(-) diff --git a/pymatgen/analysis/diffusion/aimd/rdf.py b/pymatgen/analysis/diffusion/aimd/rdf.py index d1fd63e7..52791a5b 100644 --- a/pymatgen/analysis/diffusion/aimd/rdf.py +++ b/pymatgen/analysis/diffusion/aimd/rdf.py @@ -12,13 +12,12 @@ import numpy as np from joblib import Parallel, delayed +from pymatgen.core import Structure +from pymatgen.util.plotting import pretty_plot from scipy.ndimage import gaussian_filter1d from scipy.signal import find_peaks from scipy.stats import norm -from pymatgen.core import Structure -from pymatgen.util.plotting import pretty_plot - class RadialDistributionFunction: """ diff --git a/pymatgen/analysis/diffusion/aimd/tests/test_pathway.py b/pymatgen/analysis/diffusion/aimd/tests/test_pathway.py index 48d4794c..5b2767ad 100644 --- a/pymatgen/analysis/diffusion/aimd/tests/test_pathway.py +++ b/pymatgen/analysis/diffusion/aimd/tests/test_pathway.py @@ -12,7 +12,10 @@ from pymatgen.core import Structure from pymatgen.io.vasp import Chgcar -from pymatgen.analysis.diffusion.aimd.pathway import ProbabilityDensityAnalysis, SiteOccupancyAnalyzer +from pymatgen.analysis.diffusion.aimd.pathway import ( + ProbabilityDensityAnalysis, + SiteOccupancyAnalyzer, +) from pymatgen.analysis.diffusion.analyzer import DiffusionAnalyzer tests_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/pymatgen/analysis/diffusion/aimd/tests/test_rdf.py b/pymatgen/analysis/diffusion/aimd/tests/test_rdf.py index 86b561ed..30203534 100644 --- a/pymatgen/analysis/diffusion/aimd/tests/test_rdf.py +++ b/pymatgen/analysis/diffusion/aimd/tests/test_rdf.py @@ -20,7 +20,6 @@ def test_rdf(self): structure_list.append(s) if i == 9: break - species = ["Na", "P", "S"] # Test from_species obj = RadialDistributionFunctionFast(structures=structure_list, ngrid=101, rmax=10.0, sigma=0.1) diff --git a/pymatgen/analysis/diffusion/aimd/tests/test_van_hove.py b/pymatgen/analysis/diffusion/aimd/tests/test_van_hove.py index 1e336275..1e0bf1d8 100644 --- a/pymatgen/analysis/diffusion/aimd/tests/test_van_hove.py +++ b/pymatgen/analysis/diffusion/aimd/tests/test_van_hove.py @@ -14,8 +14,11 @@ import numpy as np from monty.serialization import loadfn -from pymatgen.analysis.diffusion.aimd.van_hove import EvolutionAnalyzer, RadialDistributionFunction, VanHoveAnalysis -from pymatgen.analysis.diffusion.analyzer import DiffusionAnalyzer +from pymatgen.analysis.diffusion.aimd.van_hove import ( + EvolutionAnalyzer, + RadialDistributionFunction, + VanHoveAnalysis, +) matplotlib.use("pdf") tests_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/pymatgen/analysis/diffusion/aimd/van_hove.py b/pymatgen/analysis/diffusion/aimd/van_hove.py index 7a6071af..61f99de4 100644 --- a/pymatgen/analysis/diffusion/aimd/van_hove.py +++ b/pymatgen/analysis/diffusion/aimd/van_hove.py @@ -12,11 +12,11 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pds -from scipy.stats import norm - from pymatgen.core import Structure from pymatgen.util.plotting import pretty_plot from pymatgen.util.typing import ArrayLike +from scipy.stats import norm + from pymatgen.analysis.diffusion.analyzer import DiffusionAnalyzer from .rdf import RadialDistributionFunction diff --git a/pymatgen/analysis/diffusion/analyzer.py b/pymatgen/analysis/diffusion/analyzer.py index 74ec7562..16956b47 100644 --- a/pymatgen/analysis/diffusion/analyzer.py +++ b/pymatgen/analysis/diffusion/analyzer.py @@ -24,7 +24,10 @@ import numpy as np import scipy.constants as const from monty.json import MSONable -from pymatgen.analysis.structure_matcher import OrderDisorderElementComparator, StructureMatcher +from pymatgen.analysis.structure_matcher import ( + OrderDisorderElementComparator, + StructureMatcher, +) from pymatgen.core.periodic_table import get_el_sp from pymatgen.core.structure import Structure from pymatgen.io.vasp.outputs import Vasprun diff --git a/pymatgen/analysis/diffusion/neb/full_path_mapper.py b/pymatgen/analysis/diffusion/neb/full_path_mapper.py index 1d3fbc6d..e1bfa13f 100644 --- a/pymatgen/analysis/diffusion/neb/full_path_mapper.py +++ b/pymatgen/analysis/diffusion/neb/full_path_mapper.py @@ -29,7 +29,10 @@ from pymatgen.symmetry.structure import SymmetrizedStructure from pymatgen.analysis.diffusion.neb.pathfinder import MigrationHop -from pymatgen.analysis.diffusion.neb.periodic_dijkstra import get_optimal_pathway_rev, periodic_dijkstra +from pymatgen.analysis.diffusion.neb.periodic_dijkstra import ( + get_optimal_pathway_rev, + periodic_dijkstra, +) from pymatgen.analysis.diffusion.utils.parse_entries import process_entries logger = logging.getLogger(__name__) diff --git a/pymatgen/analysis/diffusion/neb/pathfinder.py b/pymatgen/analysis/diffusion/neb/pathfinder.py index 787921b7..e1975d91 100644 --- a/pymatgen/analysis/diffusion/neb/pathfinder.py +++ b/pymatgen/analysis/diffusion/neb/pathfinder.py @@ -24,7 +24,10 @@ # TODO: (1) ipython notebook example files, unittests from pymatgen.symmetry.structure import SymmetrizedStructure -from pymatgen.analysis.diffusion.utils.supercells import get_sc_fromstruct, get_start_end_structures +from pymatgen.analysis.diffusion.utils.supercells import ( + get_sc_fromstruct, + get_start_end_structures, +) logger = logging.getLogger(__name__) diff --git a/pymatgen/analysis/diffusion/neb/tests/test_pathfinder.py b/pymatgen/analysis/diffusion/neb/tests/test_pathfinder.py index 8d73b438..9de23910 100644 --- a/pymatgen/analysis/diffusion/neb/tests/test_pathfinder.py +++ b/pymatgen/analysis/diffusion/neb/tests/test_pathfinder.py @@ -10,7 +10,11 @@ from pymatgen.util.testing import PymatgenTest from pymatgen.analysis.diffusion.neb.full_path_mapper import MigrationGraph -from pymatgen.analysis.diffusion.neb.pathfinder import DistinctPathFinder, IDPPSolver, MigrationHop +from pymatgen.analysis.diffusion.neb.pathfinder import ( + DistinctPathFinder, + IDPPSolver, + MigrationHop, +) from pymatgen.analysis.diffusion.utils.supercells import get_start_end_structures __author__ = "Iek-Heng Chu" diff --git a/pymatgen/analysis/diffusion/tests/test_analyzer.py b/pymatgen/analysis/diffusion/tests/test_analyzer.py index 18e95c60..841ddfae 100644 --- a/pymatgen/analysis/diffusion/tests/test_analyzer.py +++ b/pymatgen/analysis/diffusion/tests/test_analyzer.py @@ -14,7 +14,11 @@ from pymatgen.core.structure import Structure from pymatgen.util.testing import PymatgenTest -from pymatgen.analysis.diffusion.analyzer import DiffusionAnalyzer, fit_arrhenius, get_conversion_factor +from pymatgen.analysis.diffusion.analyzer import ( + DiffusionAnalyzer, + fit_arrhenius, + get_conversion_factor, +) module_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/pymatgen/analysis/diffusion/utils/edge_data_from_sc.py b/pymatgen/analysis/diffusion/utils/edge_data_from_sc.py index 7f63244f..35dd321b 100644 --- a/pymatgen/analysis/diffusion/utils/edge_data_from_sc.py +++ b/pymatgen/analysis/diffusion/utils/edge_data_from_sc.py @@ -19,8 +19,13 @@ from pymatgen.core.structure import PeriodicSite, Structure from pymatgen.symmetry.analyzer import SpacegroupAnalyzer -from pymatgen.analysis.diffusion.neb.full_path_mapper import MigrationGraph, MigrationHop -from pymatgen.analysis.diffusion.utils.parse_entries import get_matched_structure_mapping +from pymatgen.analysis.diffusion.neb.full_path_mapper import ( + MigrationGraph, + MigrationHop, +) +from pymatgen.analysis.diffusion.utils.parse_entries import ( + get_matched_structure_mapping, +) logger = logging.getLogger(__name__) diff --git a/pymatgen/analysis/diffusion/utils/supercells.py b/pymatgen/analysis/diffusion/utils/supercells.py index 3b9c2d0b..63bf9bc7 100644 --- a/pymatgen/analysis/diffusion/utils/supercells.py +++ b/pymatgen/analysis/diffusion/utils/supercells.py @@ -11,7 +11,9 @@ # from ase.build import find_optimal_cell_shape, get_deviation_from_optimal_cell_shape # from pymatgen.io.ase import AseAtomsAdaptor from pymatgen.core import PeriodicSite, Structure -from pymatgen.transformations.advanced_transformations import CubicSupercellTransformation +from pymatgen.transformations.advanced_transformations import ( + CubicSupercellTransformation, +) __author__ = "Jimmy Shen" __copyright__ = "Copyright 2019, The Materials Project" diff --git a/pymatgen/analysis/diffusion/utils/tests/test_edge_data_from_sc.py b/pymatgen/analysis/diffusion/utils/tests/test_edge_data_from_sc.py index c8573aa5..0da1d3dd 100644 --- a/pymatgen/analysis/diffusion/utils/tests/test_edge_data_from_sc.py +++ b/pymatgen/analysis/diffusion/utils/tests/test_edge_data_from_sc.py @@ -9,7 +9,11 @@ from pymatgen.core.structure import PeriodicSite, Structure from pymatgen.analysis.diffusion.neb.full_path_mapper import MigrationGraph -from pymatgen.analysis.diffusion.utils.edge_data_from_sc import add_edge_data_from_sc, get_uc_pos, get_unique_hop +from pymatgen.analysis.diffusion.utils.edge_data_from_sc import ( + add_edge_data_from_sc, + get_uc_pos, + get_unique_hop, +) test_dir = os.path.dirname(os.path.realpath(__file__)) diff --git a/requirements-ci.txt b/requirements-ci.txt index 7167c7d2..a1459e5f 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -7,4 +7,4 @@ flake8 pylint black treon==0.1.3 -maggma==0.39.1 \ No newline at end of file +maggma==0.39.1 diff --git a/requirements.txt b/requirements.txt index 172e9c1e..4ac18b73 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pymatgen==2022.5.19 joblib==1.1.0 -ase==3.22.1 \ No newline at end of file +ase==3.22.1 diff --git a/setup.py b/setup.py index 59401356..d2edac25 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ # Copyright (c) Materials Virtual Lab # Distributed under the terms of the Modified BSD License. -from setuptools import setup, find_namespace_packages - import os +from setuptools import find_namespace_packages, setup + SETUP_PTH = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(SETUP_PTH, "README.rst")) as f: diff --git a/tasks.py b/tasks.py index 11137e56..ddfba815 100644 --- a/tasks.py +++ b/tasks.py @@ -5,13 +5,13 @@ """ -import glob import datetime -import re +import glob import json -import requests import os +import re +import requests from invoke import task from monty.os import cd