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/doc
public_repos/numpy-refactor/doc/pyrex/setup.py
#!/usr/bin/env python """ WARNING: this code is deprecated and slated for removal soon. See the doc/cython directory for the replacement, which uses Cython (the actively maintained version of Pyrex). Install file for example on how to use Pyrex with Numpy. For more details, see: http://www.scipy.org/Cookbook/Pyrex_...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/Makefile
all: python setup.py build_ext --inplace test: all python run_test.py .PHONY: clean clean: rm -rf *~ *.so *.c *.o build
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/c_numpy.pxd
# :Author: Travis Oliphant cdef extern from "numpy/arrayobject.h": cdef enum NPY_TYPES: NPY_BOOL NPY_BYTE NPY_UBYTE NPY_SHORT NPY_USHORT NPY_INT NPY_UINT NPY_LONG NPY_ULONG NPY_LONGLONG NPY_ULONGLONG NPY_FLOAT ...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/c_python.pxd
# -*- Mode: Python -*- Not really, but close enough # Expose as much of the Python C API as we need here cdef extern from "stdlib.h": ctypedef int size_t cdef extern from "Python.h": ctypedef int Py_intptr_t void* PyMem_Malloc(size_t) void* PyMem_Realloc(void *p, size_t n) void PyMem_Free(vo...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/notes
- cimport with a .pxd file vs 'include foo.pxi'? - the need to repeat: pyrex does NOT parse C headers.
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/run_test.py
#!/usr/bin/env python from numpyx import test test()
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/numpyx.pyx
# -*- Mode: Python -*- Not really, but close enough """WARNING: this code is deprecated and slated for removal soon. See the doc/cython directory for the replacement, which uses Cython (the actively maintained version of Pyrex). """ cimport c_python cimport c_numpy import numpy # Numpy must be initialized c_numpy.i...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/pyrex/MANIFEST
numpyx.pyx setup.py
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/swig/README
Notes for the numpy/doc/swig directory ====================================== This set of files is for developing and testing file numpy.i, which is intended to be a set of typemaps for helping SWIG interface between C and C++ code that uses C arrays and the python module NumPy. It is ultimately hoped that numpy.i wi...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/swig/Makefile
# List all of the subdirectories here for recursive make SUBDIRS = test doc # Default target .PHONY : default default: @echo "There is no default make target for this Makefile" @echo "Valid make targets are:" @echo " test - Compile and run tests of numpy.i" @echo " doc - Generate numpy.i...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/swig/numpy.i
/* -*- C -*- (not really, but good for syntax highlighting) */ #ifdef SWIGPYTHON %{ #ifndef SWIG_FILE_WITH_INIT # define NO_IMPORT_ARRAY #endif #include "stdio.h" #include <numpy/arrayobject.h> %} /**********************************************************************/ %fragment("NumPy_Backward_Compatibility", "he...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/swig/pyfragments.swg
/*-*- C -*-*/ /**********************************************************************/ /* For numpy versions prior to 1.0, the names of certain data types * are different than in later versions. This fragment provides macro * substitutions that allow us to support old and new versions of * numpy. */ %fragment("...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Matrix.cxx
#include <stdlib.h> #include <math.h> #include <iostream> #include "Matrix.h" // The following macro defines a family of functions that work with 2D // arrays with the forms // // TYPE SNAMEDet( TYPE matrix[2][2]); // TYPE SNAMEMax( TYPE * matrix, int rows, int cols); // TYPE SNAMEMin( int rows, i...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Fortran.i
// -*- c++ -*- %module Fortran %{ #define SWIG_FILE_WITH_INIT #include "Fortran.h" %} // Get the NumPy typemaps %include "../numpy.i" %init %{ import_array(); %} %define %apply_numpy_typemaps(TYPE) %apply (TYPE* IN_FARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)}; %enddef /* %apply_numpy_typ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Array1.cxx
#include "Array1.h" #include <iostream> #include <sstream> // Default/length/array constructor Array1::Array1(int length, long* data) : _ownData(false), _length(0), _buffer(0) { resize(length, data); } // Copy constructor Array1::Array1(const Array1 & source) : _length(source._length) { allocateMemory(); *t...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Tensor.cxx
#include <stdlib.h> #include <math.h> #include <iostream> #include "Tensor.h" // The following macro defines a family of functions that work with 3D // arrays with the forms // // TYPE SNAMENorm( TYPE tensor[2][2][2]); // TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num); // TYPE SNAMEMin( ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Vector.i
// -*- c++ -*- %module Vector %{ #define SWIG_FILE_WITH_INIT #include "Vector.h" %} // Get the NumPy typemaps %include "../numpy.i" %init %{ import_array(); %} %define %apply_numpy_typemaps(TYPE) %apply (TYPE IN_ARRAY1[ANY]) {(TYPE vector[3])}; %apply (TYPE* IN_ARRAY1, int DIM1) {(TYPE* series, int size)}; %appl...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Farray.h
#ifndef FARRAY_H #define FARRAY_H #include <stdexcept> #include <string> class Farray { public: // Size constructor Farray(int nrows, int ncols); // Copy constructor Farray(const Farray & source); // Destructor ~Farray(); // Assignment operator Farray & operator=(const Farray & source); // Equa...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Farray.cxx
#include "Farray.h" #include <sstream> // Size constructor Farray::Farray(int nrows, int ncols) : _nrows(nrows), _ncols(ncols), _buffer(0) { allocateMemory(); } // Copy constructor Farray::Farray(const Farray & source) : _nrows(source._nrows), _ncols(source._ncols) { allocateMemory(); *this = source; } // ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testArray.py
#! /usr/bin/env python # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListError = ValueError import Array #####...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Tensor.h
#ifndef TENSOR_H #define TENSOR_H // The following macro defines the prototypes for a family of // functions that work with 3D arrays with the forms // // TYPE SNAMENorm( TYPE tensor[2][2][2]); // TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num); // TYPE SNAMEMin( int rows, int cols, int ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/setup.py
#! /usr/bin/env python # System imports from distutils.core import * from distutils import sysconfig # Third-party modules - we depend on numpy for everything import numpy # Obtain the numpy include directory. This logic works across numpy versions. try: numpy_include = numpy.get_include() except Attribute...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Array2.cxx
#include "Array2.h" #include <sstream> // Default constructor Array2::Array2() : _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0) { } // Size/array constructor Array2::Array2(int nrows, int ncols, long* data) : _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0) { resize(nrows, ncols, data); } ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Farray.i
// -*- c++ -*- %module Farray %{ #define SWIG_FILE_WITH_INIT #include "Farray.h" %} // Get the NumPy typemaps %include "../numpy.i" // Get the STL typemaps %include "stl.i" // Handle standard exceptions %include "exception.i" %exception { try { $action } catch (const std::invalid_argument& e) { ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Vector.cxx
#include <stdlib.h> #include <math.h> #include <iostream> #include "Vector.h" // The following macro defines a family of functions that work with 1D // arrays with the forms // // TYPE SNAMELength( TYPE vector[3]); // TYPE SNAMEProd( TYPE * series, int size); // TYPE SNAMESum( int size, TYPE * series)...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Makefile
# SWIG INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i Fortran.i WRAPPERS = $(INTERFACES:.i=_wrap.cxx) PROXIES = $(INTERFACES:.i=.py ) # Default target: build the tests .PHONY : all all: $(WRAPPERS) Array1.cxx Array1.h Farray.cxx Farray.h Vector.cxx Vector.h \ Matrix.cxx Matrix.h Tensor.cxx Tensor....
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Array2.h
#ifndef ARRAY2_H #define ARRAY2_H #include "Array1.h" #include <stdexcept> #include <string> class Array2 { public: // Default constructor Array2(); // Size/array constructor Array2(int nrows, int ncols, long* data=0); // Copy constructor Array2(const Array2 & source); // Destructor ~Array2(); ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testTensor.py
#! /usr/bin/env python # System imports from distutils.util import get_platform from math import sqrt import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListErro...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testFortran.py
#! /usr/bin/env python # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListError = ValueError import Fortran ##...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Array1.h
#ifndef ARRAY1_H #define ARRAY1_H #include <stdexcept> #include <string> class Array1 { public: // Default/length/array constructor Array1(int length = 0, long* data = 0); // Copy constructor Array1(const Array1 & source); // Destructor ~Array1(); // Assignment operator Array1 & operator=(const Ar...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Matrix.i
// -*- c++ -*- %module Matrix %{ #define SWIG_FILE_WITH_INIT #include "Matrix.h" %} // Get the NumPy typemaps %include "../numpy.i" %init %{ import_array(); %} %define %apply_numpy_typemaps(TYPE) %apply (TYPE IN_ARRAY2[ANY][ANY]) {(TYPE matrix[ANY][ANY])}; %apply (TYPE* IN_ARRAY2, int DIM1, int DIM2) {(TYPE* mat...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Fortran.h
#ifndef FORTRAN_H #define FORTRAN_H #define TEST_FUNC_PROTOS(TYPE, SNAME) \ \ TYPE SNAME ## SecondElement( TYPE * matrix, int rows, int cols); \ TEST_FUNC_PROTOS(signed char , schar ) TEST_FUNC_PROTOS(unsigned char , uchar ) TEST_FUNC_PROTOS(short , short ) TEST_FUNC_PROTOS(unsigned ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Vector.h
#ifndef VECTOR_H #define VECTOR_H // The following macro defines the prototypes for a family of // functions that work with 1D arrays with the forms // // TYPE SNAMELength( TYPE vector[3]); // TYPE SNAMEProd( TYPE * series, int size); // TYPE SNAMESum( int size, TYPE * series); // void SNAMERevers...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testMatrix.py
#! /usr/bin/env python # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListError = ValueError import Matrix ###...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testFarray.py
#! /usr/bin/env python # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListError = ValueError # Add the distutil...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Fortran.cxx
#include <stdlib.h> #include <math.h> #include <iostream> #include "Fortran.h" #define TEST_FUNCS(TYPE, SNAME) \ \ TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \ TYPE result = matrix[1]; \ return result; \ } ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Array.i
// -*- c++ -*- %module Array %{ #define SWIG_FILE_WITH_INIT #include "Array1.h" #include "Array2.h" %} // Get the NumPy typemaps %include "../numpy.i" // Get the STL typemaps %include "stl.i" // Handle standard exceptions %include "exception.i" %exception { try { $action } catch (const std::invalid_ar...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Matrix.h
#ifndef MATRIX_H #define MATRIX_H // The following macro defines the prototypes for a family of // functions that work with 2D arrays with the forms // // TYPE SNAMEDet( TYPE matrix[2][2]); // TYPE SNAMEMax( TYPE * matrix, int rows, int cols); // TYPE SNAMEMin( int rows, int cols, TYPE * matrix); ...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/Tensor.i
// -*- c++ -*- %module Tensor %{ #define SWIG_FILE_WITH_INIT #include "Tensor.h" %} // Get the NumPy typemaps %include "../numpy.i" %init %{ import_array(); %} %define %apply_numpy_typemaps(TYPE) %apply (TYPE IN_ARRAY3[ANY][ANY][ANY]) {(TYPE tensor[ANY][ANY][ANY])}; %apply (TYPE* IN_ARRAY3, int DIM1, int DIM2, i...
0
public_repos/numpy-refactor/doc/swig
public_repos/numpy-refactor/doc/swig/test/testVector.py
#! /usr/bin/env python # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeError else: BadListError = ValueError import Vector ###...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/numpybook/runcode.py
# This script takes a lyx file and runs the python code in it. # Then rewrites the lyx file again. # # Each section of code portion is assumed to be in the same namespace # where a from numpy import * has been applied # # If a PYNEW inside a Note is encountered, the name space is restarted # # The output (if any) is ...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/numpybook/capi.lyx
#LyX 1.5.1 created this file. For more info see http://www.lyx.org/ \lyxformat 276 \begin_document \begin_header \textclass mybook \language english \inputencoding auto \font_roman default \font_sans default \font_typewriter default \font_default_family default \font_sc false \font_osf false \font_sf_scale 100 \font_tt...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/numpybook/numpybook.lyx
#LyX 1.5.1 created this file. For more info see http://www.lyx.org/ \lyxformat 276 \begin_document \begin_header \textclass mybook \begin_preamble \usepackage{array} % This gives us a better font in URL links (otherwise the default % MonoSpace font is bitmapped, and it looks horrible in PDF) \usepackage{courier} \...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/Figures/threefundamental.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: threefundamental.fig %%Creator: fig2dev Version 3.2 Patchlevel 4 %%CreationDate: Mon Jan 16 15:40:51 2006 %%For: oliphant@den.local.net (Travis Oliphant) %%BoundingBox: 0 0 438 162 %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/Figures/threefundamental.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 6 1950 2850 4350 3450 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 1950 2850 4350 2850 4350 3450 1950 3450 1950 2850 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 2550 2850 2550 3450 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 3150 2850 3150 3450 2 1 0 1 0 7 50 -...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/Figures/contiguous.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 6 3300 1500 10500 2250 2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 5700 1575 6900 1575 6900 2175 5700 2175 5700 1575 2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 7500 1575 8700 1575 8700 2175 7500 2175 7500 1575 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 3300 ...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/Figures/hierarchy.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: hierarchy.dia %%Creator: Dia v0.94 %%CreationDate: Wed Jan 4 16:44:07 2006 %%For: oliphant %%Orientation: Portrait %%Magnification: 1.0000 %%BoundingBox: 0 0 743 584 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.n...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/Figures/contiguous.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: contiguous.fig %%Creator: fig2dev Version 3.2 Patchlevel 4 %%CreationDate: Thu Aug 18 12:08:29 2005 %%For: oliphant@oliphant (Travis Oliphant) %%BoundingBox: 0 0 434 215 %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 se...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/comparison/timing.py
import timeit pyrex_pre = """ import numpy as N a = N.random.rand(%d,%d) import filter """ pyrex_run = """ b = filter.filter(a) """ weave_pre = """ import numpy as N a = N.random.rand(%d,%d) import filter """ weave_run = """ b = filter.filter(a) """ ctypes_pre = """ import numpy as N a = N.random.rand(%d,%d) impo...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/weave/filter.py
from scipy import weave, zeros_like def filter(a): if a.ndim != 2: raise ValueError, "a must be 2-d" code = r""" int i,j; for(i=1;i<Na[0]-1;i++) { for(j=1;j<Na[1]-1;j++) { B2(i,j) = A2(i,j) + (A2(i-1,j) + A2(i+1,j) + A2(i,j-1) + A2...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/weave/inline.py
from scipy import weave from numpy import rand, zeros_like def example1(a): if not isinstance(a, list): raise ValueError, "argument must be a list" code = r""" int i; py::tuple results(2); for (i=0; i<a.length(); i++) { a[i] = i; } ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/weave/timeme
python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/ctypes/newfile.dat
$@>@...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/ctypes/code.c
typedef struct {double real; double imag;} cdouble; typedef struct {double real; double imag;} cfloat; /* Add arrays of contiguous data */ void zadd(cdouble *a, cdouble *b, cdouble *c, long n) { while (n--) { c->real = a->real + b->real; c->imag = a->imag + b->imag; a++; b++; c++; } } void cadd(cfloat *a, ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/ctypes/filter.py
__all__ = ['filter2d'] import numpy as N import os import ctypes _path = os.path.dirname('__file__') lib = N.ctypeslib.load_library('code', _path) lib.dfilter2d.restype = None lib.dfilter2d.argtypes = [N.ctypeslib.ndpointer(float, ndim=2, flags='aligned'), ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/ctypes/interface.py
__all__ = ['add', 'filter2d'] import numpy as N import os import ctypes _path = os.path.dirname('__file__') lib = N.ctypeslib.load_library('code', _path) _typedict = {'zadd' : complex, 'sadd' : N.single, 'cadd' : N.csingle, 'dadd' : float} for name in _typedict.keys(): val =...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/ctypes/timeme
python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/add.pyf
! -*- f90 -*- ! Note: the context of this file is case sensitive. python module add ! in interface ! in :add subroutine zadd(a,b,c,n) ! in :add:add.f double complex dimension(n) :: a double complex dimension(n) :: b double complex intent(out), dimension(n) :: c ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/filtermodule.c
/* File: filtermodule.c * This file is auto-generated with f2py (version:2_3032). * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, * written by Pearu Peterson <pearu@cens.ioc.ee>. * See http://cens.ioc.ee/projects/f2py2e/ * Generation date: Thu Aug 17 12:03:28 2006 * $Revision:$ * $Date:...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/add.f
C SUBROUTINE ZADD(A,B,C,N) C DOUBLE COMPLEX A(*) DOUBLE COMPLEX B(*) DOUBLE COMPLEX C(*) INTEGER N DO 20 J = 1, N C(J) = A(J) + B(J) 20 CONTINUE END SUBROUTINE CADD(A,B,C,N) C COMPLEX A(*) COMPLEX B(*) COMPLEX C(*) INTEGER N DO 2...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/filter.f
SUBROUTINE DFILTER2D(A,B,M,N) C DOUBLE PRECISION A(M,N) DOUBLE PRECISION B(M,N) INTEGER N, M CF2PY INTENT(OUT) :: B CF2PY INTENT(HIDE) :: N CF2PY INTENT(HIDE) :: M DO 20 I = 2,M-1 DO 40 J=2,N-1 B(I,J) = A(I,J) + $ (A(I-1,J)+A(I+1,J) + $ ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/timeme
python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b=N.zeros_like(a); none = filter.DFILTER2D(a,b)"
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/f2py/filter.pyf
! -*- f90 -*- ! Note: the context of this file is case sensitive. python module filter ! in interface ! in :filter subroutine dfilter2d(a,b,m,n) ! in :filter:filter.f double precision dimension(m,n) :: a double precision dimension(m,n),intent(out),depend(m,n) :: b i...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/add.pyx
# -*- Mode: Python -*- Not really, but close enough cimport c_numpy from c_numpy cimport import_array, ndarray, npy_intp, npy_cdouble, \ npy_cfloat, NPY_DOUBLE, NPY_CDOUBLE, NPY_FLOAT, \ NPY_CFLOAT #We need to initialize NumPy import_array() def zadd(object ao, object bo): cdef ndarray c, a, b cde...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/setup.py
#!/usr/bin/env python from distutils.core import setup from distutils.extension import Extension import numpy # Define a pyrex-based extension module, using the generated sources if pyrex from Pyrex.Distutils import build_ext pyx_sources = ['add.pyx'] cmdclass = {'build_ext': build_ext} pyx_ext = Extension('add...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/add.c
/* Generated by Pyrex 0.9.4.1 on Thu Aug 17 02:11:41 2006 */ #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif __PYX_EXTERN_C double pow(double, double); #include "nu...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/c_numpy.pxd
# :Author: Robert Kern # :Copyright: 2004, Enthought, Inc. # :License: BSD Style cdef extern from "numpy/arrayobject.h": cdef enum NPY_TYPES: NPY_BOOL NPY_BYTE NPY_UBYTE NPY_SHORT NPY_USHORT NPY_INT NPY_UINT NPY_LONG NPY_ULONG ...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/filter.pyx
# -*- Mode: Python -*- Not really, but close enough cimport c_numpy from c_numpy cimport import_array, ndarray, npy_intp,\ NPY_DOUBLE, NPY_CDOUBLE, NPY_FLOAT, \ NPY_CFLOAT, NPY_ALIGNED #We need to initialize NumPy import_array() def filter(object ao): cdef ndarray a, b cdef npy_intp i, j, M, N, S0...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/filter.c
/* Generated by Pyrex 0.9.4.1 on Thu Aug 17 02:11:42 2006 */ #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif __PYX_EXTERN_C double pow(double, double); #include "nu...
0
public_repos/numpy-refactor/doc/numpybook/comparison
public_repos/numpy-refactor/doc/numpybook/comparison/pyrex/timeme
python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/tip.xfig.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 1 3 0 1 1 1 50 -1 20 0.000 1 0.0000 3600 2400 660 660 3600 2400 4260 2400 1 3 0 1 7 7 51 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400 4 0 7 50 -1 2 92 0.0000 4 960 390 3450 2850 i\001
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/note.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: note.fig %%Creator: fig2dev Version 3.2 Patchlevel 4 %%CreationDate: Wed Aug 24 03:03:42 2005 %%For: oliphant@den.local.net (Travis Oliphant) %%BoundingBox: 0 0 88 88 %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgr...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/warning.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: warning.fig %%Creator: fig2dev Version 3.2 Patchlevel 4 %%CreationDate: Wed Aug 24 00:00:52 2005 %%For: oliphant@den.local.net (Travis Oliphant) %%BoundingBox: 0 0 88 88 %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 se...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/tip.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 0 32 #e0f4ff 0 33 #000000 1 3 0 1 1 1 50 -1 20 0.000 1 0.0000 3600 2400 660 660 3600 2400 4260 2400 1 3 0 1 7 7 51 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400 4 0 7 50 -1 2 110 0.0000 4 1140 465 3384 2940 i\001
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/tip.eps
%!PS-Adobe-2.0 EPSF-2.0 %%Title: tip.fig %%Creator: fig2dev Version 3.2 Patchlevel 4 %%CreationDate: Tue Aug 23 23:51:46 2005 %%For: oliphant@den.local.net (Travis Oliphant) %%BoundingBox: 0 0 88 88 %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgra...
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/warning.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 0 32 #e0f4ff 0 33 #ffd2d2 0 34 #fcf6dc 1 3 0 1 20 20 50 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400 2 2 0 1 7 7 50 -1 20 0.000 0 0 -1 0 0 5 3096 2268 4104 2268 4104 2532 3096 2532 3096 2268
0
public_repos/numpy-refactor/doc/numpybook
public_repos/numpy-refactor/doc/numpybook/graphics/note.fig
#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 0 32 #e0f4ff 0 33 #ffd2d2 0 34 #fcf6dc 2 3 0 1 31 31 52 -1 20 0.000 0 0 -1 0 0 5 3600 1680 2880 2400 3600 3120 4320 2400 3600 1680 2 3 0 5 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 3600 1860 3060 2400 3600 2940 4140 2400 3600 1860
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cdoc/numpyfilter.py
#!/usr/bin/env python """ numpyfilter.py INPUTFILE Interpret C comments as ReStructuredText, and replace them by the HTML output. Also, add Doxygen /** and /**< syntax automatically where appropriate. """ import sys import re import os import textwrap import optparse import cPickle as pickle CACHE_FILE = 'build/rst-...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cdoc/README
cdoc ==== This is a simple Doxygen project for building Numpy C code documentation, with docstrings extracted from the C sources themselves. The understood syntax for documentation in the C source is /* * Some text in reStructuredText format */ int function_to_which_the_text_applies() { ...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cdoc/Makefile
all: build build: doxygen .PHONY: all build
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cdoc/Doxyfile
# Doxyfile 1.6.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += v...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/README.txt
================== NumPy and Cython ================== This directory contains a small example of how to use NumPy and Cython together. While much work is planned for the Summer of 2008 as part of the Google Summer of Code project to improve integration between the two, even today Cython can be used effectively to w...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/setup.py
#!/usr/bin/env python """Install file for example on how to use Cython with Numpy. Note: Cython is the successor project to Pyrex. For more information, see http://cython.org. """ from distutils.core import setup from distutils.extension import Extension import numpy # We detect whether Cython is available, so tha...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/Makefile
# Simple makefile to quickly access handy build commands for Cython extension # code generation. Note that the actual code to produce the extension lives in # the setup.py file, this Makefile is just meant as a command # convenience/reminder while doing development. help: @echo "Numpy/Cython tasks. Available tasks:...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/c_numpy.pxd
# :Author: Travis Oliphant # API declaration section. This basically exposes the NumPy C API to # Pyrex/Cython programs. cdef extern from "numpy/arrayobject.h": cdef enum NPY_TYPES: NPY_BOOL NPY_BYTE NPY_UBYTE NPY_SHORT NPY_USHORT NPY_INT NPY_UINT ...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/c_python.pxd
# :Author: Robert Kern # :Copyright: 2004, Enthought, Inc. # :License: BSD Style cdef extern from "Python.h": # Not part of the Python API, but we might as well define it here. # Note that the exact type doesn't actually matter for Pyrex. ctypedef int size_t # Some type declarations we need ...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/run_test.py
#!/usr/bin/env python from numpyx import test test()
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/numpyx.pyx
# -*- Mode: Python -*- Not really, but close enough """Cython access to Numpy arrays - simple example. """ ############################################################################# # Load C APIs declared in .pxd files via cimport # # A 'cimport' is similar to a Python 'import' statement, but it provides access #...
0
public_repos/numpy-refactor/doc
public_repos/numpy-refactor/doc/cython/MANIFEST
numpyx.pyx setup.py
0
public_repos
public_repos/infra-test/poetry.lock
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" version = "3.8.6" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.6" files = [ {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl",...
0
public_repos
public_repos/infra-test/Dockerfile
FROM python:3.11-slim RUN pip install poetry==1.6.1 RUN poetry config virtualenvs.create false WORKDIR /code COPY ./pyproject.toml ./poetry.lock* ./ COPY ./packages ./packages RUN poetry install --no-interaction --no-ansi --no-root COPY ./app ./app RUN poetry install --no-interaction --no-ansi EXPOSE 8080 CMD...
0
public_repos
public_repos/infra-test/pyproject.toml
[tool.poetry] name = "__app_name__" version = "0.1.0" description = "" authors = ["Your Name <you@example.com>"] readme = "README.md" [tool.poetry.dependencies] python = "^3.11" uvicorn = "^0.23.2" langserve = {extras = ["server"], version = ">=0.0.22"} pirate-speak = {path = "packages/pirate-speak", develop = true} ...
0
public_repos
public_repos/infra-test/README.md
# mukil-test ## Installation Install the LangChain CLI if you haven't yet ```bash pip install -U langchain-cli ``` ## Adding packages ```bash # adding packages from # https://github.com/langchain-ai/langchain/tree/master/templates langchain app add $PROJECT_NAME # adding custom GitHub repo packages langchain app...
0
public_repos/infra-test
public_repos/infra-test/app/server.py
from fastapi import FastAPI from langserve import add_routes app = FastAPI() # Edit this to add the chain you want to add from pirate_speak.chain import chain as pirate_speak_chain add_routes(app, pirate_speak_chain, path="/pirate-speak") if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0....
0
public_repos/infra-test/packages
public_repos/infra-test/packages/pirate-speak/poetry.lock
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" version = "3.8.6" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.6" files = [ {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl",...
0
public_repos/infra-test/packages
public_repos/infra-test/packages/pirate-speak/pyproject.toml
[tool.poetry] name = "pirate-speak" version = "0.0.1" description = "" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = ">=0.0.325" openai = "^0.28.1" [tool.poetry.group.dev.dependencies] langchain-cli = ">=0.0.15" fastapi = "^0.104.0" sse-starlette = "^1.6.5" [tool.la...
0
public_repos/infra-test/packages
public_repos/infra-test/packages/pirate-speak/README.md
# pirate-speak This template converts user input into pirate speak. ## Environment Setup Set the `OPENAI_API_KEY` environment variable to access the OpenAI models. ## Usage To use this package, you should first have the LangChain CLI installed: ```shell pip install -U langchain-cli ``` To create a new LangChain...
0
public_repos/infra-test/packages
public_repos/infra-test/packages/pirate-speak/LICENSE
MIT License Copyright (c) 2023 LangChain, Inc. 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, publish, d...
0
public_repos/infra-test/packages/pirate-speak
public_repos/infra-test/packages/pirate-speak/pirate_speak/chain.py
from langchain.chat_models import ChatOpenAI from langchain.prompts import ChatPromptTemplate _prompt = ChatPromptTemplate.from_messages( [ ( "system", "Translate user input into pirate speak", ), ("human", "{text}"), ] ) _model = ChatOpenAI() # if you update th...
0
public_repos
public_repos/langserve-replit-template/poetry.lock
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" version = "3.8.6" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.6" files = [ {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl",...
0