Skip to content

Commit 7ed85d9

Browse files
committed
Merge branch 'main' of https://github.com/numpy/numpy into compression-feat
2 parents 6527066 + b5d6eb4 commit 7ed85d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+402
-118
lines changed

.gitignore

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,6 @@ GTAGS
4343
*.so
4444
*.mod
4545

46-
# Packages #
47-
############
48-
# it's better to unpack these files and commit the raw source
49-
# git has its own built in compression methods
50-
*.7z
51-
*.bz2
52-
*.bzip2
53-
*.dmg
54-
*.gz
55-
*.iso
56-
*.jar
57-
*.rar
58-
*.tar
59-
*.tbz2
60-
*.tgz
61-
*.zip
62-
6346
# Python files #
6447
################
6548
# meson build/installation directories

doc/source/reference/c-api/types-and-structures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ for completeness and assistance in understanding the code.
16081608
The C-structure associated with :c:var:`PyArrayMapIter_Type`.
16091609
This structure is useful if you are trying to
16101610
understand the advanced-index mapping code. It is defined in the
1611-
``arrayobject.h`` header. This type is not exposed to Python and
1611+
``multiarray/mapping.h`` header. This type is not exposed to Python and
16121612
could be replaced with a C-structure. As a Python type it takes
16131613
advantage of reference- counted memory management.
16141614

numpy/_core/_add_newdocs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,7 @@
42404240

42414241
add_newdoc('numpy._core.multiarray', 'ndarray', ('std',
42424242
"""
4243-
a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
4243+
a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True, mean=np._NoValue)
42444244
42454245
Returns the standard deviation of the array elements along given axis.
42464246
@@ -4518,7 +4518,7 @@
45184518

45194519
add_newdoc('numpy._core.multiarray', 'ndarray', ('var',
45204520
"""
4521-
a.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
4521+
a.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True, mean=np._NoValue)
45224522
45234523
Returns the variance of the array elements, along given axis.
45244524

numpy/_core/include/numpy/npy_3kcompat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static inline PyObject*
242242
npy_PyFile_OpenFile(PyObject *filename, const char *mode)
243243
{
244244
PyObject *open;
245-
open = PyDict_GetItemString(PyEval_GetBuiltins(), "open");
245+
open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); // noqa: borrowed-ref OK
246246
if (open == NULL) {
247247
return NULL;
248248
}

numpy/_core/include/numpy/npy_cpu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* NPY_CPU_RISCV64
2121
* NPY_CPU_RISCV32
2222
* NPY_CPU_LOONGARCH
23+
* NPY_CPU_SW_64
2324
* NPY_CPU_WASM
2425
*/
2526
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
@@ -111,6 +112,8 @@
111112
#endif
112113
#elif defined(__loongarch_lp64)
113114
#define NPY_CPU_LOONGARCH64
115+
#elif defined(__sw_64__)
116+
#define NPY_CPU_SW_64
114117
#elif defined(__EMSCRIPTEN__) || defined(__wasm__)
115118
/* __EMSCRIPTEN__ is defined by emscripten: an LLVM-to-Web compiler */
116119
/* __wasm__ is defined by clang when targeting wasm */

numpy/_core/include/numpy/npy_endian.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
|| defined(NPY_CPU_RISCV64) \
5252
|| defined(NPY_CPU_RISCV32) \
5353
|| defined(NPY_CPU_LOONGARCH) \
54+
|| defined(NPY_CPU_SW_64) \
5455
|| defined(NPY_CPU_WASM)
5556
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
5657

numpy/_core/src/common/npy_cpu_dispatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ NPY_VISIBILITY_HIDDEN void
3333
npy_cpu_dispatch_trace(const char *fname, const char *signature,
3434
const char **dispatch_info)
3535
{
36-
PyObject *func_dict = PyDict_GetItemString(npy_static_pydata.cpu_dispatch_registry, fname);
36+
PyObject *func_dict = PyDict_GetItemString(npy_static_pydata.cpu_dispatch_registry, fname); // noqa: borrowed-ref OK
3737
if (func_dict == NULL) {
3838
func_dict = PyDict_New();
3939
if (func_dict == NULL) {

numpy/_core/src/common/ufunc_override.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ PyUFuncOverride_GetOutObjects(PyObject *kwds, PyObject **out_kwd_obj, PyObject *
108108
* PySequence_Fast* functions. This is required for PyPy
109109
*/
110110
PyObject *seq;
111-
seq = PySequence_Fast(*out_kwd_obj,
111+
seq = PySequence_Fast(*out_kwd_obj, // noqa: borrowed-ref OK
112112
"Could not convert object to sequence");
113113
if (seq == NULL) {
114114
Py_CLEAR(*out_kwd_obj);

numpy/_core/src/multiarray/_multiarray_tests.c.src

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ incref_elide_l(PyObject *dummy, PyObject *args)
644644
}
645645
/* get item without increasing refcount, item may still be on the python
646646
* stack but above the inaccessible top */
647-
r = PyList_GetItem(arg, 4);
647+
r = PyList_GetItem(arg, 4); // noqa: borrowed-ref OK
648648
res = PyNumber_Add(r, r);
649649

650650
return res;
@@ -863,7 +863,7 @@ get_all_cast_information(PyObject *NPY_UNUSED(mod), PyObject *NPY_UNUSED(args))
863863
if (classes == NULL) {
864864
goto fail;
865865
}
866-
Py_SETREF(classes, PySequence_Fast(classes, NULL));
866+
Py_SETREF(classes, PySequence_Fast(classes, NULL)); // noqa: borrowed-ref OK
867867
if (classes == NULL) {
868868
goto fail;
869869
}
@@ -883,7 +883,7 @@ get_all_cast_information(PyObject *NPY_UNUSED(mod), PyObject *NPY_UNUSED(args))
883883
PyObject *to_dtype, *cast_obj;
884884
Py_ssize_t pos = 0;
885885

886-
while (PyDict_Next(NPY_DT_SLOTS(from_dtype)->castingimpls,
886+
while (PyDict_Next(NPY_DT_SLOTS(from_dtype)->castingimpls, // noqa: borrowed-ref OK
887887
&pos, &to_dtype, &cast_obj)) {
888888
if (cast_obj == Py_None) {
889889
continue;
@@ -965,7 +965,7 @@ identityhash_tester(PyObject *NPY_UNUSED(mod),
965965
}
966966

967967
/* Replace the sequence with a guaranteed fast-sequence */
968-
sequence = PySequence_Fast(sequence, "converting sequence.");
968+
sequence = PySequence_Fast(sequence, "converting sequence."); // noqa: borrowed-ref OK
969969
if (sequence == NULL) {
970970
goto finish;
971971
}

numpy/_core/src/multiarray/array_coercion.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
11481148
force_sequence_due_to_char_dtype:
11491149

11501150
/* Ensure we have a sequence (required for PyPy) */
1151-
seq = PySequence_Fast(obj, "Could not convert object to sequence");
1151+
seq = PySequence_Fast(obj, "Could not convert object to sequence"); // noqa: borrowed-ref - manual fix needed
11521152
if (seq == NULL) {
11531153
/*
11541154
* Specifically do not fail on things that look like a dictionary,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy