numpy  2.0.0
src/multiarray/convert_datatype.h
Go to the documentation of this file.
00001 #ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
00002 #define _NPY_ARRAY_CONVERT_DATATYPE_H_
00003 
00004 NPY_NO_EXPORT PyArray_VectorUnaryFunc *
00005 PyArray_GetCastFunc(PyArray_Descr *descr, int type_num);
00006 
00007 NPY_NO_EXPORT int
00008 PyArray_ObjectType(PyObject *op, int minimum_type);
00009 
00010 NPY_NO_EXPORT PyArrayObject **
00011 PyArray_ConvertToCommonType(PyObject *op, int *retn);
00012 
00013 NPY_NO_EXPORT int
00014 PyArray_ValidType(int type);
00015 
00016 /* Like PyArray_CanCastArrayTo */
00017 NPY_NO_EXPORT npy_bool
00018 can_cast_scalar_to(PyArray_Descr *scal_type, char *scal_data,
00019                     PyArray_Descr *to, NPY_CASTING casting);
00020 
00021 /*
00022  * This function calls Py_DECREF on flex_dtype, and replaces it with
00023  * a new dtype that has been adapted based on the values in data_dtype
00024  * and data_obj. If the flex_dtype is not flexible, it leaves it as is.
00025  *
00026  * The current flexible dtypes include NPY_STRING, NPY_UNICODE, NPY_VOID,
00027  * and NPY_DATETIME with generic units.
00028  */
00029 NPY_NO_EXPORT void
00030 PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
00031                             PyArray_Descr **flex_dtype);
00032 
00033 #endif