module documentation

A place for internal code

Some things are more easily handled Python.

Constant IS​_PYPY Undocumented
Variable ctypes 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
Class dummy​_ctype 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 ​_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:
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
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
IS_PYPY =

Undocumented

Value
(platform.python_implementation() == 'PyPy')
ctypes =

Undocumented

format_re =

Undocumented

sep_re =

Undocumented

space_re =

Undocumented

def __dtype_from_pep3118(stream, is_subdtype):

Undocumented

def _add_trailing_padding(value, padding):
Inject the specified number of padding bytes at the end of a dtype
def _array_descr(descriptor):

Undocumented

def _commastring(astr):

Undocumented

def _copy_fields(ary):

Return copy of structured array with padding between fields removed.

Parameters

ary : ndarray
Structured array from which to remove padding bytes

Returns

ary_copy : ndarray
Copy of ary with padding bytes removed
def _dtype_from_pep3118(spec):

Undocumented

def _fix_names(field_spec):
Replace names which are None with the next unused f%d name
def _gcd(a, b):
Calculate the greatest common divisor of a and b
def _getfield_is_safe(oldtype, newtype, offset):

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-type
Data type of the original ndarray.
newtype : data-type
Data type of the field being accessed by ndarray.getfield
offset : int
Offset of the field being accessed by ndarray.getfield

Raises

TypeError
If the field access is invalid
def _getintp_ctype():

Undocumented

def _lcm(a, b):

Undocumented

def _makenames_list(adict, align):

Undocumented

def _newnames(datatype, order):
Given a datatype and an order object, return a new names tuple, with the order indicated
def _prod(a):

Undocumented

def _reconstruct(subtype, shape, dtype):

Undocumented

def _ufunc_doc_signature_formatter(ufunc):

Builds a signature string which resembles PEP 457

This is used to construct the first line of the docstring

def _usefields(adict, align):

Undocumented

def _view_is_safe(oldtype, newtype):

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

np.zeros(10, dtype=oldtype).view(newtype)

Parameters

oldtype : data-type
Data type of original ndarray
newtype : data-type
Data type of the view

Raises

TypeError
If the new type is incompatible with the old type.
def array_function_errmsg_formatter(public_api, types):
Format the error message for when __array_ufunc__ gives up.
def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs):
Format the error message for when __array_ufunc__ gives up.
def npy_ctypes_check(cls):

Undocumented

_convorder =

Undocumented

_nbo: str =

Undocumented

_pep3118_native_map: dict[str, str] =

Undocumented

_pep3118_native_typechars =

Undocumented

_pep3118_standard_map: dict[str, str] =

Undocumented

_pep3118_standard_typechars =

Undocumented

_pep3118_unsupported_map: dict[str, str] =

Undocumented