Skip to content

Commit

Permalink
Merge branch 'master' into type-lobsterenv-outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Jul 2, 2024
2 parents 290a8ab + d77f776 commit 552620e
Show file tree
Hide file tree
Showing 451 changed files with 309 additions and 359 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
ruff format --check .
- name: mypy
run: mypy ${{ github.event.repository.name }}
run: mypy src

- name: pyright
run: pyright
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.5.0
hooks:
- id: ruff
args: [ --fix, --unsafe-fixes ]
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ feff_plot_dos = "pymatgen.cli.feff_plot_dos:main"
get_environment = "pymatgen.cli.get_environment:main"

[tool.setuptools.packages.find]
where = ["."]
include = ["pymatgen.*"]
where = ["src"]
include = ["pymatgen"]

[tool.setuptools.package-data]
"pymatgen.analysis" = ["*.yaml", "*.json", "*.csv"]
Expand Down Expand Up @@ -247,9 +247,8 @@ docstring-code-format = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**" = ["ANN201", "D", "PLR0124"]
"tasks.py" = ["D"]
"pymatgen/analysis/*" = ["D"]
"pymatgen/io/*" = ["D"]
"src/pymatgen/analysis/*" = ["D"]
"src/pymatgen/io/*" = ["D"]
"dev_scripts/*" = ["D"]

