Skip to content

Commit 7c44cb4

Browse files
author
peng.li24
committed
refactor: remove backward-compat shim headers (core.h, einsum.h, core_py.h, einsum_py.h)
Deleted shims: numpy/core.h → use numpy/numpy.h numpy/einsum.h → use numpy/numpy.h pycpp/core_py.h → use pycpp/pycpp.h pycpp/einsum_py.h → use pycpp/pycpp.h Updated stale references in bench/, example/, and detail headers.
1 parent 188e667 commit 7c44cb4

9 files changed

Lines changed: 8 additions & 52 deletions

File tree

bench/bench_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "numpy/core.h"
1+
#include "numpy/numpy.h"
22
#include "numpy/linalg.h"
33
#include <benchmark/benchmark.h>
44
#include <vector>

example/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <numpy/core.h>
1+
#include <numpy/numpy.h>
22
#include <iostream>
33
#include <vector>
44

numpy/core.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

numpy/detail/avx512_loops.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// ║ INTERNAL HEADER — DIRECT INCLUSION IS A COMPILE ERROR ║
33
// ║ ║
44
// ║ This file contains AVX-512 template specializations that override the ║
5-
// ║ generic loops in core.h. It is x86_64 + AVX-512F specific and must
6-
// ║ be included INSIDE namespace numpy at the end of core.h — nowhere else.║
5+
// ║ generic loops in elementwise.h. It is x86_64 + AVX-512F specific and ║
6+
// ║ be included INSIDE namespace numpy at end of elementwise.h — nowhere else.║
77
// ║ ║
88
// ║ ✗ #include "numpy/detail/avx512_loops.h" ← compile error ║
99
// ║ ✓ #include "numpy/numpy.h" ← recommended entry point ║

numpy/detail/blas_bridge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// np.linalg.norm(a) → sqrt(x.dot(x)) → same sdot_64_ / ddot_64_
2020
//
2121
// np.linalg.norm(a, axis=k) uses numpy's own pairwise sum — already
22-
// handled by norm_axis() in core.h, no BLAS needed.
22+
// handled by norm_axis() in linalg.h, no BLAS needed.
2323
//
2424
// The OpenBLAS library path is auto-discovered from /proc/self/maps
2525
// (numpy loads it when imported), so no compile-time link flag is needed.

numpy/detail/npy_math_float.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
// ║ subject to change without notice. ║
77
// ║ ║
88
// ║ ✗ #include "numpy/detail/npy_math_float.h" ← compile error ║
9-
// ║ ✓ #include "numpy/core.h" ← only correct entry point ║
9+
// ║ ✓ #include "numpy/numpy.h" ← only correct entry point ║
1010
// ╚══════════════════════════════════════════════════════════════════════════╝
1111

1212
#pragma once
1313

1414
#ifndef NUMPYCPP_INTERNAL_INCLUDE
1515
# error "npy_math_float.h is an internal header — do not include directly. \
16-
Use #include \"numpy/core.h\" instead."
16+
Use #include \"numpy/numpy.h\" instead."
1717
#endif
1818

1919
#include <cstdint>
@@ -24,7 +24,7 @@ namespace numpy {
2424
namespace detail {
2525
// Float32 bit-exact polynomial approximations — internal detail, do not use directly.
2626
// These replicate numpy's simd_exp_FLOAT, simd_log_FLOAT, simd_sincos_f32 algorithms.
27-
// Public API: use numpy::exp() etc. from core.h.
27+
// Public API: use numpy::exp() etc. from numpy.h.
2828

2929
namespace {
3030

numpy/einsum.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

pycpp/core_py.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

pycpp/einsum_py.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)