From b4f877b12dc0a9f0b7a9ee10d37046a1d365274b Mon Sep 17 00:00:00 2001 From: Hananel Hazan Date: Sun, 6 Sep 2026 21:31:17 -0400 Subject: [PATCH] refactor: remove dead AbstractFeature.degrade hook AbstractFeature.degrade called itself with an argument it does not accept, so it raised TypeError on the first call for every feature. It has been that way since 4b577e9 added topology_features.py, and nothing in the repo has ever called it. It looks like an intended third per-feature lifecycle hook alongside update and normalize, which MulticompartmentConnection does call over its pipeline. The matching 'for f in self.pipeline: f.degrade()' loop was never written; degradation lives in Degradation.compute instead, which is where the pipeline applies it and which already guards against degrade_function being None. Fixing the method would leave two spellings of the same operation, one of them unguarded, so remove it. Reported by @Anai-Guo in #792. Co-Authored-By: Claude Opus 5 --- bindsnet/network/topology_features.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bindsnet/network/topology_features.py b/bindsnet/network/topology_features.py index 7abcd636..18322811 100644 --- a/bindsnet/network/topology_features.py +++ b/bindsnet/network/topology_features.py @@ -283,16 +283,6 @@ def normalize(self) -> None: abs_sum[abs_sum == 0] = 1.0 self.value *= self.norm / abs_sum - def degrade(self) -> None: - # language=rst - """ - Degrade the value of the propagated spikes according to the features value. A lambda function should be passed - into the constructor which takes a single argument (which represent the value), and returns a value which will - be *subtracted* from the propagated spikes. - """ - - return self.degrade(self.value) - def link(self, parent_feature) -> None: # language=rst """