Changeset 101
- Timestamp:
- 11/19/07 15:11:56 (1 year ago)
- Files:
-
- projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/pack.py (added)
- projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/params.py (modified) (2 diffs)
- projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/test/test_pack.py (added)
- projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/test/test_params.py (modified) (1 diff)
- projects/Twisted-Goodies/trunk/twisted_goodies/test/mock.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/params.py
r100 r101 4 4 # graciously granted by Twisted Matrix Laboratories, http://twistedmatrix.com. 5 5 # 6 # Copyright (C) 200 6-2007 by Edwin A. Suominen, http://www.eepatents.com6 # Copyright (C) 2007 by Edwin A. Suominen, http://www.eepatents.com 7 7 # 8 8 # This program is free software; you can redistribute it and/or modify it under … … 101 101 """ 102 102 Returns a key that is based on the hashes of my key attributes and any 103 arguments supplied. With some recursion as needed, hashes are done even 104 in cases where they couldn't be ordinarily. 103 arguments supplied. The arguments must be hashable directly, but the 104 key attributes are hashed with some recursion as needed and can be 105 lists or dicts. 105 106 """ 106 107 def superHash(x): projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/test/test_params.py
r100 r101 4 4 # graciously granted by Twisted Matrix Laboratories, http://twistedmatrix.com. 5 5 # 6 # Copyright (C) 200 6-2007 by Edwin A. Suominen, http://www.eepatents.com6 # Copyright (C) 2007 by Edwin A. Suominen, http://www.eepatents.com 7 7 # 8 8 # This program is free software; you can redistribute it and/or modify it under projects/Twisted-Goodies/trunk/twisted_goodies/test/mock.py
r63 r101 158 158 self.failUnlessEqual(*args) 159 159 160 def failUnlessArraysAlmostEqual(self, X, Y, places=15): 161 import scipy as s 162 self.failUnlessEqual( 163 s.shape(X), s.shape(Y), "Array shapes aren't even equal!") 164 error = sum((X - Y)**2) 165 while s.shape(error): 166 error = sum(error) 167 self.failUnlessAlmostEqual(error, 0.0, places) 168 160 169 @defer.deferredGenerator 161 170 def caserator(self, method, expectations, cases, comparator=None):
