Skip to content

Commit

Permalink
Remove use of numpy.dual
Browse files Browse the repository at this point in the history
It was removed in the most recent version of numpy. We must use
it from the `linalg` module instead.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
  • Loading branch information
psavery committed Oct 18, 2023
1 parent 77923b1 commit f502cd7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hexrd/xrdutil/phutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from concurrent.futures import ThreadPoolExecutor

import numpy as np
import numpy.dual

from hexrd import constants as ct
from hexrd.instrument import Detector
Expand Down Expand Up @@ -366,9 +365,9 @@ def azimuth(vv, v0, v1):
"""
with np.errstate(divide='ignore', invalid='ignore'):
n0 = np.cross(v0, v1)
n0 /= np.dual.norm(n0, axis=-1)[..., np.newaxis]
n0 /= np.linalg.norm(n0, axis=-1)[..., np.newaxis]
nn = np.cross(v0, vv)
nn /= np.dual.norm(nn, axis=-1)[..., np.newaxis]
nn /= np.linalg.norm(nn, axis=-1)[..., np.newaxis]

azi = np.arccos(np.sum(nn * n0, -1))
if len(np.shape(azi)) > 0:
Expand Down

0 comments on commit f502cd7

Please sign in to comment.