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 autoupdate #666

Open
wants to merge 2 commits into
base: master
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.8.6
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
exclude: pymatgen/analysis/vesta_cutoffs.yaml
- id: end-of-file-fixer
- id: trailing-whitespace

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

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.14.1
hooks:
- id: mypy

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
stages: [commit, commit-msg]
stages: [pre-commit, commit-msg]
exclude_types: [html]
additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
rev: v0.16.6
hooks:
- id: cython-lint
args: [--no-pycodestyle]
Expand Down
2 changes: 1 addition & 1 deletion src/maml/apps/bowsr/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def as_dict(self):

def serialize(t) -> tuple:
"""
serialize the object.
Serialize the object.

Args:
t: object
Expand Down
4 changes: 2 additions & 2 deletions src/maml/apps/gbe/describer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def convert_hcp_direction(rotation_axis: list, lat_type: str) -> np.ndarray:
"""
four index notion to three index notion for hcp and rhombohedral axis
Four index notion to three index notion for hcp and rhombohedral axis
Args:
rotation_axis (list): four index notion of axis
lat_type(str): the
Expand Down Expand Up @@ -66,7 +66,7 @@ def convert_hcp_direction(rotation_axis: list, lat_type: str) -> np.ndarray:

def convert_hcp_plane(plane: list) -> np.ndarray:
"""
four index notion to three index notion for hcp and rhombohedral plane
Four index notion to three index notion for hcp and rhombohedral plane
Args:
plane (list): four index notion.

Expand Down
16 changes: 8 additions & 8 deletions src/maml/apps/pes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
from ._snap import SNAPotential

__all__ = [
"Potential",
"DefectFormation",
"ElasticConstant",
"EnergyForceStress",
"GAPotential",
"MTPotential",
"SNAPotential",
"NNPotential",
"LMPStaticCalculator",
"EnergyForceStress",
"SpectralNeighborAnalysis",
"ElasticConstant",
"LatticeConstant",
"MTPotential",
"NNPotential",
"NudgedElasticBand",
"DefectFormation",
"Potential",
"SNAPotential",
"SpectralNeighborAnalysis",
"get_default_lmp_exe",
]
10 changes: 5 additions & 5 deletions src/maml/apps/symbolic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
from ._selectors_cvxpy import LassoCP as Lasso # type: ignore

__all__ = [
"DantzigSelector",
"AdaptiveLasso",
"ISIS",
"SCAD",
"Lasso",
"SIS",
"ISIS",
"L0BrutalForce",
"AdaptiveLasso",
"DantzigSelector",
"FeatureGenerator",
"L0BrutalForce",
"Lasso",
"Operator",
]
8 changes: 4 additions & 4 deletions src/maml/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
__all__ = [
"BaseDataSource",
"BaseDescriber",
"SequentialDescriber",
"DummyDescriber",
"BaseModel",
"DummyDescriber",
"KerasModel",
"SKLModel",
"get_feature_batch",
"SequentialDescriber",
"TargetScalerMixin",
"describer_type",
"get_feature_batch",
"is_keras_model",
"is_sklearn_model",
"TargetScalerMixin",
]
2 changes: 1 addition & 1 deletion src/maml/base/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def fit(
@staticmethod
def _get_validation_data(val_features, val_targets, **val_kwargs):
"""
construct validation data, the default is just returning a list of
Construct validation data, the default is just returning a list of
val_features and val_targets.
"""
return val_features, val_targets
Expand Down
18 changes: 9 additions & 9 deletions src/maml/describers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
)

__all__ = [
"BispectrumCoefficients",
"SmoothOverlapAtomicPosition",
"BPSymmetryFunctions",
"DistinctSiteProperty",
"BispectrumCoefficients",
"CoulombEigenSpectrum",
"CoulombMatrix",
"SortedCoulombMatrix",
"RandomizedCoulombMatrix",
"DistinctSiteProperty",
"ElementProperty",
"ElementStats",
"M3GNetSite",
"M3GNetStructure",
"MEGNetSite",
"MEGNetStructure",
"CoulombEigenSpectrum",
"RadialDistributionFunction",
"RandomizedCoulombMatrix",
"SiteElementProperty",
"SmoothOverlapAtomicPosition",
"SortedCoulombMatrix",
"wrap_matminer_describer",
"M3GNetStructure",
"M3GNetSite",
"RadialDistributionFunction",
]
4 changes: 2 additions & 2 deletions src/maml/describers/_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from maml.utils import pool_from, to_composition

__all__ = [
"BispectrumCoefficients",
"SmoothOverlapAtomicPosition",
"BPSymmetryFunctions",
"BispectrumCoefficients",
"SiteElementProperty",
"SmoothOverlapAtomicPosition",
]


Expand Down
4 changes: 2 additions & 2 deletions src/maml/describers/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@


__all__ = [
"DistinctSiteProperty",
"CoulombEigenSpectrum",
"CoulombMatrix",
"DistinctSiteProperty",
"RandomizedCoulombMatrix",
"SortedCoulombMatrix",
"CoulombEigenSpectrum",
]


Expand Down
2 changes: 1 addition & 1 deletion src/maml/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

from .dl import MLP, AtomSets, WeightedAverageLayer, WeightedSet2Set

__all__ = ["SKLModel", "KerasModel", "AtomSets", "MLP", "WeightedSet2Set", "WeightedAverageLayer"]
__all__ = ["MLP", "AtomSets", "KerasModel", "SKLModel", "WeightedAverageLayer", "WeightedSet2Set"]
2 changes: 1 addition & 1 deletion src/maml/models/dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from ._layers import WeightedAverageLayer, WeightedSet2Set
from ._mlp import MLP

__all__ = ["WeightedAverageLayer", "WeightedSet2Set", "AtomSets", "MLP"]
__all__ = ["MLP", "AtomSets", "WeightedAverageLayer", "WeightedSet2Set"]
4 changes: 2 additions & 2 deletions src/maml/models/dl/_keras_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def deserialize_keras_activation(activation):
"""
serialize keras activation.
Serialize keras activation.

