Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion spharpy/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,13 @@ def legendre_function(n, m, z, cs_phase=True):
"""
z = np.atleast_1d(z)

if m == 0:
legendre = _spspecial.eval_legendre(n, z) # This is reliable
else:
# squeeze required because the legendre function introduced in scipy 1.15
# returns a 2D array, whereas the previous function `lpmn` returned a 1D
# array
Comment on lines 398 to 400
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# squeeze required because the legendre function introduced in scipy 1.15
# returns a 2D array, whereas the previous function `lpmn` returned a 1D
# array
# squeeze required because the legendre function introduced in scipy 1.15
# returns a 2D array, whereas the previous function `lpmn` returned a 1D
# array

legendre = np.squeeze(_spspecial.assoc_legendre_p(n, m, z))
legendre = np.squeeze(_spspecial.assoc_legendre_p(n, m, z))

# remove Condon-Shortley phase
if not cs_phase and m % 2:
Expand Down
Loading