/usr/lib/python2.7/dist-packages/deap/tests/test_logbook.py is in python-deap 1.0.2.post2-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | import sys
import unittest
sys.path.append("..")
from deap import tools
class LogbookTest(unittest.TestCase):
def setUp(self):
self.logbook = tools.Logbook()
print
def test_multi_chapters(self):
self.logbook.record(gen=0, evals=100, fitness={'obj 1' : {'avg' : 1.0, 'max' : 10},
'avg' : 1.0, 'max' : 10},
length={'avg' : 1.0, 'max' : 30},
test={'avg' : 1.0, 'max' : 20})
self.logbook.record(gen=0, evals=100, fitness={'obj 1' : {'avg' : 1.0, 'max' : 10},
'avg' : 1.0, 'max' : 10},
length={'avg' : 1.0, 'max' : 30},
test={'avg' : 1.0, 'max' : 20})
print(self.logbook.stream)
def test_one_chapter(self):
self.logbook.record(gen=0, evals=100, fitness={'avg' : 1.0, 'max' : 10})
self.logbook.record(gen=0, evals=100, fitness={'avg' : 1.0, 'max' : 10})
print(self.logbook.stream)
def test_one_big_chapter(self):
self.logbook.record(gen=0, evals=100, fitness={'obj 1' : {'avg' : 1.0, 'max' : 10}, 'obj 2' : {'avg' : 1.0, 'max' : 10}})
self.logbook.record(gen=0, evals=100, fitness={'obj 1' : {'avg' : 1.0, 'max' : 10}, 'obj 2' : {'avg' : 1.0, 'max' : 10}})
print(self.logbook.stream)
def test_no_chapters(self):
self.logbook.record(gen=0, evals=100, **{'avg' : 1.0, 'max' : 10})
self.logbook.record(gen=0, evals=100, **{'avg' : 1.0, 'max' : 10})
print(self.logbook.stream)
if __name__ == "__main__":
suite = unittest.TestLoader().loadTestsFromTestCase(LogbookTest)
unittest.TextTestRunner(verbosity=2).run(suite)
|