Search is not available for this dataset
repo_id stringlengths 12 110 | file_path stringlengths 24 164 | content stringlengths 3 89.3M | __index_level_0__ int64 0 0 |
|---|---|---|---|
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/LICENSE.txt | Copyright (c) 1992-2013 The University of Tennessee and The University
of Tennessee Research Foundation. All rights
reserved.
Copyright (c) 2000-2013 The University of California Berkeley. All
rights reserved.
Copyright (c) 2006-2013 The Universit... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_d_lapack.f.patch | @@ -19075,5 +19075,6 @@
! Skip any trailing zeros.
DO LASTV = N, I+1, -1
- IF( V( LASTV, I ).NE.ZERO ) EXIT
+ IF( V( LASTV, I ).NE.ZERO ) GO TO 15
END DO
+ 15 CONTINUE
J = MIN( LASTV, PREVLAST... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/wrapped_routines | ccopy
cgeev
cgelsd
cgemm
cgesdd
cgesv
cgetrf
cheevd
cpotrf
cpotri
cpotrs
dcopy
dgeev
dgelsd
dgemm
dgeqrf
dgesdd
dgesv
dgetrf
dorgqr
dpotrf
dpotri
dpotrs
dsyevd
scopy
sgeev
sgelsd
sgemm
sgesdd
sgesv
sgetrf
spotrf
spotri
spotrs
ssyevd
zcopy
zgeev
zgelsd
zgemm
zgeqrf
zgesdd
zgesv
zgetrf
zheevd
zpotrf
zpotri
zpotrs
zungqr
... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_config.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_lapack.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/lapack_lite_names.h | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
/*
* This file renames all BLAS/LAPACK and f2c symbols to avoid
* dynamic symbol name conflicts, in cases where e.g.
* integer sizes do not match with 'standard' ABI.
*/
#define caxpy_ BLAS_FUNC(... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_z_lapack.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_s_lapack.f.patch | @@ -17359,5 +17359,6 @@
! Skip any trailing zeros.
DO LASTV = N, I+1, -1
- IF( V( LASTV, I ).NE.ZERO ) EXIT
+ IF( V( LASTV, I ).NE.ZERO ) GO TO 15
END DO
+ 15 CONTINUE
J = MIN( LASTV, PREVLAST... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_config.c.patch | @@ -696,7 +696,7 @@
doublereal dlamc3_(doublereal *a, doublereal *b)
{
/* System generated locals */
- doublereal ret_val;
+ volatile doublereal ret_val;
/*
@@ -1773,7 +1773,7 @@
doublereal slamc3_(real *a, real *b)
{
/* System generated locals */
- real ret_val;
+ volatile real ret_val;
... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_s_lapack.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_c_lapack.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_c_lapack.f.patch | @@ -13163,5 +13163,6 @@
! Skip any trailing zeros.
DO LASTV = N, I+1, -1
- IF( V( LASTV, I ).NE.ZERO ) EXIT
+ IF( V( LASTV, I ).NE.ZERO ) GO TO 15
END DO
+ 15 CONTINUE
J = MIN( LASTV, PREVLAST... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_lapack.f.patch | @@ -267,9 +267,10 @@
Scan up each column tracking the last zero row seen.
ILACLR = 0
DO J = 1, N
DO I = M, 1, -1
- IF( A(I, J).NE.ZERO ) EXIT
+ IF( A(I, J).NE.ZERO ) GO TO 10
END DO
+ 10 CONTINUE
ILACLR = MAX( ILACLR, I... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_blas.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/python_xerbla.c | #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "numpy/npy_common.h"
#include "npy_cblas.h"
/*
From the original manpage:
--------------------------
XERBLA is an error handler for the LAPACK routines.
It is called by an LAPACK routine if an input parameter has an invalid value.
A message is printed an... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/make_lite.py | #!/usr/bin/env python2.7
# WARNING! This a Python 2 script. Read README.rst for rationale.
"""
Usage: make_lite.py <wrapped_routines_file> <lapack_dir>
Typical invocation:
make_lite.py wrapped_routines /tmp/lapack-3.x.x
Requires the following to be on the path:
* f2c
* patch
"""
import sys
import os
import re... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_d_lapack.c | /*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/fortran.py | # WARNING! This a Python 2 script. Read README.rst for rationale.
import re
import itertools
def isBlank(line):
return not line
def isLabel(line):
return line[0].isdigit()
def isComment(line):
return line[0] != ' '
def isContinuation(line):
return line[5] != ' '
COMMENT, STATEMENT, CONTINUATION = 0, 1... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_blas.c.patch | diff -u b/numpy/linalg/lapack_lite/f2c_blas.c b/numpy/linalg/lapack_lite/f2c_blas.c
--- b/numpy/linalg/lapack_lite/f2c_blas.c
+++ b/numpy/linalg/lapack_lite/f2c_blas.c
@@ -29,19 +29,19 @@
/* Table of constant values */
-static complex c_b21 = {1.f,0.f};
+static singlecomplex c_b21 = {1.f,0.f};
static doublecomple... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c.h | /* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <math.h>
#include "numpy/... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c.c | /*
Functions here are copied from the source code for libf2c.
Typically each function there is in its own file.
We don't link against libf2c directly, because we can't guarantee
it is available, and shipping a static library isn't portable.
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <math.h>
#... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/tests/test_linalg.py | """ Test functions for linalg module
"""
import os
import sys
import itertools
import traceback
import textwrap
import subprocess
import pytest
import numpy as np
from numpy import array, single, double, csingle, cdouble, dot, identity, matmul
from numpy._core import swapaxes
from numpy.exceptions import AxisError
fr... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/tests/test_regression.py | """ Test functions for linalg module
"""
import warnings
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_array_less
)
class TestRegression:
def test... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/tests/test_deprecations.py | """Test deprecation and future warnings.
"""
import numpy as np
from numpy.testing import assert_warns
def test_qr_mode_full_future_warning():
"""Check mode='full' FutureWarning.
In numpy 1.8 the mode options 'full' and 'economic' in linalg.qr were
deprecated. The release date will probably be sometime ... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/__init__.pyi | from numpy._pytesttester import PytestTester
from numpy.fft._pocketfft import (
fft as fft,
ifft as ifft,
rfft as rfft,
irfft as irfft,
hfft as hfft,
ihfft as ihfft,
rfftn as rfftn,
irfftn as irfftn,
rfft2 as rfft2,
irfft2 as irfft2,
fft2 as fft2,
ifft2 as ifft2,
fft... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/_pocketfft.py | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1, norm="backward")
ifft(a, n=None, axis=-1, norm="backward")
rfft(a, n=None, axis=-1, norm="backward")
irfft(a, n=None, axis=-1, norm="backward")
hfft(a, n=None, axis=-1, norm="backward")
ihfft(a, n=None, axis=-1, norm="backward")
fftn(a, ... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/_pocketfft.c | /*
* This file is part of pocketfft.
* Licensed under a 3-clause BSD style license - see LICENSE.md
*/
/*
* Main implementation file.
*
* Copyright (C) 2004-2018 Max-Planck-Society
* \author Martin Reinecke
*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#incl... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/_helper.pyi | from typing import Any, TypeVar, overload
from numpy import generic, integer, floating, complexfloating
from numpy._typing import (
NDArray,
ArrayLike,
_ShapeLike,
_ArrayLike,
_ArrayLikeFloat_co,
_ArrayLikeComplex_co,
)
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
@overload
def f... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/meson.build | largefile_define = []
if host_machine.system() == 'aix' or host_machine.system() == 'AIX'
largefile_define += '-D_LARGE_FILES'
endif
py.extension_module('_pocketfft_internal',
'_pocketfft.c',
c_args: largefile_define,
dependencies: np_core_dep,
install: true,
subdir: 'numpy/fft',
)
py.install_sources(
[... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/helper.py | def __getattr__(attr_name):
import warnings
from numpy.fft import _helper
ret = getattr(_helper, attr_name, None)
if ret is None:
raise AttributeError(
f"module 'numpy.fft.helper' has no attribute {attr_name}")
warnings.warn(
"The numpy.fft.helper has been made private an... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/_helper.py | """
Discrete Fourier Transforms - _helper.py
"""
from numpy._core import integer, empty, arange, asarray, roll
from numpy._core.overrides import array_function_dispatch, set_module
# Created by Pearu Peterson, September 2002
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq']
integer_types = (int, integer)
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/README.md | PocketFFT
---------
This is a heavily modified implementation of FFTPack [1,2], with the following
advantages:
- strictly C99 compliant
- more accurate twiddle factor computation
- very fast plan generation
- worst case complexity for transform sizes with large prime factors is
`N*log(N)`, because Bluestein's algor... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/_pocketfft.pyi | from collections.abc import Sequence
from typing import Literal as L
from numpy import complex128, float64
from numpy._typing import ArrayLike, NDArray, _ArrayLikeNumber_co
_NormKind = L[None, "backward", "ortho", "forward"]
__all__: list[str]
def fft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/fft/__init__.py | """
Discrete Fourier Transform (:mod:`numpy.fft`)
=============================================
.. currentmodule:: numpy.fft
The SciPy module `scipy.fft` is a more comprehensive superset
of ``numpy.fft``, which includes only a basic set of routines.
Standard FFTs
-------------
.. autosummary::
:toctree: generate... | 0 |
public_repos/numpy/numpy/fft | public_repos/numpy/numpy/fft/tests/test_pocketfft.py | import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_equal, assert_raises, assert_allclose, IS_WASM
)
import threading
import queue
def fft1(x):
L = len(x)
phase = -2j * np.pi * (np.arange(L) / L)
phase = np.arange(L).reshape(-1, 1) * ph... | 0 |
public_repos/numpy/numpy/fft | public_repos/numpy/numpy/fft/tests/test_helper.py | """Test functions for fftpack.helper module
Copied from fftpack.helper by Pearu Peterson, October 2005
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from numpy import fft, pi
class TestFFTShift:
def test_definition(self):
x = [0, 1, 2, 3, 4, -4, -3, -2, -1]
y = [-4,... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_stride_tricks_impl.py | """
Utilities that manipulate strides to achieve desirable effects.
An explanation of strides can be found in the :ref:`arrays.ndarray`.
"""
import numpy as np
from numpy._core.numeric import normalize_axis_tuple
from numpy._core.overrides import array_function_dispatch, set_module
__all__ = ['broadcast_to', 'broadc... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/__init__.pyi | import math as math
from typing import Any
from numpy._pytesttester import PytestTester
from numpy import (
ndenumerate as ndenumerate,
ndindex as ndindex,
)
from numpy.version import version
from numpy.lib import (
format as format,
mixins as mixins,
scimath as scimath,
stride_tricks as str... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arrayterator_impl.py | """
A buffered iterator for big arrays.
This module solves the problem of iterating over a big file-based array
without having to read it into memory. The `Arrayterator` class wraps
an array object, and when iterated it will return sub-arrays with at most
a user-specified number of elements.
"""
from operator import ... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_version.pyi | __all__: list[str]
class NumpyVersion:
vstring: str
version: str
major: int
minor: int
bugfix: int
pre_release: str
is_devversion: bool
def __init__(self, vstring: str) -> None: ...
def __lt__(self, other: str | NumpyVersion) -> bool: ...
def __le__(self, other: str | NumpyVersi... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_utils_impl.pyi | from ast import AST
from collections.abc import Callable
from typing import (
Any,
overload,
TypeVar,
Protocol,
)
from numpy._core.numerictypes import (
issubdtype as issubdtype,
)
_T_contra = TypeVar("_T_contra", contravariant=True)
_FuncType = TypeVar("_FuncType", bound=Callable[..., Any])
# A ... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/mixins.py | """Mixin classes for custom array types that don't inherit from ndarray."""
from numpy._core import umath as um
__all__ = ['NDArrayOperatorsMixin']
def _disables_array_ufunc(obj):
"""True when __array_ufunc__ is set to None."""
try:
return obj.__array_ufunc__ is None
except AttributeError:
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/user_array.py | from ._user_array_impl import __doc__, container
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/format.pyi | from typing import Any, Literal, Final
__all__: list[str]
EXPECTED_KEYS: Final[set[str]]
MAGIC_PREFIX: Final[bytes]
MAGIC_LEN: Literal[8]
ARRAY_ALIGN: Literal[64]
BUFFER_SIZE: Literal[262144] # 2**18
def magic(major, minor): ...
def read_magic(fp): ...
def dtype_to_descr(dtype): ...
def descr_to_dtype(descr): ...
d... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_nanfunctions_impl.py | """
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nancumsum` -- cumul... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_polynomial_impl.py | """
Functions to operate on polynomials.
"""
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit']
import functools
import re
import warnings
from .._utils import set_module
import numpy._core.numeric as NX
from numpy._cor... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/mixins.pyi | from abc import ABCMeta, abstractmethod
from typing import Literal as L, Any
from numpy import ufunc
__all__: list[str]
# NOTE: `NDArrayOperatorsMixin` is not formally an abstract baseclass,
# even though it's reliant on subclasses implementing `__array_ufunc__`
# NOTE: The accepted input- and output-types of the v... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arraypad_impl.pyi | from typing import (
Literal as L,
Any,
overload,
TypeVar,
Protocol,
)
from numpy import generic
from numpy._typing import (
ArrayLike,
NDArray,
_ArrayLikeInt,
_ArrayLike,
)
_SCT = TypeVar("_SCT", bound=generic)
class _ModeFunc(Protocol):
def __call__(
self,
v... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/scimath.py | from ._scimath_impl import (
__all__, __doc__, sqrt, log, log2, logn, log10, power, arccos, arcsin,
arctanh
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_iotools.py | """A collection of functions designed to help I/O with ascii files.
"""
__docformat__ = "restructuredtext en"
import numpy as np
import numpy._core.numeric as nx
from numpy._utils import asbytes, asunicode
def _decode_line(line, encoding=None):
"""Decode bytes from binary input streams.
Defaults to decodin... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_datasource.py | """A file interface for handling local and remote data files.
The goal of datasource is to abstract some of the file system operations
when dealing with data files so the researcher doesn't have to know all the
low-level details. Through datasource, a researcher can obtain and use a
file with one function call, regar... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/npyio.pyi | from numpy.lib._npyio_impl import (
DataSource as DataSource,
NpzFile as NpzFile,
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_version.py | """Utility to compare (NumPy) version strings.
The NumpyVersion class allows properly comparing numpy version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.
"""
import re
__all__ = ['NumpyVersion']
class NumpyV... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_type_check_impl.py | """Automatically adapted for numpy Sep 19, 2005 by convertcode.py
"""
import functools
__all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex',
'isreal', 'nan_to_num', 'real', 'real_if_close',
'typename', 'mintypecode',
'common_type']
from .._utils import set_module
import numpy.... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_user_array_impl.py | """
Container class for backward compatibility with NumArray.
The user_array.container class exists for backward compatibility with NumArray
and is not meant to be used in new code. If you need to create an array
container class, we recommend either creating a class that wraps an ndarray
or subclasses ndarray.
"""
fr... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arrayterator_impl.pyi | from collections.abc import Generator
from typing import (
Any,
TypeVar,
overload,
)
from numpy import ndarray, dtype, generic
from numpy._typing import DTypeLike, NDArray
# TODO: Set a shape bound once we've got proper shape support
_Shape = TypeVar("_Shape", bound=Any)
_DType = TypeVar("_DType", bound=d... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_histograms_impl.py | """
Histogram-related functions
"""
import contextlib
import functools
import operator
import warnings
import numpy as np
from numpy._core import overrides
__all__ = ['histogram', 'histogramdd', 'histogram_bin_edges']
array_function_dispatch = functools.partial(
overrides.array_function_dispatch, module='numpy')... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/recfunctions.py | """
Collection of utilities to manipulate structured arrays.
Most of these functions were initially implemented by John Hunter for
matplotlib. They have been rewritten and extended for convenience.
"""
import itertools
import numpy as np
import numpy.ma as ma
from numpy import ndarray
from numpy.ma import MaskedArra... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_utils_impl.py | import os
import sys
import textwrap
import types
import re
import warnings
import functools
import platform
from numpy._core import ndarray
from numpy._utils import set_module
import numpy as np
__all__ = [
'get_include', 'info', 'show_runtime'
]
@set_module('numpy')
def show_runtime():
"""
Print infor... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arraysetops_impl.py | """
Set operations for arrays based on sorting.
Notes
-----
For floating point arrays, inaccurate results may appear due to usual round-off
and floating point comparison issues.
Speed could be gained in some operations by an implementation of
`numpy.sort`, that can provide directly the permutation vectors, thus avoi... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/stride_tricks.py | from ._stride_tricks_impl import (
__doc__, as_strided, sliding_window_view
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/stride_tricks.pyi | from numpy.lib._stride_tricks_impl import (
as_strided as as_strided,
sliding_window_view as sliding_window_view,
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_scimath_impl.py | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_npyio_impl.py | import os
import re
import functools
import itertools
import warnings
import weakref
import contextlib
import operator
from operator import itemgetter, index as opindex, methodcaller
from collections.abc import Mapping
import pickle
import numpy as np
from . import format
from ._datasource import DataSource
from numpy... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_index_tricks_impl.py | import functools
import sys
import math
import warnings
import numpy as np
from .._utils import set_module
import numpy._core.numeric as _nx
from numpy._core.numeric import ScalarType, array
from numpy._core.numerictypes import issubdtype
import numpy.matrixlib as matrixlib
from numpy._core.multiarray import ravel_mu... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_shape_base_impl.pyi | import sys
from collections.abc import Callable, Sequence
from typing import TypeVar, Any, overload, SupportsIndex, Protocol
if sys.version_info >= (3, 10):
from typing import ParamSpec, Concatenate
else:
from typing_extensions import ParamSpec, Concatenate
from numpy import (
generic,
integer,
uf... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_twodim_base_impl.py | """ Basic functions for manipulating 2d arrays
"""
import functools
import operator
from numpy._core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, intp, empty, promote_types,
diagonal, nonzero, indices
)
from numpy._core.overrides... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/array_utils.py | from ._array_utils_impl import (
__all__,
byte_bounds,
normalize_axis_index,
normalize_axis_tuple,
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/introspect.py | import re
__all__ = ['opt_func_info']
def opt_func_info(func_name=None, signature=None):
"""
Returns a dictionary containing the currently supported CPU dispatched
features for all optimized functions.
Parameters
----------
func_name : str (optional)
Regular expression to filter by f... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arraypad_impl.py | """
The arraypad module contains a group of functions to pad values onto the edges
of an n-dimensional array.
"""
import numpy as np
from numpy._core.overrides import array_function_dispatch
from numpy.lib._index_tricks_impl import ndindex
__all__ = ['pad']
#########################################################... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_twodim_base_impl.pyi | from collections.abc import Callable, Sequence
from typing import (
Any,
overload,
TypeVar,
)
from numpy import (
generic,
number,
bool_,
timedelta64,
datetime64,
int_,
intp,
float64,
signedinteger,
floating,
complexfloating,
object_,
_OrderCF,
)
from nu... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_function_base_impl.py | import builtins
import collections.abc
import functools
import re
import sys
import warnings
import numpy as np
import numpy._core.numeric as _nx
from numpy._core import transpose, overrides
from numpy._core.numeric import (
ones, zeros_like, arange, concatenate, array, asarray, asanyarray, empty,
ndarray, tak... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/scimath.pyi | from ._scimath_impl import (
__all__ as __all__,
sqrt as sqrt,
log as log,
log2 as log2,
logn as logn,
log10 as log10,
power as power,
arccos as arccos,
arcsin as arcsin,
arctanh as arctanh,
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_arraysetops_impl.pyi | from typing import (
Literal as L,
Any,
TypeVar,
overload,
SupportsIndex,
)
from numpy import (
generic,
number,
bool_,
ushort,
ubyte,
uintc,
uint,
ulonglong,
short,
int8,
byte,
intc,
int_,
intp,
longlong,
half,
single,
double,... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_function_base_impl.pyi | import sys
from collections.abc import Sequence, Iterator, Callable, Iterable
from typing import (
Literal as L,
Any,
TypeVar,
overload,
Protocol,
SupportsIndex,
SupportsInt,
)
if sys.version_info >= (3, 10):
from typing import TypeGuard
else:
from typing_extensions import TypeGuard... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_index_tricks_impl.pyi | from collections.abc import Sequence
from typing import (
Any,
TypeVar,
Generic,
overload,
Literal,
SupportsIndex,
)
from numpy import (
# Circumvent a naming conflict with `AxisConcatenator.matrix`
matrix as _Matrix,
ndenumerate as ndenumerate,
ndindex as ndindex,
ndarray,
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_ufunclike_impl.py | """
Module of functions that are like ufuncs in acting on arrays and optionally
storing results in an output array.
"""
__all__ = ['fix', 'isneginf', 'isposinf']
import numpy._core.numeric as nx
from numpy._core.overrides import array_function_dispatch
import warnings
import functools
def _dispatcher(x, out=None):
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_polynomial_impl.pyi | from typing import (
Literal as L,
overload,
Any,
SupportsInt,
SupportsIndex,
TypeVar,
NoReturn,
)
from numpy import (
poly1d as poly1d,
unsignedinteger,
signedinteger,
floating,
complexfloating,
bool_,
int32,
int64,
float64,
complex128,
object_,
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_nanfunctions_impl.pyi | from numpy._core.fromnumeric import (
amin,
amax,
argmin,
argmax,
sum,
prod,
cumsum,
cumprod,
mean,
var,
std
)
from numpy.lib._function_base_impl import (
median,
percentile,
quantile,
)
__all__: list[str]
# NOTE: In reaility these functions are not aliases but... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/format.py | """
Binary serialization
NPY format
==========
A simple format for saving numpy arrays to disk with the full
information about them.
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necess... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_stride_tricks_impl.pyi | from collections.abc import Iterable
from typing import Any, TypeVar, overload, SupportsIndex
from numpy import generic
from numpy._typing import (
NDArray,
ArrayLike,
_ShapeLike,
_Shape,
_ArrayLike
)
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
class DummyArray:
__array_interfac... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_scimath_impl.pyi | from typing import overload, Any
from numpy import complexfloating
from numpy._typing import (
NDArray,
_ArrayLikeFloat_co,
_ArrayLikeComplex_co,
_ComplexLike_co,
_FloatLike_co,
)
__all__: list[str]
@overload
def sqrt(x: _FloatLike_co) -> Any: ...
@overload
def sqrt(x: _ComplexLike_co) -> comple... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_shape_base_impl.py | import functools
import warnings
import numpy._core.numeric as _nx
from numpy._core.numeric import asarray, zeros, zeros_like, array, asanyarray
from numpy._core.fromnumeric import reshape, transpose
from numpy._core.multiarray import normalize_axis_index
from numpy._core import overrides
from numpy._core import vstac... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/array_utils.pyi | from ._array_utils_impl import (
__all__ as __all__,
byte_bounds as byte_bounds,
normalize_axis_index as normalize_axis_index,
normalize_axis_tuple as normalize_axis_tuple,
)
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/npyio.py | from ._npyio_impl import DataSource, NpzFile
| 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_array_utils_impl.pyi | from typing import Any, Iterable, Tuple
from numpy import generic
from numpy.typing import NDArray
__all__: list[str]
# NOTE: In practice `byte_bounds` can (potentially) take any object
# implementing the `__array_interface__` protocol. The caveat is
# that certain keys, marked as optional in the spec, must be prese... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_ufunclike_impl.pyi | from typing import Any, overload, TypeVar
from numpy import floating, bool_, object_
from numpy._typing import (
NDArray,
_FloatLike_co,
_ArrayLikeFloat_co,
_ArrayLikeObject_co,
)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
__all__: list[str]
@overload
def fix( # type: ignore[misc]
x... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_histograms_impl.pyi | from collections.abc import Sequence
from typing import (
Literal as L,
Any,
SupportsIndex,
)
from numpy._typing import (
NDArray,
ArrayLike,
)
_BinKind = L[
"stone",
"auto",
"doane",
"fd",
"rice",
"scott",
"sqrt",
"sturges",
]
__all__: list[str]
def histogram_bin... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_npyio_impl.pyi | import os
import sys
import zipfile
import types
from re import Pattern
from collections.abc import Collection, Mapping, Iterator, Sequence, Callable, Iterable
from typing import (
Literal as L,
Any,
TypeVar,
Generic,
IO,
overload,
Protocol,
)
from numpy import (
ndarray,
recarray,
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/__init__.py | """
``numpy.lib`` is mostly a space for implementing functions that don't
belong in core or in another NumPy submodule with a clear purpose
(e.g. ``random``, ``fft``, ``linalg``, ``ma``).
``numpy.lib``'s private submodules contain basic functions that are used by
other public modules and are useful to have in the main... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_type_check_impl.pyi | from collections.abc import Container, Iterable
from typing import (
Literal as L,
Any,
overload,
TypeVar,
Protocol,
)
from numpy import (
dtype,
generic,
bool_,
floating,
float64,
complexfloating,
integer,
)
from numpy._typing import (
ArrayLike,
DTypeLike,
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/lib/_array_utils_impl.py | from numpy._core import asarray
from numpy._core.numeric import normalize_axis_tuple, normalize_axis_index
from numpy._utils import set_module
__all__ = ["byte_bounds", "normalize_axis_tuple", "normalize_axis_index"]
@set_module("numpy.lib.array_utils")
def byte_bounds(a):
"""
Returns pointers to the end-poi... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test__version.py | """Tests for the NumpyVersion class.
"""
from numpy.testing import assert_, assert_raises
from numpy.lib import NumpyVersion
def test_main_versions():
assert_(NumpyVersion('1.8.0') == '1.8.0')
for ver in ['1.9.0', '2.0.0', '1.8.1', '10.0.1']:
assert_(NumpyVersion('1.8.0') < ver)
for ver in ['1.7... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_shape_base.py | import numpy as np
import functools
import sys
import pytest
from numpy import (
apply_along_axis, apply_over_axes, array_split, split, hsplit, dsplit,
vsplit, dstack, column_stack, kron, tile, expand_dims, take_along_axis,
put_along_axis
)
from numpy.exceptions import AxisError
from numpy.testing impo... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_histograms.py | import numpy as np
from numpy import histogram, histogramdd, histogram_bin_edges
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
assert_array_almost_equal, assert_raises, assert_allclose,
assert_array_max_ulp, assert_raises_regex, suppress_warnings,
)
from nu... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_stride_tricks.py | import numpy as np
from numpy._core._rational_tests import rational
from numpy.testing import (
assert_equal, assert_array_equal, assert_raises, assert_,
assert_raises_regex, assert_warns,
)
from numpy.lib._stride_tricks_impl import (
as_strided, broadcast_arrays, _broadcast_shape, broadcast_to,
bro... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_index_tricks.py | import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
assert_array_almost_equal, assert_raises, assert_raises_regex,
)
from numpy.lib._index_tricks_impl import (
mgrid, ogrid, ndenumerate, fill_diagonal, diag_indices, diag_indices_f... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test__datasource.py | import os
import pytest
from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
from shutil import rmtree
import numpy.lib._datasource as datasource
from numpy.testing import assert_, assert_equal, assert_raises
import urllib.request as urllib_request
from urllib.parse import urlparse
from urllib.error import URLEr... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_array_utils.py | import numpy as np
from numpy.lib import array_utils
from numpy.testing import assert_equal
class TestByteBounds:
def test_byte_bounds(self):
# pointer difference matches size * itemsize
# due to contiguity
a = np.arange(12).reshape(3, 4)
low, high = array_utils.byte_bounds(a)
... | 0 |
public_repos/numpy/numpy/lib | public_repos/numpy/numpy/lib/tests/test_regression.py | import os
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_array_almost_equal,
assert_raises, _assert_valid_refcount,
)
import pytest
class TestRegression:
def test_poly1d(self):
# Ticket #28
assert_equal(np.poly1d([1]) - np.poly1d([1, 0... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.