Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/convert.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "npy_config.h" #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "npy_pycompat.h" #include "common.h" #include "arrayobject.h" #include "ctors...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/nditer_pywrap.c
/* * This file implements the CPython wrapper of NpyIter * * Copyright (c) 2010 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #inc...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/convert_datatype.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "npy_config.h" #include "lowlevel_strided_loops.h" #include "npy_pycompat.h" #include "numpy/npy_math...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/strfuncs.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_STRFUNCS_H_ #define NUMPY_CORE_SRC_MULTIARRAY_STRFUNCS_H_ NPY_NO_EXPORT void PyArray_SetStringFunction(PyObject *op, int repr); NPY_NO_EXPORT PyObject * array_repr(PyArrayObject *self); NPY_NO_EXPORT PyObject * array_str(PyArrayObject *self); NPY_NO_EXPORT PyObject * array_format(P...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/npy_buffer.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_NPY_BUFFER_H_ #define NUMPY_CORE_SRC_MULTIARRAY_NPY_BUFFER_H_ extern NPY_NO_EXPORT PyBufferProcs array_as_buffer; NPY_NO_EXPORT int _buffer_info_free(void *buffer_info, PyObject *obj); NPY_NO_EXPORT PyArray_Descr* _descriptor_from_pep3118_format(char const *s); NPY_NO_EXPORT int vo...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/refcount.c
/* * This module corresponds to the `Special functions for NPY_OBJECT` * section in the numpy reference for C-API. */ #include "array_method.h" #include "dtype_traversal.h" #include "lowlevel_strided_loops.h" #include "pyerrors.h" #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SS...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/common.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_COMMON_H_ #define NUMPY_CORE_SRC_MULTIARRAY_COMMON_H_ #include <structmember.h> #include "numpy/npy_common.h" #include "numpy/ndarraytypes.h" #include "npy_cpu_features.h" #include "npy_cpu_dispatch.h" #include "numpy/npy_cpu.h" #include "npy_import.h" #include <limits.h> #define er...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/iterators.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_ITERATORS_H_ #define NUMPY_CORE_SRC_MULTIARRAY_ITERATORS_H_ NPY_NO_EXPORT PyObject *iter_subscript(PyArrayIterObject *, PyObject *); NPY_NO_EXPORT int iter_ass_subscript(PyArrayIterObject *, PyObject *, PyObject *); NPY_NO_EXPORT void PyArray_RawIterBaseInit(PyArrayIterObject *it, P...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/number.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "npy_config.h" #include "npy_pycompat.h" #include "npy_import.h" #include "common.h" #include "number.h" #include "temp_elide.h" #inc...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/nditer_constr.c
/* * This file implements the construction, copying, and destruction * aspects of NumPy's nditer. * * Copyright (c) 2010-2011 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * Copyright (c) 2011 Enthought, Inc * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_A...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/array_assign_scalar.c
/* * This file implements assignment from a scalar to an ndarray. * * Written by Mark Wiebe (mwwiebe@gmail.com) * Copyright (c) 2011 by Enthought, Inc. * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define _UMATHMODULE #define PY_SSIZE_T_CLEAN #i...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/legacy_dtype_implementation.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_LEGACY_DTYPE_IMPLEMENTATION_H_ #define NUMPY_CORE_SRC_MULTIARRAY_LEGACY_DTYPE_IMPLEMENTATION_H_ NPY_NO_EXPORT npy_bool PyArray_LegacyCanCastTypeTo(PyArray_Descr *from, PyArray_Descr *to, NPY_CASTING casting); #endif /* NUMPY_CORE_SRC_MULTIARRAY_LEGACY_DTYPE_IMPLEMENTATION_H_...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/item_selection.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_ITEM_SELECTION_H_ #define NUMPY_CORE_SRC_MULTIARRAY_ITEM_SELECTION_H_ /* * Counts the number of True values in a raw boolean array. This * is a low-overhead function which does no heap allocations. * * Returns -1 on error. */ NPY_NO_EXPORT npy_intp count_boolean_trues(int ndim, c...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/refcount.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_REFCOUNT_H_ #define NUMPY_CORE_SRC_MULTIARRAY_REFCOUNT_H_ NPY_NO_EXPORT int PyArray_ClearBuffer( PyArray_Descr *descr, char *data, npy_intp stride, npy_intp size, int aligned); NPY_NO_EXPORT int PyArray_ClearArray(PyArrayObject *arr); NPY_NO_EXPORT void PyArray_Item_...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/datetime_strings.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_DATETIME_STRINGS_H_ #define NUMPY_CORE_SRC_MULTIARRAY_DATETIME_STRINGS_H_ /* * This is the Python-exposed datetime_as_string function. */ NPY_NO_EXPORT PyObject * array_datetime_as_string(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/temp_elide.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEMP_ELIDE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEMP_ELIDE_H_ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include <numpy/ndarraytypes.h> NPY_NO_EXPORT int can_elide_temp_unary(PyArrayObject * m1); NPY_NO_EXPORT int try_binary_elide(PyObject * m1, PyObjec...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/alloc.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include <pymem.h> #include "numpy/ndarraytypes.h" #include "numpy/arrayobject.h" #include "numpy/npy_common.h" #include "npy_config.h" #include "alloc.h" #include <assert.h>...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/abstractdtypes.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_ABSTRACTDTYPES_H_ #define NUMPY_CORE_SRC_MULTIARRAY_ABSTRACTDTYPES_H_ #include "arrayobject.h" #include "dtypemeta.h" #ifdef __cplusplus extern "C" { #endif /* * These are mainly needed for value based promotion in ufuncs. It * may be necessary to make them (partially) public, t...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dlpack.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include "dlpack/dlpack.h" #include "numpy/arrayobject.h" #include "npy_argparse.h" #include "npy_dlpack.h" static void array_dlpack_deleter(DLManagedTensor *self) { /* * Leak the pyobj if no...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/datetime_busday.c
/* * This file implements business day functionality for NumPy datetime. * * Written by Mark Wiebe (mwwiebe@gmail.com) * Copyright (c) 2011 by Enthought, Inc. * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/einsum.c.src
/* * This file contains the implementation of the 'einsum' function, * which provides an einstein-summation operation. * * Copyright (c) 2011 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * See LICENSE.txt for the license. */ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <str...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/temp_elide.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include "npy_config.h" #include "numpy/arrayobject.h" #define NPY_NUMBER_MAX(a, b) ((a) > (b) ? (a) : (b)) #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) /* * Functions used to try to avoid/elide t...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/arrayobject.c
/* Provide multidimensional arrays as a basic object type in python. Based on Original Numeric implementation Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu with contributions from many Numeric Python developers 1995-2004 Heavily modified in 2005 with inspiration from Numarray by Travis ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/compiled_base.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_COMPILED_BASE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_COMPILED_BASE_H_ #include "numpy/ndarraytypes.h" NPY_NO_EXPORT PyObject * arr_place(PyObject *, PyObject *, PyObject *); NPY_NO_EXPORT PyObject * arr_bincount(PyObject *, PyObject *const *, Py_ssize_t, PyObject *); NPY_NO_EXPORT PyOb...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/ctors.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define _UMATHMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "numpy/npy_math.h" #include "npy_config.h" #include "npy_ctypes.h" #include "np...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/iterators.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "numpy/npy_math.h" #include "npy_config.h" #include "npy_pycompat.h" #include "arrayobject.h" #inclu...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/shape.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_SHAPE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_SHAPE_H_ /* * Creates a sorted stride perm matching the KEEPORDER behavior * of the NpyIter object. Because this operates based on multiple * input strides, the 'stride' member of the npy_stride_sort_item * would be useless and we simply ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/compiled_base.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/npy_3kcompat.h" #include "numpy/npy_math.h" #include "npy_argparse.h" #include "npy_config.h" #include "templ_common.h" /* for n...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/vdot.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include "common.h" #include "vdot.h" #include "npy_cblas.h" /* * All data is assumed aligned. */ NPY_NO_EXPORT void CFLOAT_vdot(char *ip1, npy_intp is1, char *ip2, npy_intp is2, char *...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/lowlevel_strided_loops.c.src
/* * This file contains low-level loops for copying and byte-swapping * strided data. * * Copyright (c) 2010 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * See LICENSE.txt for the license. */ #define PY_SSIZE_T_CLEAN #include <Python.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/item_selection.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "numpy/npy_math.h" #include "numpy/npy_cpu.h" #include "npy_config.h" #include "npy_pycompat.h" #in...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/sequence.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #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 "mapping.h" #include "sequenc...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dragon4.h
/* * Copyright (c) 2014 Ryan Juckett * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publis...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/hashdescr.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_HASHDESCR_H_ #define NUMPY_CORE_SRC_MULTIARRAY_HASHDESCR_H_ NPY_NO_EXPORT npy_hash_t PyArray_DescrHash(PyObject* odescr); #endif /* NUMPY_CORE_SRC_MULTIARRAY_HASHDESCR_H_ */
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/datetime_busdaycal.c
/* * This file implements an object encapsulating a business day * calendar object for accelerating NumPy datetime business day functions. * * Written by Mark Wiebe (mwwiebe@gmail.com) * Copyright (c) 2011 by Enthought, Inc. * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/nditer_pywrap.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_NDITER_PYWRAP_H_ #define NUMPY_CORE_SRC_MULTIARRAY_NDITER_PYWRAP_H_ NPY_NO_EXPORT PyObject * NpyIter_NestedIters(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #endif /* NUMPY_CORE_SRC_MULTIARRAY_NDITER_PYWRAP_H_ */
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/number.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_NUMBER_H_ #define NUMPY_CORE_SRC_MULTIARRAY_NUMBER_H_ typedef struct { PyObject *add; PyObject *subtract; PyObject *multiply; PyObject *divide; PyObject *remainder; PyObject *divmod; PyObject *power; PyObject *square; PyObject *reciprocal; PyObj...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/nditer_impl.h
/* * This is a PRIVATE INTERNAL NumPy header, intended to be used *ONLY* * by the iterator implementation code. All other internal NumPy code * should use the exposed iterator API. */ #ifndef NPY_ITERATOR_IMPLEMENTATION_CODE #error This header is intended for use ONLY by iterator implementation code. #endif #ifnde...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dtype_traversal.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_DTYPE_TRAVERSAL_H_ #define NUMPY_CORE_SRC_MULTIARRAY_DTYPE_TRAVERSAL_H_ #include "array_method.h" /* NumPy DType clear (object DECREF + NULLing) implementations */ NPY_NO_EXPORT int npy_get_clear_object_strided_loop( void *traverse_context, PyArray_Descr *descr, int aligned,...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dtype_transfer.c
/* * This file contains low-level loops for data type transfers. * In particular the function PyArray_GetDTypeTransferFunction is * implemented here. * * Copyright (c) 2010 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * See LICENSE.txt for the license. * */ #define NPY_NO_DEPRECATE...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/getset.c
/* Array Descr Object */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "npy_config.h" #include "npy_pycompat.h" #include "npy_import.h" #include "common.h" #include "conversion_ut...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/hashdescr.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <numpy/arrayobject.h> #include "npy_config.h" #include "npy_pycompat.h" #include "hashdescr.h" /* * How does this work ? The hash is computed from a list which contains all the * informa...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dtype_transfer.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_DTYPE_TRANSFER_H_ #define NUMPY_CORE_SRC_MULTIARRAY_DTYPE_TRANSFER_H_ #include "array_method.h" /* * More than for most functions, cast information needs to be stored in * a few places. Most importantly, in many cases we need to chain or wrap * casts (e.g. structured dtypes). *...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/mapping.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_MAPPING_H_ #define NUMPY_CORE_SRC_MULTIARRAY_MAPPING_H_ extern NPY_NO_EXPORT PyMappingMethods array_as_mapping; /* * Object to store information needed for advanced (also fancy) indexing. * Not public, so does not have to be a Python object in principle. */ typedef struct { ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/sequence.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_SEQUENCE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_SEQUENCE_H_ extern NPY_NO_EXPORT PySequenceMethods array_as_sequence; #endif /* NUMPY_CORE_SRC_MULTIARRAY_SEQUENCE_H_ */
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/einsum_debug.h
/* * This file provides debug macros used by the other einsum files. * * Copyright (c) 2011 by Mark Wiebe (mwwiebe@gmail.com) * The University of British Columbia * * See LICENSE.txt for the license. */ #ifndef NUMPY_CORE_SRC_MULTIARRAY_EINSUM_DEBUG_H_ #define NUMPY_CORE_SRC_MULTIARRAY_EINSUM_DEBUG_H_ /********...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/array_coercion.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_ARRAY_COERCION_H_ #define NUMPY_CORE_SRC_MULTIARRAY_ARRAY_COERCION_H_ /* * We do not want to coerce arrays many times unless absolutely necessary. * The same goes for sequences, so everything we have seen, we will have * to store somehow. This is a linked list of these objects. *...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/convert_datatype.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_CONVERT_DATATYPE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_CONVERT_DATATYPE_H_ #include "array_method.h" #ifdef __cplusplus extern "C" { #endif extern NPY_NO_EXPORT npy_intp REQUIRED_STR_LEN[]; #define NPY_USE_LEGACY_PROMOTION 0 #define NPY_USE_WEAK_PROMOTION 1 #define NPY_USE_WEAK_PROM...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/dragon4.c
/* * Copyright (c) 2014 Ryan Juckett * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publis...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/scalarapi.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "numpy/npy_math.h" #include "npy_config.h" #include "npy_pycompat.h" #include "ctors.h" #include "d...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/usertypes.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_USERTYPES_H_ #define NUMPY_CORE_SRC_MULTIARRAY_USERTYPES_H_ #include "array_method.h" extern NPY_NO_EXPORT PyArray_Descr **userdescrs; NPY_NO_EXPORT void PyArray_InitArrFuncs(PyArray_ArrFuncs *f); NPY_NO_EXPORT int PyArray_RegisterCanCast(PyArray_Descr *descr, int totype, ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/scalartypes.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_SCALARTYPES_H_ #define NUMPY_CORE_SRC_MULTIARRAY_SCALARTYPES_H_ /* * Internal look-up tables, casting safety is defined in convert_datatype.h. * Most of these should be phased out eventually, but some are still used. */ extern NPY_NO_EXPORT signed char _npy_scalar_kinds_table[NPY_N...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/mapping.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define _UMATHMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/npy_math.h" #include "arrayobject.h" #include "npy_config.h" #include "npy_pycompat.h" #include "npy_imp...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/multiarray/common_dtype.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_COMMON_DTYPE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_COMMON_DTYPE_H_ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include <numpy/ndarraytypes.h> #include "dtypemeta.h" #ifdef __cplusplus extern "C" { #endif NPY_NO_EXPORT PyArray_DTypeMeta * PyArray_CommonDT...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/growth.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/ndarraytypes.h" #include "templ_common.h" /* * Helper function taking the size input and growing it (based on min_grow). * The current scheme is a minimum growth and a general growth by 25% * overallocation. This is then cappe...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/tokenize.cpp
#include <Python.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/ndarraytypes.h" #include "textreading/stream.h" #include "textreading/tokenize.h" #include "textreading/parser_config.h" #include "textreading/growth.h" /* How parsing quoted fields works: For quotin...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/tokenize.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_TOKENIZE_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_TOKENIZE_H_ #include <Python.h> #include "numpy/ndarraytypes.h" #include "textreading/stream.h" #include "textreading/parser_config.h" #ifdef __cplusplus extern "C" { #endif typedef enum { /* Initialization...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/str_to_int.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STR_TO_INT_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STR_TO_INT_H_ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/ndarraytypes.h" #include "textreading/parser_config.h" /* * The following two string conversion functions a...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/stream_pyobject.c
/* * C side structures to provide capabilities to read Python file like objects * in chunks, or iterate through iterables with each result representing a * single line of a file. */ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <stdio.h> #include <stdlib.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/rows.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_ROWS_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_ROWS_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <stdio.h> #include "textreading/stream.h" #include "textreading/field_types.h" #include "textreading/parser_config.h" NPY_NO_EXPORT PyArrayObject * read_...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/stream.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STREAM_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STREAM_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /* * When getting the next line, we hope that the buffer provider can already * give some information about the newlines, because for Python ite...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/conversions.c
#include <Python.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "lowlevel_strided_loops.h" #include "numpy/npy_math.h" #include "conversions.h" #include "str_to_int.h" #include "array_coercion.h" /* * Coercion to b...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/parser_config.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_PARSER_CONFIG_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_PARSER_CONFIG_H_ #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif typedef struct { /* * Field delimiter character. * Typically ',', ' ', '\t', ignored if `delimiter_is_whitespace` ...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/str_to_int.c
#include <Python.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "lowlevel_strided_loops.h" #include <string.h> #include "textreading/str_to_int.h" #include "textreading/parser_config.h" #include "conversions.h" /* For the deprecated parse-via-float path */ const char *deprecat...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/field_types.c
#include "field_types.h" #include "conversions.h" #include "str_to_int.h" #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/ndarraytypes.h" #include "alloc.h" #include "textreading/growth.h" NPY_NO_EXPORT void field_types_xclear(int num_field_types, field_type *ft) { assert...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/readtext.c
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <stdio.h> #include <stdbool.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/arrayobject.h" #include "npy_argparse.h" #include "common.h" #include "conversion_utils.h" #include "textreading/parser_config.h" #include "text...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/growth.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_GROWTH_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_GROWTH_H_ #ifdef __cplusplus extern "C" { #endif NPY_NO_EXPORT npy_intp grow_size_and_multiply(npy_intp *size, npy_intp min_grow, npy_intp itemsize); #ifdef __cplusplus } #endif #endif /* NUMPY_CORE_SRC_MULTIARRAY...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/conversions.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_CONVERSIONS_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_CONVERSIONS_H_ #include <stdbool.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/arrayobject.h" #include "textreading/parser_config.h" NPY_NO_EXPORT int npy_to_bool(P...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/rows.c
#define PY_SSIZE_T_CLEAN #include <Python.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/arrayobject.h" #include "numpy/npy_3kcompat.h" #include "alloc.h" #include <string.h> #include <stdbool.h> #include "textreading/stream.h" #include "textreading/tokenize.h" #include "...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/stream_pyobject.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STREAM_PYOBJECT_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_STREAM_PYOBJECT_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include "textreading/stream.h" NPY_NO_EXPORT stream * stream_python_file(PyObject *obj, const char *encoding); NPY_NO_EXPORT stream * strea...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/field_types.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_FIELD_TYPES_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_FIELD_TYPES_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <stdint.h> #include <stdbool.h> #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include "numpy/ndarraytypes.h" #inc...
0
public_repos/numpy/numpy/_core/src/multiarray
public_repos/numpy/numpy/_core/src/multiarray/textreading/readtext.h
#ifndef NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_READTEXT_H_ #define NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_READTEXT_H_ NPY_NO_EXPORT PyObject * _load_from_filelike(PyObject *mod, PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames); #endif /* NUMPY_CORE_SRC_MULTIARRAY_TEXTREADING_READTEXT_H_ */
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/generate_umath_doc.py
import sys import os import textwrap import argparse sys.path.insert(0, os.path.dirname(__file__)) import ufunc_docstrings as docstrings sys.path.pop(0) def normalize_doc(docstring): docstring = textwrap.dedent(docstring).strip() docstring = docstring.encode('unicode-escape').decode('ascii') docstring = d...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/generate_ufunc_api.py
import os import argparse import genapi from genapi import TypeApi, FunctionApi import numpy_api h_template = r""" #ifdef _UMATHMODULE extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type; %s #else #if defined(PY_UFUNC_UNIQUE_SYMBOL) #define PyUFunc_API PY_UFUNC_UNIQUE_SYMBOL #endif #if defined(NO_IMPORT) || defined(N...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/numpy_api.py
"""Here we define the exported functions, types, etc... which need to be exported through a global C pointer. Each dictionary contains name -> index pair. Whenever you change one index, you break the ABI (and the ABI version number should be incremented). Whenever you add an item to one of the dict, the API needs to ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/generate_umath.py
""" Generate the code to build all the internal ufuncs. At the base is the defdict: a dictionary ofUfunc classes. This is fed to make_code to generate __umath_generated.c """ import os import re import struct import sys import textwrap import argparse # identity objects Zero = "PyLong_FromLong(0)" One = "PyLong_FromLo...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/ufunc_docstrings.py
""" Docstrings for generated ufuncs The syntax is designed to look like the function add_newdoc is being called from numpy.lib, but in this file add_newdoc puts the docstrings in a dictionary. This dictionary is used in numpy/_core/code_generators/generate_umath_doc.py to generate the docstrings as a C #definitions f...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/cversions.txt
# Hash below were defined from numpy_api_order.txt and ufunc_api_order.txt # When adding a new version here for a new minor release, also add the same # version as NPY_x_y_API_VERSION in numpyconfig.h and C_API_VERSION in # numpy/core/meson.build 0x00000001 = 603580d224763e58c5e7147f804dc0f5 0x00000002 = 8ecb293067585...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/verify_c_api_version.py
#!/usr/bin/env python3 import os import sys import argparse class MismatchCAPIError(ValueError): pass def get_api_versions(apiversion): """ Return current C API checksum and the recorded checksum. Return current C API checksum and the recorded checksum for the given version of the C API version...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/genapi.py
""" Get API information encoded in C files. See ``find_function`` for how functions should be formatted, and ``read_order`` for how the order of the functions should be specified. """ import hashlib import io import os import re import sys import importlib.util import textwrap from os.path import join def get_proc...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/code_generators/generate_numpy_api.py
#!/usr/bin/env python3 import os import argparse import genapi from genapi import \ TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi import numpy_api # use annotated api when running under cpychecker h_template = r""" #if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUT...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_umath_complex.py
import sys import platform import pytest import numpy as np # import the c-extension module directly since _arg is not exported via umath import numpy._core._multiarray_umath as ncu from numpy.testing import ( assert_raises, assert_equal, assert_array_equal, assert_almost_equal, assert_array_max_ulp ) # TODO:...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_shape_base.py
import pytest import numpy as np from numpy._core import ( array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, newaxis, concatenate, stack ) from numpy.exceptions import AxisError from numpy._core.shape_base import (_block_dispatcher, _block_setup, _b...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_argparse.py
""" Tests for the private NumPy argument parsing functionality. They mainly exists to ensure good test coverage without having to try the weirder cases on actual numpy functions but test them in one place. The test function is defined in C to be equivalent to (errors may not always match exactly, and could be adjusted...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_scalar_methods.py
""" Test the scalar constructors, which also do type-coercion """ import fractions import platform import types from typing import Any, Type import pytest import numpy as np from numpy._core import sctypes from numpy.testing import assert_equal, assert_raises, IS_MUSL class TestAsIntegerRatio: # derived in part...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/_locales.py
"""Provide class for testing in French locale """ import sys import locale import pytest __ALL__ = ['CommaDecimalPointLocale'] def find_comma_decimal_point_locale(): """See if platform has a decimal point as comma locale. Find a locale that uses a comma instead of a period as the decimal point. R...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_abc.py
from numpy.testing import assert_ import numbers import numpy as np from numpy._core.numerictypes import sctypes class TestABC: def test_abstract(self): assert_(issubclass(np.number, numbers.Number)) assert_(issubclass(np.inexact, numbers.Complex)) assert_(issubclass(np.complexfloating, ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_dlpack.py
import sys import pytest import numpy as np from numpy.testing import assert_array_equal, IS_PYPY class TestDLPack: @pytest.mark.skipif(IS_PYPY, reason="PyPy can't get refcounts.") def test_dunder_dlpack_refcount(self): x = np.arange(5) y = x.__dlpack__() assert sys.getrefcount(x) == ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_nep50_promotions.py
""" This file adds basic tests to test the NEP 50 style promotion compatibility mode. Most of these test are likely to be simply deleted again once NEP 50 is adopted in the main test suite. A few may be moved elsewhere. """ import operator import numpy as np import pytest import hypothesis from hypothesis import s...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_cpu_features.py
import sys, platform, re, pytest from numpy._core._multiarray_umath import ( __cpu_features__, __cpu_baseline__, __cpu_dispatch__, ) import numpy as np import subprocess import pathlib import os import re def assert_features_equal(actual, desired, fname): __tracebackhide__ = True # Hide traceback for ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_item_selection.py
import sys import pytest import numpy as np from numpy.testing import ( assert_, assert_raises, assert_array_equal, HAS_REFCOUNT ) class TestTake: def test_simple(self): a = [[1, 2], [3, 4]] a_str = [[b'1', b'2'], [b'3', b'4']] modes = ['raise', 'wrap', 'clip'] indices = ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_simd_module.py
import pytest from numpy._core._simd import targets """ This testing unit only for checking the sanity of common functionality, therefore all we need is just to take one submodule that represents any of enabled SIMD extensions to run the test on it and the second submodule required to run only one check related to the ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_custom_dtypes.py
import sys from tempfile import NamedTemporaryFile import pytest import numpy as np from numpy.testing import assert_array_equal from numpy._core._multiarray_umath import ( _discover_array_parameters as discover_array_params, _get_sfloat_dtype) SF = _get_sfloat_dtype() class TestSFloat: def _get_array(sel...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_longdouble.py
import warnings import platform import pytest import numpy as np from numpy.testing import ( assert_, assert_equal, assert_raises, assert_warns, assert_array_equal, temppath, IS_MUSL ) from numpy._core.tests._locales import CommaDecimalPointLocale LD_INFO = np.finfo(np.longdouble) longdouble_longer_than_...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_unicode.py
import pytest import numpy as np from numpy.testing import assert_, assert_equal, assert_array_equal def buffer_length(arr): if isinstance(arr, str): if not arr: charmax = 0 else: charmax = max([ord(c) for c in arr]) if charmax < 256: size = 1 el...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_indexerrors.py
import numpy as np from numpy.testing import ( assert_raises, assert_raises_regex, ) class TestIndexErrors: '''Tests to exercise indexerrors not covered by other tests.''' def test_arraytypes_fasttake(self): 'take from a 0-length dimension' x = np.empty((2, 3, 0, 4)) a...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_print.py
import sys import pytest import numpy as np from numpy.testing import assert_, assert_equal, IS_MUSL from numpy._core.tests._locales import CommaDecimalPointLocale from io import StringIO _REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'} @pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble])...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_casting_unittests.py
""" The tests exercise the casting machinery in a more low-level manner. The reason is mostly to test a new implementation of the casting machinery. Unlike most tests in NumPy, these are closer to unit-tests rather than integration tests. """ import pytest import textwrap import enum import random import ctypes impo...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_mem_overlap.py
import itertools import pytest import numpy as np from numpy._core._multiarray_tests import solve_diophantine, internal_overlap from numpy._core import _umath_tests from numpy.lib.stride_tricks import as_strided from numpy.testing import ( assert_, assert_raises, assert_equal, assert_array_equal ) ndims = 2 ...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/tests/test_regression.py
import copy import sys import gc import tempfile import pytest from os import path from io import BytesIO from itertools import chain import pickle import numpy as np from numpy.exceptions import AxisError, ComplexWarning from numpy.testing import ( assert_, assert_equal, IS_PYPY, assert_almost_equal, ...
0