[Python-modules-commits] [deap] 01/03: unapply patches from git-dpm
Daniel Stender
stender at moszumanska.debian.org
Sat Jul 15 19:05:09 UTC 2017
This is an automated email from the git hooks/post-receive script.
stender pushed a commit to branch debian/master
in repository deap.
commit 85b6cd22f8f913decd0eb4985742f06c2d437b10
Author: Daniel Stender <stender at debian.org>
Date: Sat Jul 15 20:38:40 2017 +0200
unapply patches from git-dpm
---
deap/tests/test_logbook.py | 2 +-
deap/tests/test_pickle.py | 13 +++++++------
doc/_templates/layout.html | 12 ++++++++++--
doc/conf.py | 11 ++++-------
doc/examples/pso_basic.rst | 19 +++++++++++++++++++
5 files changed, 41 insertions(+), 16 deletions(-)
diff --git a/deap/tests/test_logbook.py b/deap/tests/test_logbook.py
index b5f2834..f0238fd 100644
--- a/deap/tests/test_logbook.py
+++ b/deap/tests/test_logbook.py
@@ -3,7 +3,7 @@ import unittest
sys.path.append("..")
-from deap import tools
+import tools
class LogbookTest(unittest.TestCase):
diff --git a/deap/tests/test_pickle.py b/deap/tests/test_pickle.py
index 0f808ab..696b4db 100644
--- a/deap/tests/test_pickle.py
+++ b/deap/tests/test_pickle.py
@@ -4,15 +4,16 @@ import unittest
import array
import pickle
import operator
+from test import test_support
sys.path.append("..")
import numpy
-from deap import creator
-from deap import base
-from deap import gp
-from deap import tools
+import creator
+import base
+import gp
+import tools
def func():
return "True"
@@ -56,8 +57,8 @@ class Pickling(unittest.TestCase):
ind.fitness.values = (1.0,)
ind_s = pickle.dumps(ind)
ind_l = pickle.loads(ind_s)
- # msg = "Unpickled individual %s != pickled individual %s" % (str(ind), str(ind_l))
- self.failUnlessEqual(ind, ind_l)
+ msg = "Unpickled individual %s != pickled individual %s" % (str(ind), str(ind_l))
+ self.failUnlessEqual(ind, ind_l, msg)
msg = "Unpickled fitness %s != pickled fitness %s" % (str(ind.fitness), str(ind_l.fitness))
self.failUnlessEqual(ind.fitness, ind_l.fitness, msg)
diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
index 7c98e3b..41cccd5 100644
--- a/doc/_templates/layout.html
+++ b/doc/_templates/layout.html
@@ -11,7 +11,7 @@
{% endblock %}
{% block rootrellink %}
- <li><a href="http://code.google.com/p/deap/"><img src="{{ pathto('_static/deap_icon_16x16.ico', 1) }}" style="height: 30px; vertical-align: middle; padding-right: 1em;" />Project Homepage</a>{{ reldelim1 }}</li>
+ <li><a href="http://code.google.com/p/deap/"><img src="{{ pathto('_static/deap_icon-39x55.png', 1) }}" style="height: 30px; vertical-align: middle; padding-right: 1em;" />Project Homepage</a>{{ reldelim1 }}</li>
<li><a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }} </li>
{% endblock %}
@@ -25,5 +25,13 @@
<br />
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version|e }}.
</div>
-
+<script type="text/javascript">
+ (function() {
+ var ga = document.createElement('script');
+ ga.src = ('https:' == document.location.protocol ?
+ 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.setAttribute('async', 'true');
+ document.documentElement.firstChild.appendChild(ga);
+ })();
+</script>
{% endblock %}
diff --git a/doc/conf.py b/doc/conf.py
index 58c573a..c65136e 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -37,8 +37,6 @@ else:
extensions += ['matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive']
-plot_formats = [('png', 80), ('hires.png', 200)]
-
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -53,8 +51,7 @@ master_doc = 'index'
# General information about the project.
project = u'DEAP'
-#copyright = u'2009-%s, DEAP Project' % time.strftime('%Y')
-copyright = u'2009-2015, DEAP Project'
+copyright = u'2009-%s, DEAP Project' % time.strftime('%Y')
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -129,10 +126,10 @@ plot_include_source = False
plot_html_show_formats = True
# -- Options for extlinks extension ----------------------------------------------
-#import subprocess
-#branch = str(subprocess.check_output(["hg", "branch"])[:-1])
+import subprocess
+tree = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip()
-extlinks = {'example': ('https://github.com/DEAP/deap/blob/master/examples/%s.py','examples/')}
+extlinks = {'example': ('https://github.com/DEAP/deap/blob/{tree}/examples/%s.py'.format(tree=tree), "examples/")}
# -- Options for HTML output ---------------------------------------------------
# Add any paths that contain custom themes here, relative to this directory.
diff --git a/doc/examples/pso_basic.rst b/doc/examples/pso_basic.rst
index 6232bca..01a488a 100644
--- a/doc/examples/pso_basic.rst
+++ b/doc/examples/pso_basic.rst
@@ -97,6 +97,25 @@ Conclusion
The full PSO basic example can be found here : :example:`pso/basic`.
+This is a video of the algorithm in action, plotted with matplotlib_.
+The red dot represents the best solution found so far.
+
+.. _matplotlib: http://matplotlib.org/
+
+.. raw:: html
+
+ <center>
+ <object style="height: 390px; width: 640px">
+ <param name="movie" value="http://www.youtube.com/v/f3MW2krobpo?version=3&feature=player_detailpage">
+ <param name="allowFullScreen" value="true">
+ <param name="allowScriptAccess" value="always">
+ <embed src="http://www.youtube.com/v/f3MW2krobpo?version=3&feature=player_detailpage"
+ type="application/x-shockwave-flash" allowfullscreen="true"
+ allowScriptAccess="always"
+ width="640" height="360">
+ </object>
+ </center>
+
References
==========
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/deap.git
More information about the Python-modules-commits
mailing list