[pyevolve] 27/81: Added patch for broken example 12
Christian Kastner
chrisk-guest at moszumanska.debian.org
Sun Aug 17 21:12:40 UTC 2014
This is an automated email from the git hooks/post-receive script.
chrisk-guest pushed a commit to branch master
in repository pyevolve.
commit c30165a1a7e4ab9a58d4fb79b97b70067cd35d82
Author: Christian Kastner <debian at kvr.at>
Date: Mon Jun 28 15:18:16 2010 +0200
Added patch for broken example 12
---
debian/changelog | 1 +
debian/patches/0002-Fix-broken-example-12.patch | 61 +++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 63 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 36766a5..336becf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ pyevolve (0.6~rc1~svn397+dfsg-1) unstable; urgency=low
* Initial release (Closes: #580924)
* debian/patches:
- 0001-Use-documentation-template-from-0.5
+ - 0002-Fix-broken-example-12
* Upload sponsored by Yaroslav Halchenko <debian at onerussian.com>
-- Christian Kastner <debian at kvr.at> Wed, 26 May 2010 22:32:46 +0200
diff --git a/debian/patches/0002-Fix-broken-example-12.patch b/debian/patches/0002-Fix-broken-example-12.patch
new file mode 100644
index 0000000..e26b91a
--- /dev/null
+++ b/debian/patches/0002-Fix-broken-example-12.patch
@@ -0,0 +1,61 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Mon, 28 Jun 2010 15:17:11 +0200
+Subject: [PATCH] Fix broken example 12
+
+Psyco is not available on 64-bit systems, so we transfer a hard import
+requirement to a soft one. Also, the example attempts to use a directory
+which does not exist.
+
+Forwarded: yes
+Last-Update: 2010-06-28
+---
+ examples/pyevolve_ex12_tsp.py | 18 ++++++++++++++++--
+ 1 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/examples/pyevolve_ex12_tsp.py b/examples/pyevolve_ex12_tsp.py
+index 385bf46..2a4c5b8 100644
+--- a/examples/pyevolve_ex12_tsp.py
++++ b/examples/pyevolve_ex12_tsp.py
+@@ -5,9 +5,11 @@ from pyevolve import Crossovers
+ from pyevolve import Consts
+
+ import sys, random
++import os
+ random.seed(1024)
+ from math import sqrt
+
++
+ PIL_SUPPORT = None
+
+ try:
+@@ -104,6 +106,13 @@ def main_run():
+ genome.crossover.set(Crossovers.G1DListCrossoverEdge)
+ genome.initializator.set(G1DListTSPInitializator)
+
++ if not os.path.isdir("tspimg"):
++ try:
++ os.mkdir("tspimg")
++ except:
++ print "Could not create directory tspimg"
++ return
++
+ # 3662.69
+ ga = GSimpleGA.GSimpleGA(genome)
+ ga.setGenerations(200000)
+@@ -115,8 +124,13 @@ def main_run():
+ # This is to make a video
+ ga.stepCallback.set(evolve_callback)
+ # 21666.49
+- import psyco
+- psyco.full()
++
++ # Don't fail on 64-bit
++ try:
++ import psyco
++ psyco.full()
++ except ImportError:
++ pass
+
+ ga.evolve(freq_stats=500)
+ best = ga.bestIndividual()
+--
diff --git a/debian/patches/series b/debian/patches/series
index 503f9d2..339db5b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0001-Use-documentation-template-from-0.5.patch
+0002-Fix-broken-example-12.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyevolve.git
More information about the debian-science-commits
mailing list