Skip to content

Commit 869515d

Browse files
committed
docs: add dedicated Array API Standard page
Create comprehensive Array API Standard documentation page covering: - What the standard is and why it matters - The fragmentation problem it solves - Which libraries have adopted it - All 14 required data types with C# equivalents - All 5 required constants - All 7 required array attributes (dtype, device, mT, etc.) - Full operator requirements - All 133 core functions by category with NumSharp status - Type promotion rules (same-kind, cross-kind, scalar) - Optional extensions (linalg: 23 functions, fft: 14 functions) - What's NOT in scope (I/O, strings, datetime, etc.) - Real-world use cases (SciPy, einops, xtensor, JIT) - NumSharp's path to compliance with coverage percentages Also update NumPy Compliance page to reference this new page instead of duplicating Array API details.
1 parent 9a745ef commit 869515d

10 files changed

Lines changed: 1794 additions & 338 deletions

File tree

docs/website-src/docs/array-api-standard.md

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.

docs/website-src/docs/compliance.md

Lines changed: 21 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ NumPy 2.0 (released April 2024) was a major breaking release. It changed how typ
3737

3838
The Python Array API Standard is an industry consortium effort to define a common API that works across array libraries. Write code against the Array API, and it runs on NumPy, PyTorch, JAX, CuPy, or Dask without changes. NumPy adopted it in version 2.0.
3939

40+
**Deep Dive:** [Array API Standard](array-api-standard.md) — Our dedicated page with full specification details
41+
4042
**Tracking:** [Array API Standard Milestone](https://github.com/SciSharp/NumSharp/milestone/6)
4143

4244
### 3. NumPy Enhancement Proposals (NEPs)
@@ -191,70 +193,25 @@ Most of the time, you won't notice. But if you're:
191193

192194
---
193195

194-
## Array API Standard: Function Coverage
195-
196-
The Array API Standard requires 133 functions in the core specification. Here's where NumSharp stands:
197-
198-
### Creation Functions (16 required)
199-
200-
| Function | NumSharp | Notes |
201-
|----------|----------|-------|
202-
| `arange` || |
203-
| `asarray` || |
204-
| `empty` || |
205-
| `empty_like` || |
206-
| `eye` || |
207-
| `from_dlpack` || DLPack interop not implemented |
208-
| `full` || |
209-
| `full_like` || |
210-
| `linspace` || |
211-
| `meshgrid` || |
212-
| `ones` || |
213-
| `ones_like` || |
214-
| `tril` || |
215-
| `triu` || |
216-
| `zeros` || |
217-
| `zeros_like` || |
218-
219-
**Coverage: ~87%** — Missing `tril`, `triu`, and `from_dlpack`.
220-
221-
### Element-wise Functions (67 required)
222-
223-
This is our biggest category and we have good coverage (~75%), but we're missing some functions:
224-
225-
**Missing:**
226-
- `bitwise_left_shift`, `bitwise_right_shift` (we have `<<`, `>>` operators but not named functions)
227-
- `copysign`, `hypot`, `logaddexp` (math functions)
228-
- `nextafter`, `signbit` (floating-point utilities)
229-
- Complex-number functions (`conj`, `imag`, `real`) — blocked on complex type support
230-
231-
### Statistical Functions (9 required)
232-
233-
| Function | NumSharp | Notes |
234-
|----------|----------|-------|
235-
| `max` || `amax` |
236-
| `mean` || |
237-
| `min` || `amin` |
238-
| `prod` || |
239-
| `std` || Uses `ddof`, not `correction` parameter |
240-
| `sum` || |
241-
| `var` || Uses `ddof`, not `correction` parameter |
242-
| `cumulative_sum` || `cumsum` |
243-
| `cumulative_prod` || |
244-
245-
**Note on std/var:** The Array API uses a `correction` parameter (default 0.0 for population statistics). NumPy uses `ddof` (delta degrees of freedom). They're mathematically equivalent but spelled differently:
246-
- `std(x, correction=1)` in Array API = `np.std(x, ddof=1)` in NumPy
247-
248-
### Set Functions (4 required) — Our Weakest Area
249-
250-
| Function | NumSharp | Notes |
251-
|----------|----------|-------|
252-
| `unique_all` || Returns values, indices, inverse_indices, counts |
253-
| `unique_counts` || Returns values, counts |
254-
| `unique_inverse` || Returns values, inverse_indices |
255-
| `unique_values` || `np.unique` without options |
256-
257-
NumPy's `np.unique()` is a single function with boolean flags (`return_counts`, `return_inverse`, etc.). The Array API splits this into four focused functions. We only have the basic version.
196+
## Array API Standard
197+
198+
The Array API Standard specifies 133 core functions, 14 data types, and strict type promotion rules. NumSharp currently implements about **74%** of the core specification.
199+
200+
| Category | Required | NumSharp | Coverage |
201+
|----------|----------|----------|----------|
202+
| Creation | 16 | 13 | 81% |
203+
| Element-wise | 67 | ~50 | 75% |
204+
| Statistical | 9 | 8 | 89% |
205+
| Manipulation | 14 | 11 | 79% |
206+
| Set | 4 | 1 | 25% |
207+
| Other | 23 | ~15 | ~65% |
208+
209+
**Biggest Gaps:**
210+
- Complex number types (`complex64`, `complex128`) — blocks FFT and many math functions
211+
- Set functions (`unique_all`, `unique_counts`, `unique_inverse`)
212+
- Array properties (`.device`, `.mT`)
213+
214+
For the complete specification details, function lists, type promotion rules, and extension coverage, see our dedicated **[Array API Standard](array-api-standard.md)** page.
258215

259216
---
260217

docs/website-src/docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
href: NDArray.LinAlg.md
77
- name: NumPy Compliance & Compatibility
88
href: compliance.md
9+
- name: Array API Standard
10+
href: array-api-standard.md
911

1012

0 commit comments

Comments
 (0)