Commit 71ae428
fer
test: add comprehensive sparse module test suite (Phase 1, Task 1)
Intent: Increase test coverage for src/tnfr/sparse module from 0% to 65%
Operators involved: Testing infrastructure (no runtime operators)
Affected invariants: #8 (Controlled Determinism - reproducibility)
Key changes:
- Created tests/sparse/__init__.py and test_sparse_representations.py
- Added 31 test cases across 7 test classes
- Fixed IndentationError in src/tnfr/dynamics/integrators.py (line 874)
- Fixed missing import in src/tnfr/physics/extended_canonical_fields.py
- Fixed numpy 2.3.4 corruption (reinstalled 2.2.1)
- Fixed scipy corruption (reinstalled 1.16.3)
Test coverage:
- CompactAttributeStore: 6 tests (defaults, vectorized ops, storage removal)
- SparseCache: 7 tests (TTL expiration, LRU eviction, memory tracking)
- SparseTNFRGraph: 8 tests (init, memory footprint, attributes)
- MemoryEfficiency: 2 tests (sparse vs dense, scaling)
- Integration: 2 tests (TNFR compatibility, reproducibility)
- EdgeCases: 6 tests (zero nodes, invalid density, boundaries)
- Performance: 2 tests (large graphs, access speed)
Coverage: 65% (204 statements, 71 miss)
Status: All 31 tests passing
Expected risks/dissonances: Syntax errors fixed (integrators.py, extended_canonical_fields.py)
Metrics before/after:
- Test files: 488 → 490 (+2)
- Health: 100/100 → 100/100 (maintained)
- Coverage sparse module: 0% → 65%1 parent 2a6f133 commit 71ae428
File tree
5 files changed
+410
-7
lines changed- src/tnfr
- dynamics
- physics
- tests/sparse
5 files changed
+410
-7
lines changedWhitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
| 725 | + | |
| 726 | + | |
726 | 727 | | |
727 | 728 | | |
728 | 729 | | |
| |||
868 | 869 | | |
869 | 870 | | |
870 | 871 | | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
875 | 876 | | |
876 | 877 | | |
877 | 878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
238 | | - | |
| 241 | + | |
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments