From 6d5664a1ce48fa0a138559c5228d9fe49fb349da Mon Sep 17 00:00:00 2001 From: Vince Knight Date: Mon, 28 Mar 2016 15:49:00 +0100 Subject: [PATCH 1/2] Addressing #503 Moving module docstring to class for strategy. --- axelrod/strategies/geller.py | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/axelrod/strategies/geller.py b/axelrod/strategies/geller.py index 8fd2a39af..5b0fc7921 100644 --- a/axelrod/strategies/geller.py +++ b/axelrod/strategies/geller.py @@ -1,24 +1,5 @@ # -*- coding: utf-8 -*- -""" -Geller - by Martin Chorley (@martinjc), heavily inspired by Matthew Williams (@voxmjw) - -This code is inspired by Matthew Williams' talk -"Cheating at rock-paper-scissors — meta-programming in Python" -given at Django Weekend Cardiff in February 2014. - -His code is here: https://github.com/mattjw/rps_metaprogramming -and there's some more info here: http://www.mattjw.net/2014/02/rps-metaprogramming/ - -This code is **way** simpler than Matt's, as in this exercise we already -have access to the opponent instance, so don't need to go -hunting for it in the stack. Instead we can just call it to -see what it's going to play, and return a result based on that - -This is almost certainly cheating, and more than likely against the -spirit of the 'competition' :-) -""" - import inspect from axelrod import Actions, Player, random_choice @@ -29,6 +10,23 @@ class Geller(Player): """Observes what the player will do in the next round and adjust. If unable to do this: will play randomly. + + Geller - by Martin Chorley (@martinjc), heavily inspired by Matthew Williams (@voxmjw) + + This code is inspired by Matthew Williams' talk + "Cheating at rock-paper-scissors — meta-programming in Python" + given at Django Weekend Cardiff in February 2014. + + His code is here: https://github.com/mattjw/rps_metaprogramming + and there's some more info here: http://www.mattjw.net/2014/02/rps-metaprogramming/ + + This code is **way** simpler than Matt's, as in this exercise we already + have access to the opponent instance, so don't need to go + hunting for it in the stack. Instead we can just call it to + see what it's going to play, and return a result based on that + + This is almost certainly cheating, and more than likely against the + spirit of the 'competition' :-) """ name = 'Geller' From 32aca15338dd89f9887386c654bbd88f57d81d85 Mon Sep 17 00:00:00 2001 From: Vince Knight Date: Mon, 28 Mar 2016 16:09:18 +0100 Subject: [PATCH 2/2] Adding rtd theme to travis install. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6448c824b..2d62c2410 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_install: install: - pip install -r requirements.txt - pip install sphinx + - pip install sphinx_rtd_theme - pip install coverage - pip install coveralls script: