Skip to content

Commit b662715

Browse files
author
Shyue Ping Ong
committed
Merge branch 'master' of github.com:materialsproject/pymatgen
2 parents 8b14c22 + 31c9088 commit b662715

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+993
-627
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
tests/files/**/* linguist-vendored
33
cmd_line/* linguist-vendored
44
docs/**/* linguist-generated
5-
docs_rst/**/* linguist-documentation
65
dev_scripts/**/* linguist-vendored

docs/compatibility.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymatgen/alchemy/materials.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ def to_snl(self, authors, **kwargs) -> StructureNL:
335335
336336
:param authors: List of authors
337337
:param **kwargs: All kwargs supported by StructureNL.
338-
:return: StructureNL
338+
339+
Returns:
340+
StructureNL
339341
"""
340342
if self.other_parameters:
341343
warn("Data in TransformedStructure.other_parameters discarded during type conversion to SNL")

pymatgen/analysis/chemenv/connectivity/connected_components.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ def from_dict(cls, d):
846846
847847
Args:
848848
d (dict): dict representation of the ConnectedComponent object
849+
849850
Returns:
850851
ConnectedComponent: The connected component representing the links of a given set of environments.
851852
"""

pymatgen/analysis/chemenv/connectivity/connectivity_finder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def get_structure_connectivity(self, light_structure_environments):
3737
3838
:param light_structure_environments: LightStructureEnvironments with the
3939
relevant coordination environments in the structure
40-
:return: a StructureConnectivity object describing the connectivity of
40+
41+
Returns:
42+
a StructureConnectivity object describing the connectivity of
4143
the environments in the structure
4244
"""
4345
logging.info("Setup of structure connectivity graph")

pymatgen/analysis/chemenv/coordination_environments/chemenv_strategies.py

Lines changed: 166 additions & 77 deletions
Large diffs are not rendered by default.

pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ def __init__(
152152
def __str__(self):
153153
"""
154154
String representation of the AbstractGeometry
155-
:return: String representation of the AbstractGeometry.
155+
156+
Returns:
157+
String representation of the AbstractGeometry.
156158
"""
157159
outs = [f"\nAbstract Geometry with {len(self.coords)} points :"]
158160
for pp in self.coords:
@@ -284,7 +286,8 @@ def symmetry_measure(points_distorted, points_perfect):
284286
has to be computed with respect to the model polyhedron described by the list of points
285287
"points_perfect".
286288
:param points_perfect: List of "perfect" points describing a given model polyhedron.
287-
:return: The continuous symmetry measure of the distorted polyhedron with respect to the perfect polyhedron.
289+
Returns:
290+
The continuous symmetry measure of the distorted polyhedron with respect to the perfect polyhedron.
288291
"""
289292
# When there is only one point, the symmetry measure is 0.0 by definition
290293
if len(points_distorted) == 1:
@@ -315,7 +318,8 @@ def find_rotation(points_distorted, points_perfect):
315318
:param points_distorted: List of points describing a given (distorted) polyhedron for which the rotation that
316319
aligns these points in a least-square sense to the set of perfect points "points_perfect"
317320
:param points_perfect: List of "perfect" points describing a given model polyhedron.
318-
:return: The rotation matrix.
321+
Returns:
322+
The rotation matrix.
319323
"""
320324
H = np.matmul(points_distorted.T, points_perfect)
321325
U, S, Vt = svd(H)
@@ -330,7 +334,9 @@ def find_scaling_factor(points_distorted, points_perfect, rot):
330334
to be obtained.
331335
:param points_perfect: List of "perfect" points describing a given model polyhedron.
332336
:param rot: The rotation matrix
333-
:return: The scaling factor between the two structures and the rotated set of (distorted) points.
337+
338+
Returns:
339+
The scaling factor between the two structures and the rotated set of (distorted) points.
334340
"""
335341
rotated_coords = np.matmul(rot, points_distorted.T).T
336342
num = np.tensordot(rotated_coords, points_perfect)
@@ -469,7 +475,8 @@ def get_structure(self):
469475
"""
470476
Returns the pymatgen Structure that has been setup for the identification of geometries (the initial one
471477
might have been refined/symmetrized using the SpaceGroupAnalyzer).
472-
:return: The pymatgen Structure that has been setup for the identification of geometries (the initial one
478+
Returns:
479+
The pymatgen Structure that has been setup for the identification of geometries (the initial one
473480
might have been refined/symmetrized using the SpaceGroupAnalyzer).
474481
"""
475482
return self.structure
@@ -583,7 +590,9 @@ def compute_structure_environments(
583590
:param recompute: whether to recompute the sites already computed (when initial_structure_environments
584591
is not None)
585592
:param optimization: optimization algorithm
586-
:return: The StructureEnvironments object containing all the information about the coordination
593+
594+
Returns:
595+
The StructureEnvironments object containing all the information about the coordination
587596
environments in the structure.
588597
"""
589598
time_init = time.process_time()
@@ -1121,7 +1130,8 @@ def setup_explicit_indices_local_geometry(self, explicit_indices):
11211130
def get_coordination_symmetry_measures(self, only_minimum=True, all_csms=True, optimization=None):
11221131
"""
11231132
Returns the continuous symmetry measures of the current local geometry in a dictionary.
1124-
:return: the continuous symmetry measures of the current local geometry in a dictionary.
1133+
Returns:
1134+
the continuous symmetry measures of the current local geometry in a dictionary.
11251135
"""
11261136
test_geometries = self.allcg.get_implemented_geometries(len(self.local_geometry.coords))
11271137
if len(self.local_geometry.coords) == 1:
@@ -1249,7 +1259,8 @@ def get_coordination_symmetry_measures_optim(
12491259
):
12501260
"""
12511261
Returns the continuous symmetry measures of the current local geometry in a dictionary.
1252-
:return: the continuous symmetry measures of the current local geometry in a dictionary.
1262+
Returns:
1263+
the continuous symmetry measures of the current local geometry in a dictionary.
12531264
"""
12541265
cn = len(self.local_geometry.coords)
12551266
test_geometries = self.allcg.get_implemented_geometries(cn)
@@ -1309,7 +1320,9 @@ def coordination_geometry_symmetry_measures(
13091320
the permutation setup. Depending on the parameters of the LocalGeometryFinder and on the coordination
13101321
geometry, different methods are called.
13111322
:param coordination_geometry: Coordination geometry for which the symmetry measures are looked for
1312-
:return: the symmetry measures of a given coordination_geometry for a set of permutations
1323+
1324+
Returns:
1325+
the symmetry measures of a given coordination_geometry for a set of permutations
13131326
:raise: NotImplementedError if the permutation_setup does not exists.
13141327
"""
13151328
if tested_permutations:
@@ -1353,7 +1366,9 @@ def coordination_geometry_symmetry_measures_sepplane_optim(
13531366
the permutation setup. Depending on the parameters of the LocalGeometryFinder and on the coordination
13541367
geometry, different methods are called.
13551368
:param coordination_geometry: Coordination geometry for which the symmetry measures are looked for
1356-
:return: the symmetry measures of a given coordination_geometry for a set of permutations
1369+
1370+
Returns:
1371+
the symmetry measures of a given coordination_geometry for a set of permutations
13571372
:raise: NotImplementedError if the permutation_setup does not exists.
13581373
"""
13591374
csms = []
@@ -1387,7 +1402,9 @@ def coordination_geometry_symmetry_measures_standard(
13871402
for the coordination geometry "coordination_geometry". Standard implementation looking for the symmetry
13881403
measures of each permutation
13891404
:param coordination_geometry: The coordination geometry to be investigated
1390-
:return: The symmetry measures for the given coordination geometry for each permutation investigated.
1405+
1406+
Returns:
1407+
The symmetry measures for the given coordination geometry for each permutation investigated.
13911408
"""
13921409
# permutations_symmetry_measures = np.zeros(len(algo.permutations),
13931410
# np.float_)
@@ -1464,7 +1481,9 @@ def coordination_geometry_symmetry_measures_separation_plane(
14641481
Returns the symmetry measures of the given coordination geometry "coordination_geometry" using separation
14651482
facets to reduce the complexity of the system. Caller to the refined 2POINTS, 3POINTS and other ...
14661483
:param coordination_geometry: The coordination geometry to be investigated
1467-
:return: The symmetry measures for the given coordination geometry for each plane and permutation investigated.
1484+
1485+
Returns:
1486+
The symmetry measures for the given coordination geometry for each plane and permutation investigated.
14681487
"""
14691488
permutations = []
14701489
permutations_symmetry_measures = []
@@ -1988,7 +2007,9 @@ def coordination_geometry_symmetry_measures_fallback_random(
19882007
of each permutation
19892008
:param coordination_geometry: The coordination geometry to be investigated
19902009
:param NRANDOM: Number of random permutations to be tested
1991-
:return: The symmetry measures for the given coordination geometry for each permutation investigated.
2010+
2011+
Returns:
2012+
The symmetry measures for the given coordination geometry for each permutation investigated.
19922013
"""
19932014
permutations_symmetry_measures = [None] * NRANDOM
19942015
permutations = []

0 commit comments

Comments
 (0)