Skip to content

Commit e2ebd3d

Browse files
committed
fixup more_algorithms
1 parent 9df4823 commit e2ebd3d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cma/more_algorithms/purecma.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def fmin(objective_fct, xstart, sigma,
114114
=======
115115
The following example minimizes the function `ff.elli`:
116116
117-
>>> try: import cma.purecma as purecma
117+
>>> try: from cma import purecma
118118
... except ImportError: import purecma
119119
>>> def felli(x):
120120
... return sum(10**(6 * i / (len(x)-1)) * xi**2
@@ -495,7 +495,7 @@ class CMAESDataLogger(_BaseDataLogger): # could also inherit from object
495495
496496
Use the default logger from `CMAES`:
497497
498-
>>> try: import cma.purecma as pcma
498+
>>> try: from cma import purecma as pcma
499499
... except ImportError: import purecma as pcma
500500
>>> es = pcma.CMAES(3 * [0.1], 1)
501501
>>> isinstance(es.logger, pcma.CMAESDataLogger) # type(es.logger)
@@ -881,11 +881,11 @@ def safe_str(s, known_words=None):
881881
882882
Known issues:
883883
884-
>>> try: from cma.purecma import safe_str
885-
... except ImportError: from purecma import safe_str
886-
>>> safe_str('int(p)', {'int': 'int', 'p': 3.1}) # fine
884+
>>> try: from cma import purecma
885+
... except ImportError: import purecma
886+
>>> purecma.safe_str('int(p)', {'int': 'int', 'p': 3.1}) # fine
887887
' int ( 3.1 )'
888-
>>> safe_str('int(n)', {'int': 'int', 'n': 3.1}) # unexpected
888+
>>> purecma.safe_str('int(n)', {'int': 'int', 'n': 3.1}) # unexpected
889889
' i 3.1 t ( 3.1 )'
890890
891891
"""
@@ -1251,7 +1251,7 @@ def test():
12511251
12521252
Currently only based on `doctest`:
12531253
1254-
>>> try: import cma.purecma as pcma
1254+
>>> try: from cma import purecma as pcma
12551255
... except ImportError: import purecma as pcma
12561256
>>> import random
12571257
>>> random.seed(8)

0 commit comments

Comments
 (0)