module documentation

A place for internal code

Some things are more easily handled Python.

Class dummy_ctype Undocumented
Function array_function_errmsg_formatter Format the error message for when __array_ufunc__ gives up.
Function array_ufunc_errmsg_formatter Format the error message for when __array_ufunc__ gives up.
Function npy_ctypes_check Undocumented
Constant IS_PYPY Undocumented
Variable format_re Undocumented
Variable sep_re Undocumented
Variable space_re Undocumented
Class _ctypes No class docstring; 4/4 properties, 0/4 instance variable, 7/8 methods documented
Class _missing_ctypes Undocumented
Class _Stream Undocumented
Function __dtype_from_pep3118 Undocumented
Function _add_trailing_padding Inject the specified number of padding bytes at the end of a dtype
Function _array_descr Undocumented
Function _commastring Undocumented
Function _copy_fields Return copy of structured array with padding between fields removed.
Function _dtype_from_pep3118 Undocumented
Function _fix_names Replace names which are None with the next unused f%d name
Function _gcd Calculate the greatest common divisor of a and b
Function _getfield_is_safe Checks safety of getfield for object arrays.
Function _getintp_ctype Undocumented
Function _lcm Undocumented
Function _makenames_list Undocumented
Function _newnames Given a datatype and an order object, return a new names tuple, with the order indicated
Function _prod Undocumented
Function _promote_fields Perform type promotion for two structured dtypes.
Function _reconstruct Undocumented
Function _ufunc_doc_signature_formatter Builds a signature string which resembles PEP 457
Function _usefields Undocumented
Function _view_is_safe Checks safety of a view involving object arrays, for example when doing:
Variable _convorder Undocumented
Variable _nbo Undocumented
Variable _pep3118_native_map Undocumented
Variable _pep3118_native_typechars Undocumented
Variable _pep3118_standard_map Undocumented
Variable _pep3118_standard_typechars Undocumented
Variable _pep3118_unsupported_map Undocumented
def array_function_errmsg_formatter(public_api, types): (source)

Format the error message for when __array_ufunc__ gives up.

def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs): (source)

Format the error message for when __array_ufunc__ gives up.

def npy_ctypes_check(cls): (source)

Undocumented

Undocumented

Value
(sys.implementation.name == 'pypy')
format_re = (source)

Undocumented

Undocumented

space_re = (source)

Undocumented

def __dtype_from_pep3118(stream, is_subdtype): (source)

Undocumented

def _add_trailing_padding(value, padding): (source)

Inject the specified number of padding bytes at the end of a dtype

def _array_descr(descriptor): (source)

Undocumented

def _commastring(astr): (source)

Undocumented

def _copy_fields(ary): (source)

Return copy of structured array with padding between fields removed.

Parameters
ary:ndarrayStructured array from which to remove padding bytes
Returns
ndarrayary_copy - Copy of ary with padding bytes removed
def _dtype_from_pep3118(spec): (source)

Undocumented

def _fix_names(field_spec): (source)

Replace names which are None with the next unused f%d name

def _gcd(a, b): (source)

Calculate the greatest common divisor of a and b

def _getfield_is_safe(oldtype, newtype, offset): (source)

Checks safety of getfield for object arrays.

As in _view_is_safe, we need to check that memory containing objects is not reinterpreted as a non-object datatype and vice versa.

Parameters
oldtype:data-typeData type of the original ndarray.
newtype:data-typeData type of the field being accessed by ndarray.getfield
offset:intOffset of the field being accessed by ndarray.getfield
Raises
TypeErrorIf the field access is invalid
def _getintp_ctype(): (source)

Undocumented

def _lcm(a, b): (source)

Undocumented

def _makenames_list(adict, align): (source)

Undocumented

def _newnames(datatype, order): (source)

Given a datatype and an order object, return a new names tuple, with the order indicated

def _prod(a): (source)

Undocumented

def _promote_fields(dt1, dt2): (source)

Perform type promotion for two structured dtypes.

Notes

If one of the inputs is aligned, the result will be. The titles of both descriptors must match (point to the same field).

Parameters
dt1:structured dtypeFirst dtype.
dt2:structured dtypeSecond dtype.
Returns
dtypeout - The promoted dtype
def _reconstruct(subtype, shape, dtype): (source)

Undocumented

def _ufunc_doc_signature_formatter(ufunc): (source)

Builds a signature string which resembles PEP 457

This is used to construct the first line of the docstring

def _usefields(adict, align): (source)

Undocumented

def _view_is_safe(oldtype, newtype): (source)

Checks safety of a view involving object arrays, for example when doing:

np.zeros(10, dtype=oldtype).view(newtype)
Parameters
oldtype:data-typeData type of original ndarray
newtype:data-typeData type of the view
Raises
TypeErrorIf the new type is incompatible with the old type.
_convorder = (source)

Undocumented

Undocumented

_pep3118_native_map: dict[str, str] = (source)

Undocumented

_pep3118_native_typechars = (source)

Undocumented

_pep3118_standard_map: dict[str, str] = (source)

Undocumented

_pep3118_standard_typechars = (source)

Undocumented

_pep3118_unsupported_map: dict[str, str] = (source)

Undocumented