Is there a more elegant way to get the corresponding real numpy dtype for a possibly complex dtype than the following?
import numpy as np
def dtype_to_real(rvs_dtype: np.dtype[Any]) -> np.dtype[Any]:
return np.empty(0, dtype=rvs_dtype).real.dtype