-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a474932
commit de13097
Showing
42 changed files
with
210 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ select = ["ALL"] | |
ignore = [ | ||
"ANN101", | ||
"ANN102", | ||
"ANN401", | ||
"COM812", | ||
"ISC001", | ||
"FBT001", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/stko/_internal/molecular/molecule_modifiers/molecule_splitter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import logging | ||
from collections import abc | ||
from itertools import combinations | ||
|
||
import stk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
from dataclasses import dataclass | ||
|
||
import stk | ||
|
||
|
||
@dataclass(frozen=True, slots=True) | ||
class CaseData: | ||
def __init__( | ||
self, | ||
molecule: stk.Molecule, | ||
metal_atom_distances: dict[tuple[int, int], float], | ||
metal_centroid_angles: dict[tuple[int, int], float], | ||
min_centoid_distance: float, | ||
avg_centoid_distance: tuple[float, float], | ||
radius_gyration: float, | ||
min_atom_atom_distance: float, | ||
max_diameter: float, | ||
bonds: dict[tuple[str, str], list[float]], | ||
angles: dict[tuple[str, str, str], list[float]], | ||
torsions: dict[tuple[str, str, str, str], list[float]], | ||
name: str, | ||
) -> None: | ||
self.molecule = molecule | ||
self.metal_atom_distances = metal_atom_distances | ||
self.metal_centroid_angles = metal_centroid_angles | ||
self.min_centoid_distance = min_centoid_distance | ||
self.avg_centoid_distance = avg_centoid_distance | ||
self.radius_gyration = radius_gyration | ||
self.min_atom_atom_distance = min_atom_atom_distance | ||
self.max_diameter = max_diameter | ||
self.bonds = bonds | ||
self.angles = angles | ||
self.torsions = torsions | ||
self.name = name | ||
molecule: stk.Molecule | ||
metal_atom_distances: dict[tuple[int, int], float] | ||
metal_centroid_angles: dict[tuple[int, int], float] | ||
min_centoid_distance: float | ||
avg_centoid_distance: tuple[float, float] | ||
radius_gyration: float | ||
min_atom_atom_distance: float | ||
max_diameter: float | ||
bonds: dict[tuple[str, str], list[float]] | ||
angles: dict[tuple[str, str, str], list[float]] | ||
torsions: dict[tuple[str, str, str, str], list[float]] | ||
name: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 2 additions & 9 deletions
11
tests/calculators/geometry/test_get_avg_centroid_distance.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import numpy as np | ||
import stko | ||
|
||
from .case_data import CaseData | ||
|
||
def test_get_max_diameter(case_data): | ||
"""Test :class:`.GeometryAnalyser.get_max_diameter`. | ||
|
||
Parameters | ||
---------- | ||
case_data: | ||
A test case. | ||
""" | ||
def test_get_max_diameter(case_data: CaseData) -> None: | ||
analyser = stko.molecule_analysis.GeometryAnalyser() | ||
|
||
result = analyser.get_max_diameter(case_data.molecule) | ||
print(result) | ||
assert np.isclose(result, case_data.max_diameter, atol=1e-3, rtol=0) |
12 changes: 2 additions & 10 deletions
12
tests/calculators/geometry/test_get_metal_centroid_metal_angle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
import numpy as np | ||
import stko | ||
|
||
from .case_data import CaseData | ||
|
||
def test_get_metal_centroid_metal_angle(case_data): | ||
"""Test :class:`.GeometryAnalyser.get_metal_centroid_metal_angle`. | ||
|
||
Parameters | ||
---------- | ||
case_data: | ||
A test case. | ||
""" | ||
def test_get_metal_centroid_metal_angle(case_data: CaseData) -> None: | ||
analyser = stko.molecule_analysis.GeometryAnalyser() | ||
|
||
result = analyser.get_metal_centroid_metal_angle( | ||
case_data.molecule, | ||
metal_atom_nos=(26, 46), | ||
) | ||
print(result) | ||
assert len(result) == len(case_data.metal_centroid_angles) | ||
for i in result: | ||
print(i, result[i]) | ||
assert np.isclose( | ||
result[i], case_data.metal_centroid_angles[i], atol=1e-3, rtol=0 | ||
) |
Oops, something went wrong.