[tool.pytest.ini_options]
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
ext_modules=[
Extension(
"pymatgen.optimization.linear_assignment",
["pymatgen/optimization/linear_assignment.pyx"],
["src/pymatgen/optimization/linear_assignment.pyx"],
extra_link_args=extra_link_args,
),
Extension(
"pymatgen.util.coord_cython",
["pymatgen/util/coord_cython.pyx"],
["src/pymatgen/util/coord_cython.pyx"],
extra_link_args=extra_link_args,
),
Extension(
"pymatgen.optimization.neighbors",
["pymatgen/optimization/neighbors.pyx"],
["src/pymatgen/optimization/neighbors.pyx"],
extra_link_args=extra_link_args,
),
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ def show_graph(
If not provided, the graph is not saved.
drawing_type (str): The type of drawing to use. Can be "internal" or "external".
"""

shown_graph = self._connected_subgraph if graph is None else graph

plt.figure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def get_site_coordination_environments_fractions(
def get_site_ce_fractions_and_neighbors(self, site, full_ce_info=False, strategy_info=False):
"""
Applies the strategy to the structure_environments object in order to get coordination environments, their
fraction, csm, geometry_info, and neighbors
fraction, csm, geometry_info, and neighbors.
Args:
site: Site for which the above information is sought
Expand Down Expand Up @@ -458,7 +458,7 @@ def setup_options(self, all_options_dict):
@abc.abstractmethod
def __eq__(self, other: object) -> bool:
"""
Equality method that should be implemented for any strategy
Equality method that should be implemented for any strategy.
Args:
other: strategy to be compared with the current one
Expand Down Expand Up @@ -1122,7 +1122,6 @@ def __init__(
max_csm:
symmetry_measure_type:
"""

raise NotImplementedError("TargetedPenaltiedAbundanceChemenvStrategy not yet implemented")

super().__init__(
Expand Down Expand Up @@ -1587,6 +1586,7 @@ def get_effective_csm(
symmetry_measure_type: Type of symmetry measure to be used in the effective CSM.
max_effective_csm: Max CSM to use for the effective CSM calculation.
effective_csm_estimator_ratio_function: Ratio function to use to compute effective CSM.
Returns:
Effective CSM of a given Neighbors set.
"""
Expand Down Expand Up @@ -1951,9 +1951,7 @@ def delta_cn_specifics(
)

def as_dict(self):
"""
MSONable dict.
"""
"""MSONable dict."""
return {
"@module": type(self).__module__,
"@class": type(self).__name__,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ def as_dict(self):

@classmethod
def from_dict(cls, dct: dict) -> Self:
"""
Reconstruct ExplicitPermutationsAlgorithm from its JSON-serializable dict representation.
"""
"""Reconstruct ExplicitPermutationsAlgorithm from its JSON-serializable dict representation."""
return cls(dct["permutations"])


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
optimization=None,
):
"""
Constructor for the abstract geometry
Constructor for the abstract geometry.
Args:
central_site: Coordinates of the central site
Expand Down Expand Up @@ -159,7 +159,7 @@ def __init__(
self.bare_coords = self._bare_coords

def __str__(self):
"""String representation of the AbstractGeometry
"""String representation of the AbstractGeometry.
Returns:
str: String representation of the AbstractGeometry.
Expand Down Expand Up @@ -277,12 +277,12 @@ def points_wocs_ctwocc(self, permutation=None):

@property
def cn(self):
"""Coordination number"""
"""Coordination number."""
return len(self.coords)

@property
def coordination_number(self):
"""Coordination number"""
"""Coordination number."""
return len(self.coords)


Expand Down Expand Up @@ -453,7 +453,7 @@ def setup_parameters(

def setup_parameter(self, parameter, value):
"""Setup of one specific parameter to the given value. The other parameters are unchanged. See setup_parameters
method for the list of possible parameters
method for the list of possible parameters.
Args:
parameter: Parameter to setup/update
Expand All @@ -463,7 +463,7 @@ def setup_parameter(self, parameter, value):

def setup_structure(self, structure: Structure):
"""Set up the structure for which the coordination geometries have to be identified. The structure is analyzed
with the space group analyzer and a refined structure is used
with the space group analyzer and a refined structure is used.
Args:
structure: A pymatgen Structure.
Expand Down Expand Up @@ -502,7 +502,7 @@ def get_structure(self):

def set_structure(self, lattice: Lattice, species, coords, coords_are_cartesian):
"""Set up the pymatgen structure for which the coordination geometries have to be identified starting from the
lattice, the species and the coordinates
lattice, the species and the coordinates.
Args:
lattice: The lattice of the structure
Expand Down Expand Up @@ -580,7 +580,7 @@ def compute_structure_environments(
optimization=PRESETS["DEFAULT"]["optimization"],
):
"""Compute and returns the StructureEnvironments object containing all the information
about the coordination environments in the structure
about the coordination environments in the structure.
Args:
excluded_atoms: Atoms for which the coordination geometries does not have to be identified
Expand Down Expand Up @@ -1123,7 +1123,7 @@ def setup_random_structure(self, coordination):
self.setup_random_indices_local_geometry(coordination)

def setup_random_indices_local_geometry(self, coordination):
"""Set up random indices for the local geometry, for testing purposes
"""Set up random indices for the local geometry, for testing purposes.
Args:
coordination: coordination of the local geometry.
Expand All @@ -1133,7 +1133,7 @@ def setup_random_indices_local_geometry(self, coordination):
np.random.shuffle(self.indices)

def setup_ordered_indices_local_geometry(self, coordination):
"""Set up ordered indices for the local geometry, for testing purposes
"""Set up ordered indices for the local geometry, for testing purposes.
Args:
coordination: coordination of the local geometry.
Expand All @@ -1142,7 +1142,7 @@ def setup_ordered_indices_local_geometry(self, coordination):
self.indices = list(range(1, coordination + 1))

def setup_explicit_indices_local_geometry(self, explicit_indices):
"""Set up explicit indices for the local geometry, for testing purposes
"""Set up explicit indices for the local geometry, for testing purposes.
Args:
explicit_indices: explicit indices for the neighbors (set of numbers
Expand Down Expand Up @@ -1428,7 +1428,7 @@ def coordination_geometry_symmetry_measures_standard(
):
"""Get the symmetry measures for a set of permutations (whose setup depends on the coordination geometry)
for the coordination geometry "coordination_geometry". Standard implementation looking for the symmetry
measures of each permutation
measures of each permutation.
Args:
coordination_geometry: The coordination geometry to be investigated
Expand Down Expand Up @@ -2032,7 +2032,7 @@ def coordination_geometry_symmetry_measures_fallback_random(
):
"""Get the symmetry measures for a random set of permutations for the coordination geometry
"coordination_geometry". Fallback implementation for the plane separation algorithms measures
of each permutation
of each permutation.
Args:
coordination_geometry: The coordination geometry to be investigated
Expand Down
File renamed without changes.
Loading

0 comments on commit 552620e

Please sign in to comment.