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-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/conversion_utils.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/ndarraytypes.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"
#inclu... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/ctors.h | #ifndef _NPY_ARRAY_CTORS_H_
#define _NPY_ARRAY_CTORS_H_
NPY_NO_EXPORT PyObject *
PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd,
intp *dims, intp *strides, void *data,
int flags, PyObject *obj);
NPY_NO_EXPORT PyObject *PyArray_New(PyTypeObject *, int... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/methods.h | #ifndef _NPY_ARRAY_METHODS_H_
#define _NPY_ARRAY_METHODS_H_
extern NPY_NO_EXPORT PyMethodDef array_methods[];
#endif
| 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/methods.c | #define PY_SSIZE_T_CLEAN
#include <stdarg.h>
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include <npy_defs.h>
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "commo... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/convert.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "arrayobject.h"
#include "mapping.h"
#include "c... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/convert_datatype.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/ndarraytypes.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"
#incl... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/refcount.c | /*
* This module corresponds to the `Special functions for PyArray_OBJECT`
* section in the numpy reference for C-API.
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "npy_api.h"
#include "npy_dict.h"
#include "numpy/arrayobject.h"
... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/common.h | #ifndef _NUMPY_PRIVATE_COMMON_H_
#define _NUMPY_PRIVATE_COMMON_H_
#include <numpy/noprefix.h>
#define error_converting(x) (((x) == -1) && PyErr_Occurred())
NPY_NO_EXPORT NpyArray_Descr *
_array_find_type(PyObject *op, NpyArray_Descr *minitype, int max);
NPY_NO_EXPORT NpyArray_Descr *
_array_find_python_scalar_typ... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/iterators.h | #ifndef _NPY_ARRAYITERATORS_H_
#define _NPY_ARRAYITERATORS_H_
NPY_NO_EXPORT intp
parse_subindex(PyObject *op, intp *step_size, intp *n_steps, intp max);
NPY_NO_EXPORT PyObject
*iter_subscript(PyArrayIterObject *, PyObject *);
NPY_NO_EXPORT PyObject*
npy_iter_subscript(NpyArrayIterObject* self, PyObject* ind);
NPY_N... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/number.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
/*#include <stdio.h>*/
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include <npy_ufunc_object.h>
#include "numpy/ufuncobject.h"
#include "arrayobject.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/buffer.h | #ifndef _PRIVATE_BUFFER_H_
#define _PRIVATE_BUFFER_H_
extern NPY_NO_EXPORT PyBufferProcs array_as_buffer;
NPY_NO_EXPORT void
_array_dealloc_buffer_info(PyArrayObject *self);
NPY_NO_EXPORT NpyArray_Descr*
_descriptor_from_pep3118_format(char *s);
#endif
| 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/refcount.h | #ifndef _NPY_PRIVATE_REFCOUNT_H_
#define _NPY_PRIVATE_REFCOUNT_H_
NPY_NO_EXPORT void
PyArray_Item_INCREF(char *data, PyArray_Descr *descr);
NPY_NO_EXPORT void
PyArray_Item_XDECREF(char *data, PyArray_Descr *descr);
NPY_NO_EXPORT int
PyArray_INCREF(PyArrayObject *mp);
NPY_NO_EXPORT int
PyArray_XDECREF(PyArrayObject ... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/numpymemoryview.c | /*
* Simple PyMemoryView'ish object for Python 2.6 compatibility.
*
* On Python >= 2.7, we can use the actual PyMemoryView objects.
*
* Some code copied from the CPython implementation.
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#inc... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/ucsnarrow.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <locale.h>
#include <stdio.h>
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_math.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
/* Functions only needed on narrow builds of Python
for converting back... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/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-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/ctors.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_math.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"
#include "cto... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/ucsnarrow.h | #ifndef _NPY_UCSNARROW_H_
#define _NPY_UCSNARROW_H_
#ifdef Py_UNICODE_WIDE
#error this should not be included if Py_UNICODE_WIDE is defined
int int int;
#endif
#include <numpy/noprefix.h>
NPY_NO_EXPORT int
PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs4length);
NPY_NO_EXPORT int
PyUCS2Buffer_As... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/iterators.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/ndarraytypes.h"
#include "numpy/npy_3kcompat.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_iterators.h"
#include "npy_config.h"
#... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/shape.h | #ifndef _NPY_ARRAY_SHAPE_H_
#define _NPY_ARRAY_SHAPE_H_
#endif
| 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/multiarray_tests.c.src | #include <Python.h>
#include "npy_api.h"
#include "numpy/ndarrayobject.h"
#include "numpy/npy_3kcompat.h"
/* We need a single-word token for the type corresponding to NPY_LONGLONG. */
typedef long long longlong;
/*
* TODO:
* - Handle mode
*/
/**begin repeat
* #type = double, int, long, longlong#
* #typenum =... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/item_selection.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/ndarraytypes.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_math.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#in... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/sequence.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "numpy/ndarraytypes.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"
#include "mapping.h"
#include "array... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/hashdescr.h | #ifndef _NUMPY_HASHDESCR_H_
#define _NUMPY_HASHDESCR_H_
NPY_NO_EXPORT long
PyArray_DescrHash(PyObject* odescr);
#endif
| 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/numpymemoryview.h | #ifndef _NPY_PRIVATE_NUMPYMEMORYVIEW_H_
#define _NPY_PRIVATE_NUMPYMEMORYVIEW_H_
/*
* Memoryview is introduced to 2.x series only in 2.7, so for supporting 2.6,
* we need to have a minimal implementation here.
*/
#if (PY_VERSION_HEX >= 0x02060000) && (PY_VERSION_HEX < 0x02070000)
typedef struct {
PyObject_HEAD
... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/number.h | #ifndef _NPY_ARRAY_NUMBER_H_
#define _NPY_ARRAY_NUMBER_H_
#include <npy_ufunc_object.h>
#include "numpy/ufuncobject.h"
extern NPY_NO_EXPORT PyNumberMethods array_as_number;
NPY_NO_EXPORT PyObject *
array_int(PyArrayObject *v);
NPY_NO_EXPORT PyObject *
PyArray_GetNumericOp(enum NpyArray_Ops op);
... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/getset.c | /* Array Descr Object */
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_api.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"
#include "scalartypes.h"
#include "ctors.h"... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/hashdescr.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#define _MULTIARRAYMODULE
#include "npy_api.h"
#include "npy_dict.h"
#include <numpy/ndarrayobject.h>
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "hashdescr.h"
/*
* How does this work ? The hash is computed from a list which contains all the
* info... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/mapping.h | #ifndef _NPY_ARRAYMAPPING_H_
#define _NPY_ARRAYMAPPING_H_
extern NPY_NO_EXPORT PyMappingMethods array_as_mapping;
NPY_NO_EXPORT PyObject *
array_big_item(PyArrayObject *self, intp i);
NPY_NO_EXPORT Py_ssize_t
array_length(PyArrayObject *self);
NPY_NO_EXPORT PyObject *
array_item_nice(PyArrayObject *self, Py_ssize... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/sequence.h | #ifndef _NPY_ARRAY_SEQUENCE_H_
#define _NPY_ARRAY_SEQUENCE_H_
extern NPY_NO_EXPORT PySequenceMethods array_as_sequence;
#endif
| 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/convert_datatype.h | #ifndef _NUMPY_CONVERT_DATATYPE_H_
#define _NUMPY_CONVERT_DATATYPE_H_
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
NPY_NO_EXPORT int
PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp);
NPY_NO_EXPORT PyArray_VectorUnaryFunc *
PyArray_GetCastFunc(PyArray_Descr *des... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/scalarapi.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/arrayscalars.h"
#include "npy_api.h"
#include "npy_math.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "ctors.h"
#include "descriptor.h"
#include "scalartypes.h... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/usertypes.h | #ifndef _NPY_PRIVATE_USERTYPES_H_
#define _NPY_PRIVATE_USERTYPES_H_
NPY_NO_EXPORT void
PyArray_InitArrFuncs(PyArray_ArrFuncs *f);
NPY_NO_EXPORT int
PyArray_RegisterCanCast(PyArray_Descr *descr, int totype,
NPY_SCALARKIND scalar);
NPY_NO_EXPORT int
PyArray_RegisterDataType(PyArray_Descr *descr... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/scalartypes.h | #ifndef _NPY_SCALARTYPES_H_
#define _NPY_SCALARTYPES_H_
#include <numpy/noprefix.h>
NPY_NO_EXPORT void
initialize_numeric_types(void);
NPY_NO_EXPORT void
format_longdouble(char *buf, size_t buflen, longdouble val, unsigned int prec);
#if PY_VERSION_HEX >= 0x03000000
NPY_NO_EXPORT void
gentype_struct_free(PyObject *... | 0 |
public_repos/numpy-refactor/numpy/core/src | public_repos/numpy-refactor/numpy/core/src/multiarray/mapping.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#include "numpy/npy_3kcompat.h"
#include "numpy/arrayobject.h"
#include "npy_api.h"
#include "npy_iterators.h"
#include "npy_dict.h"
#include "npy_index.h"
#include "npy_config.h"
#include "common.... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/cversions.py | """Simple script to compute the api hash of the current API as defined by
numpy_api_order and ufunc_api_order."""
from os.path import dirname
from genapi import fullapi_hash
import numpy_api
if __name__ == '__main__':
curdir = dirname(__file__)
print fullapi_hash(numpy_api.full_api)
| 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/generate_ufunc_api.py | import os
import genapi
import numpy_api
from genapi import TypeApi, FunctionApi
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(NO_IMPORT_UFUNC)... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/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-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/generate_umath.py | import os
import re
import struct
import sys
import textwrap
sys.path.insert(0, os.path.dirname(__file__))
import ufunc_docstrings as docstrings
sys.path.pop(0)
Zero = "NpyUFunc_Zero"
One = "NpyUFunc_One"
None_ = "NpyUFunc_None"
#
# NOTE: This code generator is used in both the CPython AND .NET interface layers. To
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/ufunc_docstrings.py | # Docstrings for generated ufuncs
docdict = {}
def get(name):
return docdict.get(name)
def add_newdoc(place, name, doc):
docdict['.'.join((place, name))] = doc
add_newdoc('numpy.core.umath', 'absolute',
"""
Calculate the absolute value element-wise.
Parameters
----------
x : array_like... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/cversions.txt | # hash below were defined from numpy_api_order.txt and ufunc_api_order.txt
0x00000001 = 603580d224763e58c5e7147f804dc0f5
0x00000002 = 8ecb29306758515ae69749c803a75da1
0x00000003 = bf22c0d05b31625d2a7015988d61ce5a
# Starting from here, the hash is defined from numpy_api.full_api dict
# version 4 added neighborhood itera... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/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 sys, os, re
try:
import hashlib
md5new = hashlib.md5
except ImportError:
import md5
md5new = md5.new
if sys.vers... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/code_generators/generate_numpy_api.py | import os
import genapi
from genapi import TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi
import numpy_api
h_template = r"""
#ifdef _MULTIARRAYMODULE
typedef struct {
PyObject_HEAD
npy_bool obval;
} PyBoolScalarObject;
extern NPY_NO_EXPORT PyTypeObject PyArrayNeighborhoodIter_Type;
extern NPY_NO... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_umath_complex.py | import sys
import platform
from numpy.testing import *
import numpy.core.umath as ncu
import numpy as np
# TODO: branch cuts (use Pauli code)
# TODO: conj 'symmetry'
# TODO: FPU exceptions
# At least on Windows the results of many complex functions are not conforming
# to the C99 standard. See ticket 1574.
# Ditto f... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_shape_base.py | from numpy.testing import *
from numpy.core import array, atleast_1d, atleast_2d, atleast_3d, vstack, \
hstack, newaxis
class TestAtleast1d(TestCase):
def test_0D_array(self):
a = array(1); b = array(2);
res=map(atleast_1d,[a,b])
desired = [array([1]),array([2])]
assert_arra... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_blasdot.py | from numpy.core import zeros, float64
from numpy.testing import dec, TestCase, assert_almost_equal, assert_
from numpy.core.multiarray import inner as inner_
DECPREC = 14
class TestInner(TestCase):
def test_vecself(self):
"""Ticket 844."""
# Inner product of a vector with itself segfaults or give ... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_npy_arraytypes.py | import sys
import warnings
import numpy as np
from numpy.testing import *
warnings.filterwarnings('ignore',
'Casting complex values to real discards the imaginary part')
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
np.int_, np.uint, np.longlong, np.ulonglong,
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_loops.py | # This is to test things in numpy/core/src/umath/loops.c
import sys
import warnings
import numpy as np
from numpy.testing import *
warnings.filterwarnings('ignore',
'Casting complex values to real discards the imaginary part')
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uint... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_unicode.py | import sys
from numpy.testing import *
from numpy.core import *
from numpy.compat import asbytes
# Guess the UCS length for this python interpreter
if sys.version_info[0] >= 3:
import array as _array
ucs4 = (_array.array('u').itemsize == 4)
def buffer_length(arr):
if isinstance(arr, unicode):
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_iterators.py |
import numpy as np
from numpy.testing import *
class TestBroadcast(TestCase):
""" Tests np.broadcast. """
def _broadcast_add(self, args, dtype):
""" Uses a multiter to do the equiv of a ufunc add. """
b = np.broadcast(*args)
result = np.empty(b.size, dtype=dtype)
flat_arrays ... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_print.py | import numpy as np
from numpy.testing import *
import nose
import locale
import sys
from StringIO import StringIO
_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'}
def check_float_type(tp):
for x in [0, 1,-1, 1e20] :
assert_equal(str(tp(x)), str(float(x)),
err_msg='Failed str f... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_regression.py | from StringIO import StringIO
import pickle
import sys
import gc
import copy
from os import path
from numpy.testing import *
from numpy.testing.utils import _assert_valid_refcount, WarningManager
from numpy.compat import asbytes, asunicode, asbytes_nested
import warnings
import tempfile
import numpy as np
if sys.versi... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_scalarmath.py | import sys
from numpy.testing import *
import numpy as np
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
np.int_, np.uint, np.longlong, np.ulonglong,
np.single, np.double, np.longdouble, np.csingle,
np.cdouble, np.clongdouble]
real_types = [ np.byte, np.ubyte,... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_methods.py | import sys
from numpy.testing import *
import numpy as np
class TestMethods(TestCase):
def test_itemset( self ):
# array method itemset is implemented via array_setscalar
x = np.arange(3)
x.itemset( 1, 99 )
assert_array_equal( x, [0, 99, 2] )
if __name__ == "__main__":
run_... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_function_base.py |
from numpy.testing import *
from numpy import logspace, linspace
class TestLogspace(TestCase):
def test_basic(self):
y = logspace(0,6)
assert(len(y)==50)
y = logspace(0,6,num=100)
assert(y[-1] == 10**6)
y = logspace(0,6,endpoint=0)
assert(y[-1] < 10**6)
y = ... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_arrayprint.py | import sys
import numpy as np
from numpy.testing import *
class TestArrayRepr(object):
def test_nan_inf(self):
x = np.array([np.nan, np.inf])
if sys.platform == 'cli':
assert_equal(repr(x), 'array([nan, inf])')
else:
assert_equal(repr(x), 'array([ nan, inf])')
if _... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_scalartypes.py | import sys
from numpy.testing import *
import numpy as np
class TestIndex(TestCase):
def test_index( self ):
a = np.arange(5)
itypes = [ np.byte, np.ubyte,
np.short, np.ushort,
np.int32, np.uint32,
np.int, np.uint,
# np.l... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_multiarray.py | import tempfile
import warnings
import sys
import os
import numpy as np
from numpy.testing import *
from numpy.core import *
from numpy.compat import asbytes, getexception, strchar
if sys.platform != 'cli':
# TODO: Not yet ported to IronPython
from numpy.core.multiarray_tests import test_neighborhood_iterator... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_records.py | import sys
from os import path
import numpy as np
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import warnings
class TestFromrecords(TestCase):
def test_fromrecords(self):
r = np.rec.fromrecords([[456, 'dbe', 1.2], [2, 'de', 1.3]],
names='col1,col2,c... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_umath.py | import sys
from numpy.testing import *
import numpy.core.umath as ncu
import numpy as np
class FailingWrap(object):
def __array__(self):
return np.zeros(1)
def __array_wrap__(self, arr, context):
raise RuntimeError
class TestDivision(TestCase):
def test_division_int(self):
# int ... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_getlimits.py | """ Test functions for limits module.
"""
from numpy.testing import *
from numpy.core import finfo, iinfo
from numpy import single,double,longdouble
import numpy as np
##################################################
class TestPythonFloat(TestCase):
def test_singleton(self):
ftype = finfo(float)
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_machar.py | from numpy.testing import *
from numpy.core.machar import MachAr
import numpy.core.numerictypes as ntypes
from numpy import seterr, array
class TestMachAr(TestCase):
def _run_machar_highprec(self):
# Instanciate MachAr instance with high enough precision to cause
# underflow
try:
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_dtype.py | import numpy as np
from numpy.testing import *
def assert_dtype_equal(a, b):
assert_equal(a, b)
assert_equal(hash(a), hash(b),
"two equivalent types do not hash to the same value !")
def assert_dtype_not_equal(a, b):
assert_(a != b)
assert_(hash(a) != hash(b),
"two differe... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_numerictypes.py | import sys
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import numpy as np
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain array description:
Pdescr = [
('x', 'i4', (2,)),
('y', 'f8', (2, 2)),
('z', 'u1')]
# A ... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_defchararray.py | from numpy.testing import *
from numpy.core import *
import numpy as np
import sys
from numpy.core.multiarray import _vec_string
from numpy.compat import asbytes, asbytes_nested
kw_unicode_true = {'unicode': True} # make 2to3 work properly
kw_unicode_false = {'unicode': False}
class TestBasic(TestCase):
def test... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_memmap.py | from tempfile import NamedTemporaryFile, mktemp
import sys
import os
import warnings
from numpy import memmap
from numpy import arange, allclose
from numpy.testing import *
class TestMemmap(TestCase):
def setUp(self):
warnings.resetwarnings()
self.tmpfp = NamedTemporaryFile(prefix='mmap')
... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_datetime.py | from os import path
import numpy as np
from numpy.testing import *
import datetime
class TestDateTime(TestCase):
def test_creation(self):
for unit in ['Y', 'M', 'W', 'B', 'D',
'h', 'm', 's', 'ms', 'us',
'ns', 'ps', 'fs', 'as']:
dt1 = np.dtype('M8[750%s]... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_errstate.py | # The following exec statement (or something like it) is needed to
# prevent SyntaxError on Python < 2.5. Even though this is a test,
# SyntaxErrors are not acceptable; on Debian systems, they block
# byte-compilation during install and thus cause the package to fail
# to install.
import sys
if sys.version_info[:2] >=... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_numeric.py | import sys
from decimal import Decimal
import numpy as np
from numpy.core import *
from numpy.random import rand, randint, randn
from numpy.testing import *
from numpy.core.multiarray import dot as dot_
class Vec:
def __init__(self,sequence=None):
if sequence is None:
sequence=[]
self.... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/tests/test_ufunc.py | import sys
import numpy as np
from numpy.testing import *
if sys.platform == 'cli':
print "Warning: skipping numpy.core.umath_tests, not ported to IronPython yet"
else:
import numpy.core.umath_tests as umt
class TestUfunc(TestCase):
def test_reduceat_shifting_sum(self) :
L = 6
x = np.aran... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/blasdot/_dotblas.c | static char module_doc[] = "This module provides a BLAS \
optimized\nmatrix multiply, inner product and dot for numpy arrays";
#include "Python.h"
#include "npy_api.h"
#include "npy_descriptor.h"
#include "npy_defs.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#ifndef CBLAS_HEADER
#define CBLAS... | 0 |
public_repos/numpy-refactor/numpy/core | public_repos/numpy-refactor/numpy/core/blasdot/cblas.h | #ifndef CBLAS_H
#define CBLAS_H
#include <stddef.h>
/* Allow the use in C++ code. */
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Enumerated and derived types
*/
#define CBLAS_INDEX size_t /* this may vary between platforms */
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
enum CBLAS_TRANSPOSE {CblasNoT... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/diagnose.py | #!/usr/bin/env python
import os
import sys
import tempfile
def run_command(cmd):
print 'Running %r:' % (cmd)
s = os.system(cmd)
print '------'
def run():
_path = os.getcwd()
os.chdir(tempfile.gettempdir())
print '------'
print 'os.name=%r' % (os.name)
print '------'
print 'sys.plat... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/BUGS.txt | December 1, 2002:
C FILE: STRING.F
SUBROUTINE FOO
END
C END OF FILE STRING.F
does not build with
f2py -c -m string string.f
Cause: string is mapped to string_bn
**************************************************************************
August 16, 2001:
1) re in Python 2.x is **three** times slower than t... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/README.txt | ======================================================================
F2PY - Fortran to Python Interface Generator
======================================================================
Read docs/README.txt
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/cfuncs.py | #!/usr/bin/env python
"""
C declarations, CPP macros, and C functions for f2py2e.
Only required declarations/macros/functions will be used.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumP... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/setup.cfg | [bdist_rpm]
doc_files = docs/
tests/ | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/common_rules.py | #!/usr/bin/env python
"""
Build common block mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/setup.py | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/cb_rules.py | #!/usr/bin/env python
"""
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 20... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/__version__.py | major = 2
try:
from __svn_version__ import version
version_info = (major, version)
version = '%s_%s' % version_info
except (ImportError, ValueError):
version = str(major)
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/f2py_testing.py | import sys
import re
from numpy.testing.utils import jiffies, memusage
def cmdline():
m=re.compile(r'\A\d+\Z')
args = []
repeat = 1
for a in sys.argv[1:]:
if m.match(a):
repeat = eval(a)
else:
args.append(a)
f2py_opts = ' '.join(args)
return repeat,f2py_... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/NEWS.txt |
Read docs/HISTORY.txt | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/setupscons.py | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/f2py.1 | .TH "F2PY" 1
.SH NAME
f2py \- Fortran to Python interface generator
.SH SYNOPSIS
(1) To construct extension module sources:
.B f2py
[<options>] <fortran files> [[[only:]||[skip:]] <fortran functions> ] [: <fortran files> ...]
(2) To compile fortran files and build extension modules:
.B f2py
-c [<options>, <config_fc... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/info.py | """Fortran to Python Interface Generator.
"""
postpone_import = True
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/auxfuncs.py | #!/usr/bin/env python
"""
Auxiliary functions for f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) LICENSE.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/Makefile | # Makefile for f2py2e
#
# Use GNU make for making.
# $Revision: 1.46 $
# $Date: 2005/01/30 17:22:55 $
# Pearu Peterson <pearu@ioc.ee>
PYTHON=python
MAJOR=2
F2PY2E_CVSROOT=:pserver:anonymous@cens.ioc.ee:/home/cvs
SCIPY_CVSROOT=:pserver:anonymous@numpy.org:/home/cvsroot
UPLOADCMD = scp -r
UPLOADDIR = pearu@kev.ioc.ee:/... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/f2py2e.py | #!/usr/bin/env python
"""
f2py2e - Fortran to Python C/API generator. 2nd Edition.
See __usage__ below.
Copyright 1999--2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRAN... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/rules.py | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/func2subr.py | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/crackfortran.py | #!/usr/bin/env python
"""
crackfortran --- read fortran (77,90) code and extract declaration information.
Usage is explained in the comment block below.
Copyright 1999-2004 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
t... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/use_rules.py | #!/usr/bin/env python
"""
Build 'use others module data' mechanism for f2py2e.
Unfinished.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/f90mod_rules.py | #!/usr/bin/env python
"""
Build F90 module support for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 200... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/capi_maps.py | #!/usr/bin/env python
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 2005/05/06 10:57:33 $
Pearu Peterson... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/f2py/__init__.py | #!/usr/bin/env python
__all__ = ['run_main','compile','f2py_testing']
import os
import sys
import commands
import f2py2e
import f2py_testing
import diagnose
from info import __doc__
run_main = f2py2e.run_main
main = f2py2e.main
def compile(source,
modulename = 'untitled',
extra_args = '',
... | 0 |
public_repos/numpy-refactor/numpy/f2py | public_repos/numpy-refactor/numpy/f2py/src/fortranobject.c | #define FORTRANOBJECT_C
#include "fortranobject.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
This file implements: FortranObject, array_from_pyobj, copy_ND_array
Author: Pearu Peterson <pearu@cens.ioc.ee>
$Revision: 1.52 $
$Date: 2005/07/11 07:44:20 $
*/
int
F2PyDict_SetItemString(PyObject *dict, char *name... | 0 |
public_repos/numpy-refactor/numpy/f2py | public_repos/numpy-refactor/numpy/f2py/src/fortranobject.h | #ifndef Py_FORTRANOBJECT_H
#define Py_FORTRANOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "Python.h"
#ifdef FORTRANOBJECT_C
#define NO_IMPORT_ARRAY
#endif
#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
#include "numpy/arrayobject.h"
/*
* Python 3 support macros
*/
#if PY_VERSION_HEX >= 0x03000000
#define P... | 0 |
public_repos/numpy-refactor/numpy/f2py/src | public_repos/numpy-refactor/numpy/f2py/src/test/foomodule.c | /* File: foomodule.c
* Example of FortranObject usage. See also wrap.f foo.f foo90.f90.
* Author: Pearu Peterson <pearu@ioc.ee>.
* http://cens.ioc.ee/projects/f2py2e/
* $Revision: 1.2 $
* $Date: 2000/09/17 16:10:27 $
*/
#ifdef __CPLUSPLUS__
extern "C" {
#endif
#include "Python.h"
#include "fortranobject.h"
stat... | 0 |
public_repos/numpy-refactor/numpy/f2py/src | public_repos/numpy-refactor/numpy/f2py/src/test/bar.f | subroutine bar()
integer a
real*8 b,c(3)
common /foodata/ a,b,c
a = 4
b = 6.7
c(2) = 3.0
write(*,*) "bar:a=",a
write(*,*) "bar:b=",b
write(*,*) "bar:c=",c
end
| 0 |
public_repos/numpy-refactor/numpy/f2py/src | public_repos/numpy-refactor/numpy/f2py/src/test/Makefile | # -*- makefile -*-
# File: Makefile-foo
# Usage:
# make -f Makefile-foo [MODE=opt|debug]
# Notes:
# 1) You must use GNU make; try `gmake ..' if `make' fails.
# 2) This file is auto-generated with f2py (version 2.264).
# f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
# written by Pearu... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.