From 9ab73ea875e5cc9119781ded3dd133112765ca07 Mon Sep 17 00:00:00 2001 From: nikohansen Date: Tue, 20 Nov 2018 13:56:31 +0100 Subject: [PATCH] version 2.6.1 and fixed test for Python 2 --- cma/__init__.py | 4 ++-- cma/optimization_tools.py | 4 ++-- cma/utilities/utils.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cma/__init__.py b/cma/__init__.py index 19d7910..32305fb 100644 --- a/cma/__init__.py +++ b/cma/__init__.py @@ -144,7 +144,7 @@ # fcts = ff # historical reasons only, replace cma.fcts with cma.ff first __author__ = 'Nikolaus Hansen' -__version__ = "2.6.0 $Revision: 4423 $ $Date: 2018-04-25 16:34:52 +0200 (Wed, 25 Apr 2018) $" +__version__ = "2.6.1 $Revision: 4424 $ $Date: 2018-11-18 20:02:58 +0100 (Sun, 18 Nov 2018) $" # $Source$ # according to PEP 8 style guides, but what is it good for? -# $Id: __init__.py 4423 2018-04-25 14:34:52Z hansen $ +# $Id: __init__.py 4424 2018-11-18 19:02:58Z hansen $ # bash $: svn propset svn:keywords 'Date Revision Id' __init__.py diff --git a/cma/optimization_tools.py b/cma/optimization_tools.py index 6a4126d..3ce420e 100644 --- a/cma/optimization_tools.py +++ b/cma/optimization_tools.py @@ -97,8 +97,8 @@ def contour_data(fct, x_range, y_range): >>> x0 = np.zeros(22) >>> indices_to_vary = [2, 4] >>> f2 = cma.fitness_transformations.FixVariables(fd, - ... {i: x0[i] for i in range(len(x0)) - ... if i not in indices_to_vary}) + ... dict((i, x0[i]) for i in range(len(x0)) + ... if i not in indices_to_vary)) >>> isinstance(f2, cma.fitness_transformations.FixVariables) True >>> isinstance(f2, cma.fitness_transformations.ComposedFunction) diff --git a/cma/utilities/utils.py b/cma/utilities/utils.py index fc4c8a8..0d2d592 100644 --- a/cma/utilities/utils.py +++ b/cma/utilities/utils.py @@ -290,7 +290,7 @@ class DictClass(dict): """A class wrapped over `dict` to use class .-notation. >>> from cma.utilities.utils import DictClass - >>> dict_ = {3 * c: c for c in 'abcd'} + >>> dict_ = dict((3 * c, c) for c in 'abcd') >>> as_class = DictClass(dict_) >>> assert as_class.__dict__ == dict_ == as_class >>> assert as_class.aaa == 'a'