From 502182d723f2391e105f037f8bde30b6633fc727 Mon Sep 17 00:00:00 2001 From: Ron Harwood Date: Fri, 17 Nov 2023 10:49:46 -0500 Subject: [PATCH 1/2] Update gp.py fix for cxOnePointLeafBiased and python 3.11 --- deap/gp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deap/gp.py b/deap/gp.py index ccc47b6b..bf05f040 100644 --- a/deap/gp.py +++ b/deap/gp.py @@ -744,7 +744,7 @@ def cxOnePointLeafBiased(ind1, ind2, termpb): if len(common_types) > 0: # Set does not support indexing - type_ = random.sample(common_types, 1)[0] + type_ = random.sample(list(common_types, 1))[0] index1 = random.choice(types1[type_]) index2 = random.choice(types2[type_]) From daa0c5cf8e393a6de5f375b12b97599c7e434d08 Mon Sep 17 00:00:00 2001 From: Ron Harwood Date: Fri, 17 Nov 2023 10:52:41 -0500 Subject: [PATCH 2/2] Update gp.py Fix for cxOnePointLeafBiased and python 3.11 --- deap/gp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deap/gp.py b/deap/gp.py index bf05f040..eee4665d 100644 --- a/deap/gp.py +++ b/deap/gp.py @@ -744,7 +744,7 @@ def cxOnePointLeafBiased(ind1, ind2, termpb): if len(common_types) > 0: # Set does not support indexing - type_ = random.sample(list(common_types, 1))[0] + type_ = random.sample(list(common_types), 1)[0] index1 = random.choice(types1[type_]) index2 = random.choice(types2[type_])