bluesky / hklpy

Diffractometer computation library with ophyd pseudopositioner support
https://blueskyproject.io/hklpy
BSD 3-Clause "New" or "Revised" License
3 stars 11 forks source link

ValueError in `restore_UB` #217

Open gfabbris opened 2 years ago

gfabbris commented 2 years ago

The problem seems to be the comparison between matrix:

In [16]: restore_UB(ori["fourc"], fourc)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [16], in <cell line: 1>()
----> 1 restore_UB(ori["fourc"], fourc)

File ~/.conda/envs/bluesky_2022_2/lib/python3.9/site-packages/hkl/util.py:483, in restore_UB(orientation, diffractometer)
    471 """
    472 Restore **UB** matrix from orientation information.
    473 
   (...)
    480     Diffractometer object.
    481 """
    482 _check_geometry(orientation, diffractometer)
--> 483 _smart_signal_update(orientation["UB"], diffractometer.UB)

File ~/.conda/envs/bluesky_2022_2/lib/python3.9/site-packages/hkl/util.py:315, in _smart_signal_update(value, signal)
    313 def _smart_signal_update(value, signal):
    314     """Write value to signal if not equal.  Not a plan."""
--> 315     if signal.get() != value:
    316         signal.put(value)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()