Skip to content

Commit 1d8136f

Browse files
Rename sph_harm to sph_harm_y (#413)
* Rename sph_harm to sph_harm_y * fix order * another fix * increase lower bound * update minimal python version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1c1fc14 commit 1d8136f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.ci_support/environment-old.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- pymatgen =2022.2.1
1212
- pyscal3 =3.2.5
1313
- scikit-learn =1.2.1
14-
- scipy =1.9.3
14+
- scipy =1.15.0
1515
- spglib =1.16.5
1616
- sqsgenerator =0.2
1717
- hatchling =1.27.0

structuretoolkit/analyse/neighbors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from scipy.sparse import coo_matrix
1010
from scipy.spatial import cKDTree
1111
from scipy.spatial.transform import Rotation
12-
from scipy.special import gamma, sph_harm
12+
from scipy.special import gamma, sph_harm_y
1313

1414
from structuretoolkit.common.helper import (
1515
get_average_of_unique_labels,
@@ -667,7 +667,7 @@ def get_spherical_harmonics(
667667
The angles are calculated based on `self.vecs`, where the azimuthal angle is defined on the
668668
xy-plane and the polar angle is along the z-axis.
669669
670-
See more on: scipy.special.sph_harm
670+
See more on: scipy.special.sph_harm_y
671671
672672
"""
673673
vecs = self.filled.vecs
@@ -684,7 +684,7 @@ def get_spherical_harmonics(
684684
phi[within_cutoff] = np.arctan2(
685685
np.linalg.norm(vecs[within_cutoff, :2], axis=-1), vecs[within_cutoff, 2]
686686
)
687-
return np.sum(sph_harm(m, l, theta, phi) * within_cutoff, axis=-1) / np.sum(
687+
return np.sum(sph_harm_y(l, m, phi, theta) * within_cutoff, axis=-1) / np.sum(
688688
within_cutoff, axis=-1
689689
)
690690

0 commit comments

Comments
 (0)