Args:
activation (str, dict, or Activation object): activation to serialize
Expand All @@ -28,7 +28,7 @@ def deserialize_keras_activation(activation):

def deserialize_keras_optimizer(optimizer):
"""
serialize keras activation.
Serialize keras activation.

Args:
optimizer (str, dict, or optimizer object): optimizer to serialize
Expand Down
46 changes: 23 additions & 23 deletions src/maml/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,36 @@
from ._value_profile import ConstantValue, LinearProfile, ValueProfile

__all__ = [
"pool_from",
"convert_docs",
"to_array",
"ValueProfile",
"STATS_KWARGS",
"ConstantValue",
"DataSplitter",
"DummyScaler",
"LinearProfile",
"njit",
"MultiScratchDir",
"DataSplitter",
"Scaler",
"ShuffleSplitter",
"write_data_from_structure",
"check_structures_forces_stresses",
"stress_format_change",
"stress_list_to_matrix",
"stress_matrix_to_list",
"get_lammps_lattice_and_rotation",
"StandardScaler",
"Stats",
"STATS_KWARGS",
"stats_list_conversion",
"get_full_stats_and_funcs",
"spectrogram",
"ValueProfile",
"check_structures_forces_stresses",
"convert_docs",
"cwt",
"wvd",
"feature_dim_from_test_system",
"fft_magnitude",
"get_describer_dummy_obj",
"get_full_args",
"get_full_stats_and_funcs",
"get_lammps_lattice_and_rotation",
"get_sp_method",
"njit",
"pool_from",
"spectrogram",
"stats_list_conversion",
"stress_format_change",
"stress_list_to_matrix",
"stress_matrix_to_list",
"to_array",
"to_composition",
"get_full_args",
"get_describer_dummy_obj",
"feature_dim_from_test_system",
"StandardScaler",
"Scaler",
"DummyScaler",
"write_data_from_structure",
"wvd",
]
2 changes: 1 addition & 1 deletion src/maml/utils/_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def stress_matrix_to_list(stress_matrix: np.ndarray, stress_format: str = "VASP"

def stress_list_to_matrix(stress: np.ndarray | list[float], stress_format: str = "VASP") -> np.ndarray:
"""
convert a length-6 stress list to stress matrix 3x3.
Convert a length-6 stress list to stress matrix 3x3.

Args:
stress (list of float): list of stress
Expand Down
2 changes: 1 addition & 1 deletion src/maml/utils/_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def transform(target: float, n: int = 1) -> float:
@staticmethod
def inverse_transform(transformed_target: float, n: int = 1) -> float:
"""
return as it is
Return as it is
Args:
transformed_target (float): transformed target
n (int): number of atoms
Expand Down
12 changes: 6 additions & 6 deletions src/maml/utils/_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def max(data: list[float], weights: list[float] | None = None) -> float:
@staticmethod
def min(data: list[float], weights: list[float] | None = None) -> float:
"""
min of value
Min of value
Args:
data (list): list of float data
weights (list): optional weights.
Expand Down Expand Up @@ -114,7 +114,7 @@ def mode(data: list[float], weights: list[float] | None = None) -> float:
@staticmethod
def mean_absolute_deviation(data: list[float], weights: list[float] | None = None) -> float:
"""
mean absolute deviation.
Mean absolute deviation.

Args:
data (list): list of float data
Expand All @@ -129,7 +129,7 @@ def mean_absolute_deviation(data: list[float], weights: list[float] | None = Non
@staticmethod
def mean_absolute_error(data: list[float], weights: list[float] | None = None) -> float:
"""
mean absolute error.
Mean absolute error.

Args:
data (list): list of float data
Expand Down Expand Up @@ -199,7 +199,7 @@ def mean(data: list[float], weights: list[float] | None = None) -> float:
@staticmethod
def inverse_mean(data: list[float], weights: list[float] | None = None) -> float:
"""
inverse mean.
Inverse mean.

Args:
data (list): list of float data
Expand Down Expand Up @@ -291,7 +291,7 @@ def geometric_mean(data: list[float], weights: list[float] | None = None) -> flo
@staticmethod
def power_mean(data: list[float], weights: list[float] | None = None, p: int = 1) -> float:
"""
power mean https://en.wikipedia.org/wiki/Generalized_mean.
Power mean https://en.wikipedia.org/wiki/Generalized_mean.

Args:
data (list): list of float data
Expand Down Expand Up @@ -335,7 +335,7 @@ def shifted_geometric_mean(data: list[float], weights: list[float] | None = None
@staticmethod
def harmonic_mean(data: list[float], weights: list[float] | None = None) -> float:
"""
harmonic mean of the data.
Harmonic mean of the data.

Args:
data (list): list of float data
Expand Down
2 changes: 1 addition & 1 deletion src/maml/utils/_value_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def increment_step(self):

def get_value(self) -> float:
"""
abstract method that returns the current value
Abstract method that returns the current value
Returns: value float.

"""
Expand Down
Loading