Skip to content

Commit

Permalink
Run black.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Feb 3, 2024
1 parent a832dbd commit e0612af
Show file tree
Hide file tree
Showing 78 changed files with 623 additions and 449 deletions.
1 change: 1 addition & 0 deletions maml/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Apps utilizing maml."""

from __future__ import annotations

__import__("pkg_resources").declare_namespace(__name__)
1 change: 1 addition & 0 deletions maml/apps/bowsr/acquisition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the new candidate proposal."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Energy surrogate model."""

from __future__ import annotations

from .base import EnergyModel
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/model/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base class that expose a predict_energy method."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/model/cgcnn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CGCNN Wrapper."""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/model/dft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DFT wrapper."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/model/megnet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""megnet model wrapper implementation."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/optimizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the BayesianOptimizer."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/perturbation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the perturbation class for atomic and lattice relaxation."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the scaler."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions maml/apps/bowsr/target_space.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the target space."""

from __future__ import annotations

from typing import TYPE_CHECKING, Callable
Expand Down
1 change: 1 addition & 0 deletions maml/apps/gbe/describer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements the describers for GB entry."""

from __future__ import annotations

from functools import reduce
Expand Down
1 change: 1 addition & 0 deletions maml/apps/gbe/presetfeatures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module defines feature objects for GB energy model."""

from __future__ import annotations


Expand Down
1 change: 1 addition & 0 deletions maml/apps/gbe/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module implements helper functions to retrieve data for GB energy prediction paper."""

from __future__ import annotations

import os
Expand Down
8 changes: 5 additions & 3 deletions maml/apps/pes/_mtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,11 @@ def write_param(self, fitted_mtp="fitted.mtp", **kwargs):
if not self.param:
raise RuntimeError("The parameters should be provided.")
lines = [
" = ".join([key, json.dumps(value).replace("[", "{").replace("]", "}")])
if key != "safe"
else "\n".join(value)
(
" = ".join([key, json.dumps(value).replace("[", "{").replace("]", "}")])
if key != "safe"
else "\n".join(value)
)
for key, value in self.param.items()
]
with open(fitted_mtp, "w") as f:
Expand Down
1 change: 1 addition & 0 deletions maml/apps/symbolic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Symbolic learning."""

from __future__ import annotations

try:
Expand Down
1 change: 1 addition & 0 deletions maml/apps/symbolic/_feature_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Feature Generator."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions maml/apps/symbolic/_selectors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Selectors."""

from __future__ import annotations

import inspect
Expand Down
1 change: 1 addition & 0 deletions maml/apps/symbolic/_selectors_cvxpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module implements more robust optimization
using the cvxpy package.
"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions maml/apps/symbolic/_sis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/base/_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MAML data base classes."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions maml/base/_describer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MAML describers base classes."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions maml/base/_feature_batch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Batch a list of features output by describers.transform method."""

from __future__ import annotations

from typing import Any, Callable
Expand Down
1 change: 1 addition & 0 deletions maml/base/_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Model mixins."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions maml/base/_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MAML models base classes."""

from __future__ import annotations

from typing import Callable
Expand Down
1 change: 1 addition & 0 deletions maml/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Get data from various sources."""

from __future__ import annotations

from ._mp import MaterialsProject
Expand Down
1 change: 1 addition & 0 deletions maml/data/_mp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Materials Project DataSource."""

from __future__ import annotations

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions maml/data/_url.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Get data from url."""

from __future__ import annotations

from io import StringIO
Expand Down
1 change: 1 addition & 0 deletions maml/describers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Describer for converting (structural) objects into models-readable
numeric vectors or tensors.
"""

from __future__ import annotations

from ._composition import ElementProperty, ElementStats
Expand Down
1 change: 1 addition & 0 deletions maml/describers/_composition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compositional describers."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions maml/describers/_matminer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wrapper for matminer_wrapper featurizers."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/describers/_megnet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MEGNet-based describers."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions maml/describers/_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Radial distribution functions for site features.
This was originally written in pymatgen-diffusion.
"""

from __future__ import annotations

from math import ceil
Expand Down
1 change: 1 addition & 0 deletions maml/describers/_site.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module provides local environment describers."""

from __future__ import annotations

import itertools
Expand Down
2 changes: 2 additions & 0 deletions maml/describers/_structure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Structure-wise describers. These describers include structural information."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -46,6 +47,7 @@ class DistinctSiteProperty(BaseDescriber):
year={2018},
publisher={Nature Publishing Group}}
"""

# todo: generalize to multiple sites with the same Wyckoff.
supported_properties = [
"mendeleev_no",
Expand Down
1 change: 1 addition & 0 deletions maml/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MAML models."""

from __future__ import annotations

from maml.base import KerasModel, SKLModel
Expand Down
1 change: 1 addition & 0 deletions maml/models/dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deep learning module."""

from __future__ import annotations

from ._atomsets import AtomSets
Expand Down
1 change: 1 addition & 0 deletions maml/models/dl/_atomsets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""neural network models."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions maml/models/dl/_keras_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Keras utils for deserialize activations and otpimizers."""

from __future__ import annotations


Expand Down
1 change: 1 addition & 0 deletions maml/models/dl/_layers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deep learning layers."""

from __future__ import annotations

from typing import Sequence
Expand Down
1 change: 1 addition & 0 deletions maml/models/dl/_mlp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Multi-layer perceptron models."""

from __future__ import annotations

from maml.base import BaseDescriber, KerasModel
Expand Down
1 change: 1 addition & 0 deletions maml/sampling/clustering.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Clustering methods."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/sampling/stratified_sampling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of stratefied sampling approaches."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities package."""

from __future__ import annotations

from ._data_conversion import convert_docs, pool_from, to_array
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_data_conversion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convert data list to docs or pool existing data lists for training."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_data_split.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Data split."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_dummy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dummy test systems."""

from __future__ import annotations

from pymatgen.core import Composition, Lattice, Molecule, Structure
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_inspect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Inspect function args."""

from __future__ import annotations

from inspect import signature
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Simple numba utility.
Some functions can excelerated substantially with numba.
"""

from __future__ import annotations

from typing import Callable
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_lammps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""LAMMPS utility."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_material.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Materials utils."""

from __future__ import annotations

from pymatgen.core import Composition, Molecule, Structure
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Target preprocessing."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_signal_processing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Signal processing utils."""

from __future__ import annotations

from math import ceil, floor
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils for describers."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Temporary directory and file creation utilities.
This file is adapted from monty.tempfile.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define several typing for convenient use."""

from __future__ import annotations

from typing import Any, Callable, List, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions maml/utils/_value_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
a sinusoidal profile or a constant profile, depending on the
step, and previous values.
"""

from __future__ import annotations

import numpy as np
Expand Down
Loading

0 comments on commit e0612af

Please sign in to comment.