Skip to content

Commit

Permalink
Updating example code to current version
Browse files Browse the repository at this point in the history
The stringify versinofunction to verbose the content of expressions or PrimitiveTrees is no longer supported and the str function has to be used instead.
  • Loading branch information
theGreatWhiteShark committed Apr 20, 2017
1 parent 043862c commit 80f7cdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/tutorials/advanced/gp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ Evaluation of Trees

In DEAP, trees can be translated to readable Python code and compiled to Python
code objects using functions provided by the :py:mod:`~deap.gp` module. The first
function, :func:`~deap.gp.stringify` takes an expression or a PrimitiveTree and
function, :func:`str` takes an expression or a PrimitiveTree and
translates it into readable Python code. For example, the following lines
generate a tree and output the code from the first example primitive set. ::

>>> expr = genFull(pset, min_=1, max_=3)
>>> tree = PrimitiveTree(expr)
>>> stringify(tree)
>>> str(tree)
'mul(add(x, x), max(y, x))'

Now, this string represents the program we just generated, but it cannot yet be
Expand Down

0 comments on commit 80f7cdb

Please sign in to comment.