def dtype_to_descr(dtype):
if dtype.names is not None:<EOL><INDENT>return dtype.descr<EOL><DEDENT>else:<EOL><INDENT>return dtype.str<EOL><DEDENT>
Get a serializable descriptor from the dtype.

The .descr attribute of a dtype object cannot be round-tripped through
the dtype() constructor. Simple types, like dtype('float32'), have
a descr which looks like a record array with one field with '' as
a name. The dtype() constructor interprets this as a request to give
a default name.  Instead, we construct descriptor that can be passed to
dtype().

Parameters
----------
dtype : dtype
    The dtype of the array that will be written to disk.

Returns
-------
descr : object
    An object that can be passed to `numpy.dtype()` in order to
    replicate the input dtype.