Commit 2fdc319
tests: expand suite from 51 to 170 tests covering new features
New test classes:
- TestMapInit: invalid topology/device assertions, ids_matrix
shape and values, default attribute checks
- TestMapTopology: hex grid construction (even/odd row offsets,
y-spacing, 6 equidistant neighbours), hex training, classification,
chebyshev+hex, save/load topology persistence
- TestMapDevice: cpu/gpu device param, numpy output guarantee,
deterministic results, invalid device assertion
- TestMapReinforce: weights change, shape/finiteness, LR compression
accumulation, zero-round no-op
- TestMapDecay: use_decay=True training, hex+decay, finiteness
- TestMapNormalization: added unit-norm check for euclidean, 0-1
range for 01scale, zero-mean/unit-std for fwn
- TestMapStaticMethods: lr-at-end, batch vector_distance
- TestMapTrain: num_data/dimension stored, numpy guarantee, finiteness,
train-without-data-in-constructor
- TestMapWeightsInit: sample init tested via __init_weights directly
(post-training weights have moved; previous test was incorrect)
- TestMapSaveLoad: hex topology persisted, loaded map can classify
- TestMapDistance: chebyshev training, batch chebyshev<=euclidean
- TestAccelerator: CUPY_AVAILABLE/NUMBA_AVAILABLE flags, get_array_module,
to_device cpu dtype, to_numpy, device_info content
- TestNumbaKernels (skip if numba absent): bmu_distances shape/values vs
numpy reference, euclidean/chebyshev grid distances, weight_update
shape/in-place/outside-neighbourhood/decay
- TestGPUDevice (skip if no CuPy): gpu weights numpy, shape, finiteness,
bmu bounds, classification, save/load, hex, decay, chebyshev,
get_array_module with cupy, to_device/to_numpy round-trip
- TestClassification: bmu coords in bounds, dist column non-negative,
error map shapes, hex map classification
- TestIterativeSOM: calculate_range output, min<=max, min>=2, small data,
maps dict keys/types/shapes, try_best selects lowest score, scores
populated, give_best alias, default auto-range, map_kwargs forwarding,
best map can classify1 parent 8455d6a commit 2fdc319
1 file changed
Lines changed: 842 additions & 210 deletions
0 commit comments