ferrix 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ [env]
2
+ PYO3_USE_ABI3_FORWARD_COMPATIBILITY = "1"
@@ -0,0 +1,4 @@
1
+ /target
2
+ .idea
3
+ .venv
4
+ __pycache__/*
@@ -0,0 +1 @@
1
+ 3.14
ferrix-0.1.0/AGENTS.md ADDED
@@ -0,0 +1,46 @@
1
+ # AGENTS.md
2
+
3
+ ## Scope and source of truth
4
+ - This file applies to the whole repository.
5
+ - A glob search for common AI instruction files (`.github/copilot-instructions.md`, `AGENT.md`, `CLAUDE.md`, `.cursorrules`, `README.md`, etc.) found no matches, so rely on crate files directly.
6
+
7
+ ## Project map (Rust library crate)
8
+ - Crate manifest: `Cargo.toml`.
9
+ - Main implementation: `src/lib.rs`.
10
+ - Unit tests: `src/tests.rs`, included from `src/lib.rs` via `#[cfg(test)] mod tests;`.
11
+ - Build outputs are under `target/` and should not be edited.
12
+
13
+ ## Architecture and data model
14
+ - Core type is `NDArray<T>` in `src/lib.rs` with three coupled fields:
15
+ - `data: Vec<T>` (flat storage)
16
+ - `shape: Vec<usize>` (dimensions)
17
+ - `strides: Vec<usize>` (row-major index mapping)
18
+ - `NDArray::new(data, shape)` is the constructor and invariant gate:
19
+ - Validates `data.len() == shape.iter().product()`.
20
+ - Computes row-major strides from right to left (`[2,3,4] -> [12,4,1]`).
21
+ - `NDArray::get(&self, index: &[usize])` exists as a stub (currently empty), so any indexing feature should be implemented there first.
22
+
23
+ ## Dependency and integration points
24
+ - Library types: `crate-type = ["cdylib", "rlib"]` in `Cargo.toml`.
25
+ - `rlib` is used by Rust unit tests.
26
+ - `cdylib` indicates planned FFI/dynamic library integration; avoid Rust-only assumptions if adding public APIs.
27
+ - Dependencies present: `rayon`, `num-traits` (not yet used in current source).
28
+ - Dev dependency: `criterion` (benchmarking scaffolding present in manifest, no benchmark files yet).
29
+
30
+ ## Tested behavior and current edge cases
31
+ - Stride behavior is validated in `src/tests.rs`:
32
+ - `vec![2, 3]` expects strides `vec![3, 1]`.
33
+ - `vec![2, 3, 4]` expects strides `vec![12, 4, 1]`.
34
+ - Panic-path test currently fails because expected panic text does not match `NDArray::new` message. Keep panic assertions and panic strings synchronized when editing validation logic.
35
+
36
+ ## Developer workflow
37
+ - Run tests: `cargo test`.
38
+ - Re-run library tests only: `cargo test --lib`.
39
+ - Show backtraces for panic debugging: `RUST_BACKTRACE=1 cargo test --lib`.
40
+ - Current baseline (as of 2026-03-30): `cargo test` fails in `tests::test_invalid` due to panic message mismatch, and compiler warns about unused `get`/`index`.
41
+
42
+ ## Code change conventions seen in this repo
43
+ - Validation errors in constructors currently use `panic!` with detailed context (`data len`, `shape`, `expected`).
44
+ - Tests are colocated as `src/tests.rs` (not under `tests/` integration-test directory).
45
+ - Generic container design (`NDArray<T>`) is already in place; preserve generic signatures unless there is a strong reason to specialize.
46
+