hexrd.utils.yaml module

class hexrd.utils.yaml.NumpyToNativeDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]

Bases: SafeDumper

Change Numpy types to native types during YAML encoding

This inherits from yaml.SafeDumper so that anything that is not converted to a basic type will raise an error.

For instance, np.float128 will raise an error, since it cannot be converted to a basic type.

represent_data(data)[source]