From 97f5ca6b8439fca8f365e4d9e5f23717f5cd4624 Mon Sep 17 00:00:00 2001 From: Michael T Smith Date: Thu, 4 Aug 2016 09:26:40 +0100 Subject: [PATCH] Modified set code in test to work with python 2 and python 3. --- GPy/testing/util_tests.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/GPy/testing/util_tests.py b/GPy/testing/util_tests.py index ce0beaaa..ba3d7ddf 100644 --- a/GPy/testing/util_tests.py +++ b/GPy/testing/util_tests.py @@ -148,12 +148,10 @@ class TestDebug(unittest.TestCase): [ 1.71881079], [ 2.67162871], [ 3.23761907]])] - + #try doing the clustering active = GPy.util.cluster_with_offset.cluster(data,inputs) - #check to see that the clustering has correctly clustered the time series. - from sets import Set - clusters = Set([Set(cluster) for cluster in active]) - assert Set([1,2]) in clusters, "Offset Clustering algorithm failed" - assert Set([0,3]) in clusters, "Offset Clustering algoirthm failed" + clusters = set([frozenset(cluster) for cluster in active]) + assert set([1,2]) in clusters, "Offset Clustering algorithm failed" + assert set([0,3]) in clusters, "Offset Clustering algoirthm failed"