Skip to content

Commit 9dbea23

Browse files
Add 55 unit tests covering feature gaps; document micromamba dev environment
New test file (tests/test_coverage_gaps.py) covers previously untested features: ELU/SELU/LeakyReLU activations, JSON export validation, innovation tracker pickle support, IZ neuron overflow handling, parallel evaluator seeded reproducibility, spawn count adjustment, config parameter error paths, and gene equality by innovation number. Updated CLAUDE.md to document the neat-python micromamba environment which includes CuPy for GPU tests. This resolves the apparent 0% GPU coverage which was caused by running tests with system Python. Overall coverage: 90% → 97% (with micromamba env). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d8bd3a4 commit 9dbea23

File tree

2 files changed

+574
-3
lines changed

2 files changed

+574
-3
lines changed

CLAUDE.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,33 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
NEAT-Python is a pure-Python implementation of NEAT (NeuroEvolution of Augmenting Topologies), a method for evolving arbitrary neural networks. This project has no dependencies beyond the Python standard library and supports Python 3.8-3.14 and PyPy3.
88

9+
## Development Environment
10+
11+
A micromamba environment named `neat-python` is available with all dependencies (including CuPy for GPU tests). Prefix commands with `micromamba run -n neat-python` to use it:
12+
13+
```bash
14+
# Run commands in the neat-python environment
15+
micromamba run -n neat-python pytest tests/ -v
16+
micromamba run -n neat-python python examples/xor/evolve-minimal.py
17+
```
18+
919
## Key Development Commands
1020

21+
All commands below assume the `neat-python` micromamba environment. Prefix with `micromamba run -n neat-python` when running from outside the environment.
22+
1123
### Testing
1224
```bash
1325
# Run all tests with coverage
14-
pytest tests/ --cov=neat --cov-report=term --cov-report=xml -v
26+
micromamba run -n neat-python pytest tests/ --cov=neat --cov-report=term --cov-report=xml -v
1527

1628
# Run a single test file
17-
pytest tests/test_genome.py -v
29+
micromamba run -n neat-python pytest tests/test_genome.py -v
1830

1931
# Run a specific test
20-
pytest tests/test_genome.py::TestGenome::test_mutate_add_node -v
32+
micromamba run -n neat-python pytest tests/test_genome.py::TestGenome::test_mutate_add_node -v
33+
34+
# Run GPU tests (requires CuPy + NVIDIA GPU, both available in the micromamba env)
35+
micromamba run -n neat-python pytest tests/test_gpu.py -v
2136
```
2237

2338
### Installation

0 commit comments

Comments
 (0)