The property MrcObject.extended_header may return None, or values of type np.recarray or np.ndarray. In contrast to python lists, np.ndarray is not truthy, so comparison with any np.ndarray will raise exceptions. In order to circumvent, we ensure that the result of MRCReader.get_mrc_extended_header() is a np.array and then convert to a python list that enables truthy/falsy comparison.
Covers the following cases:
do set extended header on filled np.ndarray > np.array(val: np.ndarray).tolist() -> list
do set extended header on filled np.recarray > np.array(val: np.recarray).tolist() -> list
Relates to
166
Description
The property
MrcObject.extended_header
may returnNone
, or values of typenp.recarray
ornp.ndarray
. In contrast to python lists,np.ndarray
is not truthy, so comparison with anynp.ndarray
will raise exceptions. In order to circumvent, we ensure that the result ofMRCReader.get_mrc_extended_header()
is a np.array and then convert to a python list that enables truthy/falsy comparison.Covers the following cases:
np.ndarray
>np.array(val: np.ndarray).tolist() -> list
np.recarray
>np.array(val: np.recarray).tolist() -> list
np.ndarray
>np.array(np.empty(0)).tolist() == []
None
>np.array(None).tolist() == None