A place for code to be called from the implementation of np.dtype
String handling is much easier to do correctly in python.
Function | __repr__ |
Undocumented |
Function | __str__ |
Undocumented |
Function | _byte_order_str |
Normalize byteorder to '<' or '>' |
Function | _construction_repr |
No summary |
Function | _datetime_metadata_str |
Undocumented |
Function | _is_packed |
Checks whether the structured data type in 'dtype' has a simple layout, where all the fields are in order, and follow each other with no alignment padding. |
Function | _isunsized |
Undocumented |
Function | _kind_name |
Undocumented |
Function | _name_get |
Undocumented |
Function | _name_includes_bit_suffix |
Undocumented |
Function | _scalar_str |
Undocumented |
Function | _struct_dict_str |
Undocumented |
Function | _struct_list_str |
Undocumented |
Function | _struct_str |
Undocumented |
Function | _subarray_str |
Undocumented |
Function | _unpack_field |
Helper function to normalize the items in dtype.fields. |
Variable | _kind_to_stem |
Undocumented |
Creates a string repr of the dtype, excluding the 'dtype()' part surrounding the object. This object may be a string, a list, or a dict depending on the nature of the dtype. This is the object passed as the first parameter to the dtype constructor, and if no additional constructor parameters are given, will reproduce the exact memory layout.
If true, this includes the 'align=True' parameter inside the struct dtype construction dict when needed. Use this flag if you want a proper repr string without the 'dtype()' part around it.
If false, this does not preserve the 'align=True' parameter or sticky NPY_ALIGNED_STRUCT flag for struct arrays like the regular repr does, because the 'align' flag is not part of first dtype constructor parameter. This mode is intended for a full 'repr', where the 'align=True' is provided as the second parameter.
Checks whether the structured data type in 'dtype' has a simple layout, where all the fields are in order, and follow each other with no alignment padding.
When this returns true, the dtype can be reconstructed from a list of the field names and dtypes with no additional dtype parameters.
Duplicates the C is_dtype_struct_simple_unaligned_layout
function.
Helper function to normalize the items in dtype.fields.
Call as:
dtype, offset, title = _unpack_field(*dtype.fields[name])