Changeset 6148 for anuga_core/source/anuga/caching/caching.py
- Timestamp:
- Jan 13, 2009, 12:12:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/caching/caching.py
r6117 r6148 50 50 else: 51 51 unix = 1 52 53 import Numeric as num 54 52 55 53 56 cache_dir = '.python_cache' … … 1341 1344 1342 1345 from types import TupleType, ListType, DictType, InstanceType 1343 from Numeric import ArrayType, average1344 1345 1346 1346 1347 if type(T) in [TupleType, ListType, DictType, InstanceType]: … … 1380 1381 I.sort() 1381 1382 val = myhash(I, ids) 1382 elif type(T) == ArrayType:1383 elif type(T) == num.ArrayType: 1383 1384 # Use mean value for efficiency 1384 val = hash( average(T.flat))1385 val = hash(num.average(T.flat)) 1385 1386 elif type(T) == InstanceType: 1386 1387 val = myhash(T.__dict__, ids) … … 1406 1407 1407 1408 from types import TupleType, ListType, DictType, InstanceType 1408 from Numeric import ArrayType, alltrue1409 1409 1410 1410 # Keep track of unique id's to protect against infinite recursion … … 1449 1449 identical = compare(a, b, ids) 1450 1450 1451 elif type(A) == ArrayType:1451 elif type(A) == num.ArrayType: 1452 1452 # Use element by element comparison 1453 identical = alltrue(A==B)1453 identical = num.alltrue(A==B) 1454 1454 1455 1455 elif type(A) == InstanceType: … … 2403 2403 else: 2404 2404 # Truncate large Numeric arrays before using str() 2405 import Numeric 2406 if type(args) == Numeric.ArrayType: 2405 if type(args) == num.ArrayType: 2407 2406 # if len(args.flat) > textwidth: 2408 2407 # Changed by Duncan and Nick 21/2/07 .flat has problems with 2409 2408 # non-contigous arrays and ravel is equal to .flat except it 2410 2409 # can work with non-contiguous arrays 2411 if len( Numeric.ravel(args)) > textwidth:2410 if len(num.ravel(args)) > textwidth: 2412 2411 args = 'Array: ' + str(args.shape) 2413 2412
Note: See TracChangeset
for help on using the changeset viewer.