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 | public_repos/numpy/.spin/cmds.py | import os
import shutil
import sys
import argparse
import tempfile
import pathlib
import shutil
import json
import pathlib
import importlib
import subprocess
import click
from spin import util
from spin.cmds import meson
# Check that the meson git submodule is present
curdir = pathlib.Path(__file__).parent
meson_imp... | 0 |
public_repos/numpy | public_repos/numpy/.spin/LICENSE | BSD 3-Clause License
Copyright (c) 2021--2022, Scientific Python project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | 0 |
public_repos/numpy | public_repos/numpy/tools/changelog.py | #!/usr/bin/env python3
"""
Script to generate contributor and pull request lists
This script generates contributor and pull request lists for release
changelogs using Github v3 protocol. Use requires an authentication token in
order to have sufficient bandwidth, you can get one following the directions at
`<https://he... | 0 |
public_repos/numpy | public_repos/numpy/tools/check_installed_files.py | """
Check if all the test and .pyi files are installed after building.
Examples::
$ python check_installed_files.py install_dirname
install_dirname:
the relative path to the directory where NumPy is installed after
building and running `meson install`.
Notes
=====
The script wil... | 0 |
public_repos/numpy | public_repos/numpy/tools/commitstats.py | # Run svn log -l <some number>
import re
import numpy as np
import os
names = re.compile(r'r\d+\s\|\s(.*)\s\|\s200')
def get_count(filename, repo):
mystr = open(filename).read()
result = names.findall(mystr)
u = np.unique(result)
count = [(x, result.count(x), repo) for x in u]
return count
comm... | 0 |
public_repos/numpy | public_repos/numpy/tools/linter.py | import os
import sys
import subprocess
from argparse import ArgumentParser
from git import Repo, exc
CONFIG = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'lint_diff.ini',
)
# NOTE: The `diff` and `exclude` options of pycodestyle seem to be
# incompatible, so instead just exclude the ne... | 0 |
public_repos/numpy | public_repos/numpy/tools/replace_old_macros.sed | # Replaces the macros in old_defines.h by current versions
# Can be run as
#
# sed -i -f replace_old_macros.sed <file-paths>
#
# or
#
# find . -name '*.[c,h]' -exec sed -i -f replace_old_macros.sed {} + ;
#
# This script is pretty reliable, but the diff should still
# be checked after running it to make sure that noth... | 0 |
public_repos/numpy | public_repos/numpy/tools/refguide_check.py | #!/usr/bin/env python3
"""
refguide_check.py [OPTIONS] [-- ARGS]
- Check for a NumPy submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
- Check docstring examples
- Check example blocks in RST files
Example of usage::
$ python refguide_check.py optimize... | 0 |
public_repos/numpy | public_repos/numpy/tools/openblas_support.py | import glob
import hashlib
import os
import platform
import sysconfig
import sys
import shutil
import tarfile
import textwrap
import zipfile
from tempfile import mkstemp, gettempdir
from urllib.request import urlopen, Request
from urllib.error import HTTPError
OPENBLAS_V = '0.3.23.dev'
OPENBLAS_LONG = 'v0.3.23-293-gc... | 0 |
public_repos/numpy | public_repos/numpy/tools/download-wheels.py | #!/usr/bin/env python3
"""
Script to download NumPy wheels from the Anaconda staging area.
Usage::
$ ./tools/download-wheels.py <version> -w <optional-wheelhouse>
The default wheelhouse is ``release/installers``.
Dependencies
------------
- beautifulsoup4
- urllib3
Examples
--------
While in the repository r... | 0 |
public_repos/numpy | public_repos/numpy/tools/list_installed_dll_dependencies_cygwin.sh | #!/bin/dash
# Check permissions and dependencies on installed DLLs
# DLLs need execute permissions to be used
# DLLs must be able to find their dependencies
# This checks both of those, then does a direct test
# The best way of checking whether a C extension module is importable
# is trying to import it. The rest is t... | 0 |
public_repos/numpy | public_repos/numpy/tools/functions_missing_types.py | #!/usr/bin/env python
"""Find the functions in a module missing type annotations.
To use it run
./functions_missing_types.py <module>
and it will print out a list of functions in the module that don't
have types.
"""
import argparse
import ast
import importlib
import os
NUMPY_ROOT = os.path.dirname(os.path.join(
... | 0 |
public_repos/numpy | public_repos/numpy/tools/list_numpy_dlls.sh | #!/bin/dash
# Print the list of dlls installed by NumPy
py_ver=${1}
site_packages=`python${py_ver} -m pip show numpy | \
grep Location | cut -d " " -f 2 -`;
dll_list=`for name in $(python${py_ver} -m pip show -f numpy | \
grep -E -e '\.dll$'); do echo ${site_packages}/${name}; done`
echo ${dll_list}
| 0 |
public_repos/numpy | public_repos/numpy/tools/find_deprecated_escaped_characters.py | #!/usr/bin/env python3
r"""
Look for escape sequences deprecated in Python 3.6.
Python 3.6 deprecates a number of non-escape sequences starting with '\' that
were accepted before. For instance, '\(' was previously accepted but must now
be written as '\\(' or r'\('.
"""
def main(root):
"""Find deprecated escape ... | 0 |
public_repos/numpy | public_repos/numpy/tools/rebase_installed_dlls_cygwin.sh | #!/bin/dash
# Rebase the dlls installed by NumPy
py_ver=${1}
numpy_dlls="`/bin/dash tools/list_numpy_dlls.sh ${py_ver}`"
/usr/bin/rebase --verbose --database --oblivious ${numpy_dlls}
/usr/bin/rebase --verbose --info ${numpy_dlls}
| 0 |
public_repos/numpy | public_repos/numpy/tools/lint_diff.ini | [pycodestyle]
max_line_length = 79
statistics = True
ignore = E121,E122,E123,E125,E126,E127,E128,E226,E241,E251,E265,E266,E302,E402,E704,E712,E721,E731,E741,W291,W293,W391,W503,W504
exclude = numpy/__config__.py,numpy/typing/tests/data,.spin/cmds.py
| 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/cirrus_wheels.yml | build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel
cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"
######################################################################
# Build linux_aarch64 natively
##########... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/cirrus_arm.yml | modified_clone: &MODIFIED_CLONE
# makes sure that for a PR the CI runs against a merged main
clone_script: |
if [ -z "$CIRRUS_PR" ]; then
# if you're not in a PR then clone against the branch name that was pushed to.
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/test_all_newsfragments_used.py | #!/usr/bin/env python3
import sys
import toml
import os
def main():
path = toml.load("pyproject.toml")["tool"]["towncrier"]["directory"]
fragments = os.listdir(path)
fragments.remove("README.rst")
fragments.remove("template.rst")
if fragments:
print("The following files were not found by... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/push_docs_to_repo.py | #!/usr/bin/env python3
import argparse
import subprocess
import tempfile
import os
import sys
import shutil
parser = argparse.ArgumentParser(
description='Upload files to a remote repo, replacing existing content'
)
parser.add_argument('dir', help='directory of which content will be uploaded')
parser.add_argumen... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/_blis_debian.pc | libdir=/usr/lib/x86_64-linux-gnu/blis-pthread/
includedir=/usr/include/x86_64-linux-gnu/blis-pthread
Name: BLIS
Description: BLAS-like Library Instantiation Software Framework - specific to NumPy CI job, needed until Debian ships blis.pc (see .github/workflows/linux_blas.yml)
Version: 0.9.0-numpy-ci
Libs: -L${libdir} ... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/ci/run_32_bit_linux_docker.sh | set -xe
git config --global --add safe.directory /numpy
cd /numpy
/opt/python/cp39-cp39/bin/python -mvenv venv
source venv/bin/activate
python3 -m pip install ninja scipy-openblas32 spin
python3 -m pip install -r test_requirements.txt
echo CFLAGS \$CFLAGS
spin config-openblas --with-scipy-openblas=32
export PKG_CONFIG... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/cibw_test_command.sh | # This script is used by .github/workflows/wheels.yml to run the full test
# suite, checks for lincense inclusion and that the openblas version is correct.
set -xe
PROJECT_DIR="$1"
python -m pip install threadpoolctl
python -c "import numpy; numpy.show_config()"
if [[ $RUNNER_OS == "Windows" ]]; then
# GH 20391
... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/repair_windows.sh | set -xe
WHEEL="$1"
DEST_DIR="$2"
# create a temporary directory in the destination folder and unpack the wheel
# into there
pushd $DEST_DIR
mkdir -p tmp
pushd tmp
wheel unpack $WHEEL
pushd numpy*
# To avoid DLL hell, the file name of libopenblas that's being vendored with
# the wheel has to be name-mangled. delvewhe... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/check_license.py | #!/usr/bin/env python
"""
check_license.py [MODULE]
Check the presence of a LICENSE.txt in the installed module directory,
and that it appears to contain text prevalent for a NumPy binary
distribution.
"""
import sys
import re
import argparse
import pathlib
def check_text(text):
ok = "Copyright (c)" in text and... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/LICENSE_linux.txt |
----
This binary distribution of NumPy also bundles the following software:
Name: OpenBLAS
Files: numpy.libs/libopenblas*.so
Description: bundled as a dynamically linked library
Availability: https://github.com/OpenMathLib/OpenBLAS/
License: BSD-3-Clause
Copyright (c) 2011-2014, The OpenBLAS Project
All rights ... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/LICENSE_osx.txt |
----
This binary distribution of NumPy also bundles the following software:
Name: OpenBLAS
Files: numpy/.dylibs/libopenblas*.so
Description: bundled as a dynamically linked library
Availability: https://github.com/OpenMathLib/OpenBLAS/
License: BSD-3-Clause
Copyright (c) 2011-2014, The OpenBLAS Project
All right... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/LICENSE_win32.txt |
----
This binary distribution of NumPy also bundles the following software:
Name: OpenBLAS
Files: numpy.libs\libopenblas*.dll
Description: bundled as a dynamically linked library
Availability: https://github.com/OpenMathLib/OpenBLAS/
License: BSD-3-Clause
Copyright (c) 2011-2014, The OpenBLAS Project
All rights... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/cibw_before_build.sh | set -xe
PROJECT_DIR="$1"
PLATFORM=$(PYTHONPATH=tools python -c "import openblas_support; print(openblas_support.get_plat())")
# Update license
echo "" >> $PROJECT_DIR/LICENSE.txt
echo "----" >> $PROJECT_DIR/LICENSE.txt
echo "" >> $PROJECT_DIR/LICENSE.txt
cat $PROJECT_DIR/LICENSES_bundled.txt >> $PROJECT_DIR/LICENSE.t... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/gfortran_utils.sh | # This file is vendored from github.com/MacPython/gfortran-install It is
# licensed under BSD-2 which is copied as a comment below
# Copyright 2016-2021 Matthew Brett, Isuru Fernando, Matti Picus
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/wheels/upload_wheels.sh | set_travis_vars() {
# Set env vars
echo "TRAVIS_EVENT_TYPE is $TRAVIS_EVENT_TYPE"
echo "TRAVIS_TAG is $TRAVIS_TAG"
if [[ "$TRAVIS_EVENT_TYPE" == "push" && "$TRAVIS_TAG" == v* ]]; then
IS_PUSH="true"
else
IS_PUSH="false"
fi
if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
IS_SC... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/swig/README | Notes for the numpy/tools/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.... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/swig/Makefile | # List all of the subdirectories here for recursive make
SUBDIRS = test
# 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 doc... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/swig/numpy.i | /* -*- C -*- (not really, but good for syntax highlighting) */
/*
* Copyright (c) 2005-2015, NumPy Developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/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.
*/
/**********... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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 slices, int rows, int cols);
// TYPE SNAMEMin(... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/ArrayZ.h | #ifndef ARRAYZ_H
#define ARRAYZ_H
#include <stdexcept>
#include <string>
#include <complex>
class ArrayZ
{
public:
// Default/length/array constructor
ArrayZ(int length = 0, std::complex<double>* data = 0);
// Copy constructor
ArrayZ(const ArrayZ & source);
// Destructor
~ArrayZ();
// Assignment ope... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/testArray.py | #!/usr/bin/env python3
# System imports
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/tools/swig | public_repos/numpy/tools/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 slices, int rows, int cols);
// TYPE SNAMEMin( int slices, int rows,... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/setup.py | #!/usr/bin/env python3
# System imports
from distutils.core import Extension, setup
# Third-party modules - we depend on numpy for everything
import numpy
# Obtain the numpy include directory.
numpy_include = numpy.get_include()
# Array extension module
_Array = Extension("_Array",
["Array_wrap.cx... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testFlat.py | #!/usr/bin/env python3
# System imports
import sys
import unittest
import struct
# 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 Flat
###########################################... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/Makefile | # SWIG
INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i Fortran.i Flat.i
WRAPPERS = $(INTERFACES:.i=_wrap.cxx)
PROXIES = $(INTERFACES:.i=.py )
# Default target: build the tests
.PHONY : all
all: $(WRAPPERS) Array1.cxx Array1.h Array2.cxx Array2.h ArrayZ.cxx ArrayZ.h \
Farray.cxx Farray.h Vector.c... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/testSuperTensor.py | #!/usr/bin/env python3
# System imports
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 SuperTensor
###################################################... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/SuperTensor.i | // -*- c++ -*-
%module SuperTensor
%{
#define SWIG_FILE_WITH_INIT
#include "SuperTensor.h"
%}
// Get the NumPy typemaps
%include "../numpy.i"
%init %{
import_array();
%}
%define %apply_numpy_typemaps(TYPE)
%apply (TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) {(TYPE supertensor[ANY][ANY][ANY][ANY])};
%apply (TYPE* IN_ARRA... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testTensor.py | #!/usr/bin/env python3
# System imports
from math import sqrt
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 Tensor
######################... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testFortran.py | #!/usr/bin/env python3
# System imports
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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/SuperTensor.cxx | #include <stdlib.h>
#include <math.h>
#include <iostream>
#include "SuperTensor.h"
// The following macro defines a family of functions that work with 3D
// arrays with the forms
//
// TYPE SNAMENorm( TYPE supertensor[2][2][2][2]);
// TYPE SNAMEMax( TYPE * supertensor, int cubes, int slices, int rows, int... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testMatrix.py | #!/usr/bin/env python3
# System imports
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/tools/swig | public_repos/numpy/tools/swig/test/Flat.cxx | #include <stdlib.h>
#include <math.h>
#include <iostream>
#include "Flat.h"
// The following macro defines a family of functions that work with 1D
// arrays with the forms
//
// void SNAMEProcess(TYPE * array, int size);
//
// for any specified type TYPE (for example: short, unsigned int, long
// long, etc.) with... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testFarray.py | #!/usr/bin/env python3
# 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 distutils... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/Array.i | // -*- c++ -*-
%module Array
%{
#define SWIG_FILE_WITH_INIT
#include "Array1.h"
#include "Array2.h"
#include "ArrayZ.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 (c... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/Flat.h | #ifndef FLAT_H
#define FLAT_H
// The following macro defines the prototypes for a family of
// functions that work with arrays with the forms
//
// void SNAMEProcess(TYPE * array, int size);
//
// for any specified type TYPE (for example: short, unsigned int, long
// long, etc.) with given short name SNAME (for e... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/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/tools/swig | public_repos/numpy/tools/swig/test/Flat.i | // -*- c++ -*-
%module Flat
%{
#define SWIG_FILE_WITH_INIT
#include "Flat.h"
%}
// Get the NumPy typemaps
%include "../numpy.i"
%init %{
import_array();
%}
%define %apply_numpy_typemaps(TYPE)
%apply (TYPE* INPLACE_ARRAY_FLAT, int DIM_FLAT) {(TYPE* array, int size)};
%enddef /* %apply_numpy_typemaps() macro *... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/SuperTensor.h | #ifndef SUPERTENSOR_H
#define SUPERTENSOR_H
// The following macro defines the prototypes for a family of
// functions that work with 4D arrays with the forms
//
// TYPE SNAMENorm( TYPE supertensor[2][2][2][2]);
// TYPE SNAMEMax( TYPE * supertensor, int cubes, int slices, int rows, int cols);
// TYPE ... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/ArrayZ.cxx | #include "ArrayZ.h"
#include <iostream>
#include <sstream>
// Default/length/array constructor
ArrayZ::ArrayZ(int length, std::complex<double>* data) :
_ownData(false), _length(0), _buffer(0)
{
resize(length, data);
}
// Copy constructor
ArrayZ::ArrayZ(const ArrayZ & source) :
_length(source._length)
{
alloca... | 0 |
public_repos/numpy/tools/swig | public_repos/numpy/tools/swig/test/testVector.py | #!/usr/bin/env python3
# System imports
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/tools | public_repos/numpy/tools/c_coverage/HOWTO_C_COVERAGE.txt | ===============
C coverage tool
===============
This directory contains a tool to generate C code-coverage reports
using valgrind's callgrind tool.
Prerequisites
-------------
* `Valgrind <https://valgrind.org/>`_ (3.5.0 tested, earlier
versions may work)
* `Pygments <https://pygments.org/>`_ (0.11 or later re... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/c_coverage/c_coverage_report.py | #!/usr/bin/env python3
"""
A script to create C code-coverage reports based on the output of
valgrind's callgrind tool.
"""
import os
import re
import sys
from xml.sax.saxutils import quoteattr, escape
try:
import pygments
if tuple([int(x) for x in pygments.__version__.split('.')]) < (0, 11):
raise Im... | 0 |
public_repos/numpy/tools | public_repos/numpy/tools/c_coverage/c_coverage_collect.sh | #!/usr/bin/env bash
valgrind --tool=callgrind --compress-strings=no --compress-pos=no --collect-jumps=yes "$@"
| 0 |
public_repos/numpy/branding | public_repos/numpy/branding/logo/logoguidelines.md | # NumPy Logo Guidelines
These guidelines are meant to help keep the NumPy logo consistent and recognizable across all its uses. They also provide a common language for referring to the logos and their components.
The primary logo is the horizontal option (logomark and text next to each other) and the secondary logo is... | 0 |
public_repos/numpy/branding/logo | public_repos/numpy/branding/logo/logomark/numpylogoicon.svg | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#4DABCF;}.cls-2{fill:#4D77CF;}</style></defs><g id="Layer_1" data-name="Layer 1"><polygon class="cls-1" points="220.93 127.14 151.77 92.23 75.87 130.11 146.9 165.78 220.93 127.14"/><polygon class="cls-1" points="252.63 143.14 325.14 ... | 0 |
public_repos/numpy/branding/logo | public_repos/numpy/branding/logo/secondary/numpylogo2.svg | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#4D77CF;}.cls-2{fill:#4DABCF;}</style></defs><g id="Layer_1" data-name="Layer 1"><path class="cls-1" d="M69.36,351.63a5.46,5.46,0,0,1,1.59.44,5.58,5.58,0,0,1,1.37.92,17.85,17.85,0,0,1,1.48,1.6l41,51.84c-.16-1.66-.28-3.27-.36-4.82s-.1... | 0 |
public_repos/numpy/branding/logo | public_repos/numpy/branding/logo/primary/numpylogo.svg | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 721.86 324.74"><defs><style>.cls-1{fill:#4D77CF;}.cls-2{fill:#4DABCF;}</style></defs><g id="Layer_1" data-name="Layer 1"><path class="cls-1" d="M299.23,125a5.76,5.76,0,0,1,1.62.45,5.58,5.58,0,0,1,1.38.93,17,17,0,0,1,1.49,1.62l41.51,52.47c-.17-1.67-.28-3.31-.36-4.88s-... | 0 |
public_repos/numpy | public_repos/numpy/doc/make.bat | @echo off
pushd %~dp0
:: Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=LANG=C sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if defined SPHINXOPTS goto skipopts
set SPHINXOPTS=-W --keep-going -d build/doctrees %SPHINXOPTS% source
set DOXYGEN=doxygen
set FILES=
:skipopts
i... | 0 |
public_repos/numpy | public_repos/numpy/doc/C_STYLE_GUIDE.rst |
The "NumPy C Style Guide" at this page has been superseded by
"NEP 45 β C Style Guide" at https://numpy.org/neps/nep-0045-c_style_guide.html
| 0 |
public_repos/numpy | public_repos/numpy/doc/TESTS.rst | NumPy/SciPy testing guidelines
==============================
.. contents::
Introduction
''''''''''''
Until the 1.15 release, NumPy used the `nose`_ testing framework, it now uses
the `pytest`_ framework. The older framework is still maintained in order to
support downstream projects that use the old numpy framewor... | 0 |
public_repos/numpy | public_repos/numpy/doc/Py3K.rst | .. -*-rst-*-
*********************************************
Developer notes on the transition to Python 3
*********************************************
:date: 2010-07-11
:author: Charles R. Harris
:author: Pauli Virtanen
General
=======
NumPy has now been ported to Python 3.
Some glitches may still be present; howe... | 0 |
public_repos/numpy | public_repos/numpy/doc/BRANCH_WALKTHROUGH.rst | This guide contains a walkthrough of branching NumPy 1.21.x on Linux. The
commands can be copied into the command line, but be sure to replace 1.21 and
1.22 by the correct versions. It is good practice to make ``.mailmap`` as
current as possible before making the branch, that may take several weeks.
This should be re... | 0 |
public_repos/numpy | public_repos/numpy/doc/conftest.py | """
Pytest configuration and fixtures for the Numpy test suite.
"""
import pytest
import numpy
import matplotlib
import doctest
matplotlib.use('agg', force=True)
# Ignore matplotlib output such as `<matplotlib.image.AxesImage at
# 0x7f956908c280>`. doctest monkeypatching inspired by
# https://github.com/wooyek/pytest... | 0 |
public_repos/numpy | public_repos/numpy/doc/Makefile | # Makefile for Sphinx documentation
#
# PYVER needs to be major.minor, just "3" doesn't work - it will result in
# issues with the amendments to PYTHONPATH and install paths (see DIST_VARS).
# Use explicit "version_info" indexing since make cannot handle colon characters, and
# evaluate it now to allow easier debuggi... | 0 |
public_repos/numpy | public_repos/numpy/doc/HOWTO_RELEASE.rst | These instructions give an overview of what is necessary to build binary
releases for NumPy.
Current build and release info
==============================
Useful info can be found in the following locations:
* **Source tree**
- `INSTALL.rst <https://github.com/numpy/numpy/blob/main/INSTALL.rst>`_
- `pavement.py... | 0 |
public_repos/numpy | public_repos/numpy/doc/EXAMPLE_DOCSTRING.rst | .. Here follows an example docstring for a C-function. Note that the
signature is given. This is done only for functions written is C,
since Python cannot find their signature by inspection. For all
other functions, start with the one line description.
multivariate_normal(mean, cov[, shape])
Draw samples... | 0 |
public_repos/numpy | public_repos/numpy/doc/records.rst |
The ndarray supports records intrinsically. None of the default
descriptors have fields defined, but you can create new descriptors
easily. The ndarray even supports nested arrays of records inside of
a record. Any record that the array protocol can describe can be
represented. The ndarray also supports partial fi... | 0 |
public_repos/numpy | public_repos/numpy/doc/HOWTO_DOCUMENT.rst | This document has been replaced, see https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
| 0 |
public_repos/numpy | public_repos/numpy/doc/postprocess.py | #!/usr/bin/env python3
"""
Post-processes HTML and Latex files output by Sphinx.
"""
def main():
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('mode', help='file mode', choices=('html', 'tex'))
parser.add_argument('file', nargs='+', help='input file(s)')
... | 0 |
public_repos/numpy | public_repos/numpy/doc/ufuncs.rst | Buffered general ufunc explanation
==================================
.. note::
This was implemented already, but the notes are kept here for historical
and explanatory purposes.
We need to optimize the section of ufunc code that handles mixed-type
and misbehaved arrays. In particular, we need to fix it so that... | 0 |
public_repos/numpy | public_repos/numpy/doc/RELEASE_WALKTHROUGH.rst | This is a walkthrough of the NumPy 1.21.0 release on Linux, modified for
building with GitHub Actions and cibuildwheels and uploading to the
`anaconda.org staging repository for NumPy <https://anaconda.org/multibuild-wheels-staging/numpy>`_.
The commands can be copied into the command line, but be sure to replace 1.21.... | 0 |
public_repos/numpy | public_repos/numpy/doc/DISTUTILS.rst | .. -*- rest -*-
NumPy distutils - users guide
=============================
.. contents::
SciPy structure
'''''''''''''''
Currently SciPy project consists of two packages:
- NumPy --- it provides packages like:
+ numpy.distutils - extension to Python distutils
+ numpy.f2py - a tool to bind Fortran/C codes to ... | 0 |
public_repos/numpy | public_repos/numpy/doc/preprocess.py | #!/usr/bin/env python3
import subprocess
import os
import sys
from string import Template
def main():
doxy_gen(os.path.abspath(os.path.join('..')))
def doxy_gen(root_path):
"""
Generate Doxygen configuration file.
"""
confs = doxy_config(root_path)
build_path = os.path.join(root_path, "doc", "... | 0 |
public_repos/numpy/doc | public_repos/numpy/doc/source/benchmarking.rst | .. include:: ../../benchmarks/README.rst
| 0 |
public_repos/numpy/doc | public_repos/numpy/doc/source/numpy_2_0_migration_guide.rst | *************************
NumPy 2.0 migration guide
*************************
This document contains a set of instructions on how to update your code to
work with Numpy 2.0.
.. _migration_windows_int64:
Windows default integer
=======================
The default integer used by NumPy is now 64bit on all 64bit syste... | 0 |
public_repos/numpy/doc | public_repos/numpy/doc/source/index.rst | .. _numpy_docs_mainpage:
###################
NumPy documentation
###################
.. toctree::
:maxdepth: 1
:hidden:
User Guide <user/index>
API reference <reference/index>
Development <dev/index>
release
**Version**: |version|
**Download documentation**:
`Historical versions of documentation... | 0 |
public_repos/numpy/doc | public_repos/numpy/doc/source/glossary.rst | ********
Glossary
********
.. glossary::
(`n`,)
A parenthesized number followed by a comma denotes a tuple with one
element. The trailing comma distinguishes a one-element tuple from a
parenthesized ``n``.
-1
- **In a dimension entry**, instructs NumPy to choose the length
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.