numpy
2.0.0
|
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "common.h"
#include "scalartypes.h"
#include "mapping.h"
#include "convert_datatype.h"
#include "_datetime.h"
#include "datetime_strings.h"
#define _MULTIARRAYMODULE |
#define NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define PY_SSIZE_T_CLEAN |
static int _check_object_rec | ( | PyArray_Descr * | descr | ) | [static] |
NPY_NO_EXPORT npy_bool can_cast_scalar_to | ( | PyArray_Descr * | scal_type, |
char * | scal_data, | ||
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
References _npy_type_promotion_table, PyArray_DescrFromType(), and type_num_unsigned_to_signed().
static int dtype_kind_to_ordering | ( | char | kind | ) | [static] |
static int dtype_kind_to_simplified_ordering | ( | char | kind | ) | [static] |
References NPY_FALSE.
static PyArray_Descr* ensure_dtype_nbo | ( | PyArray_Descr * | type | ) | [static] |
static int min_scalar_type_num | ( | char * | valueptr, |
int | type_num, | ||
int * | is_small_unsigned | ||
) | [static] |
<blockquote>
NPY_FLOAT, is_small_unsigned);
</blockquote>
NPY_DOUBLE, is_small_unsigned);
NPY_LONGDOUBLE, is_small_unsigned);
static PyArray_Descr* promote_types | ( | PyArray_Descr * | type1, |
PyArray_Descr * | type2, | ||
int | is_small_unsigned1, | ||
int | is_small_unsigned2 | ||
) | [static] |
Referenced by PyArray_DTypeFromObjectHelper().
NPY_NO_EXPORT void PyArray_AdaptFlexibleDType | ( | PyObject * | data_obj, |
PyArray_Descr * | data_dtype, | ||
PyArray_Descr ** | flex_dtype | ||
) |
Referenced by get_nbo_datetime_to_string_transfer_function(), npyiter_check_per_op_flags(), and PyArray_CastToType().
NPY_NO_EXPORT npy_bool PyArray_CanCastArrayTo | ( | PyArrayObject * | arr, |
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
References PyArray_DescrFromType().
Referenced by PyUFunc_ValidateCasting().
NPY_NO_EXPORT int PyArray_CanCastSafely | ( | int | fromtype, |
int | totype | ||
) |
NPY_NO_EXPORT npy_bool PyArray_CanCastScalar | ( | PyTypeObject * | from, |
PyTypeObject * | to | ||
) |
NPY_NO_EXPORT npy_bool PyArray_CanCastTo | ( | PyArray_Descr * | from, |
PyArray_Descr * | to | ||
) |
References can_cast_timedelta64_metadata(), get_datetime_metadata_from_dtype(), and NPY_SAFE_CASTING.
NPY_NO_EXPORT npy_bool PyArray_CanCastTypeTo | ( | PyArray_Descr * | from, |
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
Referenced by PyUFunc_ValidateCasting(), and ufunc_masker_data_clone().
static npy_bool PyArray_CanCastTypeTo_impl | ( | PyArray_Descr * | from, |
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) | [static] |
NPY_NO_EXPORT int PyArray_CastAnyTo | ( | PyArrayObject * | out, |
PyArrayObject * | mp | ||
) |
NPY_NO_EXPORT int PyArray_CastTo | ( | PyArrayObject * | out, |
PyArrayObject * | mp | ||
) |
References _npy_can_cast_safely_table, NPY_DATETIME, NPY_NTYPES, and NPY_TIMEDELTA.
NPY_NO_EXPORT PyObject* PyArray_CastToType | ( | PyArrayObject * | arr, |
PyArray_Descr * | dtype, | ||
int | is_f_order | ||
) |
References Py_TYPE, PyArray_AdaptFlexibleDType(), PyArray_CopyInto(), PyArray_DESCR, PyArray_DIMS, PyArray_NDIM, and PyArray_NewFromDescr().
NPY_NO_EXPORT PyArrayObject** PyArray_ConvertToCommonType | ( | PyObject * | op, |
int * | retn | ||
) |
NPY_NO_EXPORT PyArray_VectorUnaryFunc* PyArray_GetCastFunc | ( | PyArray_Descr * | descr, |
int | type_num | ||
) |
References PyArray_ArrFuncs::castdict, _PyArray_Descr::f, NpyCapsule_AsVoidPtr(), and NpyCapsule_Check().
NPY_NO_EXPORT int PyArray_ObjectType | ( | PyObject * | op, |
int | minimum_type | ||
) |
Referenced by _pyarray_correlate().
NPY_NO_EXPORT char* PyArray_One | ( | PyArrayObject * | arr | ) |
NPY_NO_EXPORT PyArray_Descr* PyArray_PromoteTypes | ( | PyArray_Descr * | type1, |
PyArray_Descr * | type2 | ||
) |
Referenced by PyArray_Clip(), and PyUFunc_MultiplicationTypeResolver().
NPY_NO_EXPORT PyArray_Descr* PyArray_ResultType | ( | npy_intp | narrs, |
PyArrayObject ** | arr, | ||
npy_intp | ndtypes, | ||
PyArray_Descr ** | dtypes | ||
) |
type promotion rules. Use this function when you have a set of input arrays, and need to determine an output array dtype.
If all the inputs are scalars (have 0 dimensions) or the maximum "kind" of the scalars is greater than the maximum "kind" of the arrays, does a regular type promotion.
Otherwise, does a type promotion on the MinScalarType of all the inputs. Data types passed directly are treated as array types.
Referenced by npyiter_apply_forced_iteration_order(), and PyUFunc_SimpleBinaryOperationTypeResolver().
NPY_NO_EXPORT int PyArray_ValidType | ( | int | type | ) |
NPY_NO_EXPORT char* PyArray_Zero | ( | PyArrayObject * | arr | ) |
static int type_num_unsigned_to_signed | ( | int | type_num | ) | [static] |