Skip to content

Commit

Permalink
Update _zmoments.py
Browse files Browse the repository at this point in the history
make input and output types consistent
  • Loading branch information
jiadongdan committed Sep 20, 2024
1 parent a19cc14 commit 0e31338
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mtflearn/features/_zmoments.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ def nm2j(n, m):
# Compute `j`
j = ((n + 2) * n + m) // 2

return j
# Return scalar if inputs are scalars
if j.shape == ():
return j.item()
else:
return j


def nm2j_complex(n, m):
Expand Down

0 comments on commit 0e31338

Please sign in to comment.