From bc8084af97ea9c9c552efbbefd45d730f1dbd7b6 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 25 Jan 2024 15:49:01 +0100 Subject: [PATCH] fix: replace `list.delete` call by the proper `remove` method --- umap/tests/test_merge_features.py | 10 +++++----- umap/utils.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/umap/tests/test_merge_features.py b/umap/tests/test_merge_features.py index d67e1e43..b457487a 100644 --- a/umap/tests/test_merge_features.py +++ b/umap/tests/test_merge_features.py @@ -33,11 +33,11 @@ def test_adding_elements(): def test_adding_one_removing_one(): - assert merge_features(["A", "B"], ["A", "C"], ["A", "B", "D"]) == [ - "A", - "C", - "D", - ] + assert merge_features(["A", "B"], ["A", "C"], ["A", "B", "D"]) == ["A", "C", "D"] + + +def test_removing_one(): + assert merge_features(["A", "B"], ["A", "B", "C"], ["A", "D"]) == ["A", "C", "D"] def test_removing_same_element(): diff --git a/umap/utils.py b/umap/utils.py index 2a51fe4e..003b9b01 100644 --- a/umap/utils.py +++ b/umap/utils.py @@ -156,7 +156,7 @@ def merge_features(reference: list, latest: list, incoming: list): # Reapply the changes on top of the latest. for item in removed: - merged.delete(item) + merged.remove(item) for item in added: merged.append(item)