Changeset 4277


Ignore:
Timestamp:
Feb 23, 2007, 3:23:02 PM (17 years ago)
Author:
nick
Message:

update caching to work with non-contiguous array by changing .flat to ravel()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/caching/caching.py

    r4270 r4277  
    332332    else:  # Evaluate function and save to cache
    333333      if verbose:
     334       
    334335        msg1(funcname, args, kwargs,reason)
    335336
     
    741742                            # comp_level = 1 works well.
    742743textwidth1 = 16             # Text width of key fields in report forms.
    743 textwidth2 = 132            # Maximal width of textual representation of
     744#textwidth2 = 132            # Maximal width of textual representation of
     745textwidth2 = 300            # Maximal width of textual representation of
    744746                            # arguments.
    745747textwidth3 = 16             # Initial width of separation lines. Is modified.
     
    23032305      import Numeric
    23042306      if type(args) == Numeric.ArrayType:
    2305         if len(args.flat) > textwidth:
     2307#        if len(args.flat) > textwidth: 
     2308#        Changed by Duncan and Nick 21/2/07 .flat has problems with
     2309#        non-contigous arrays and ravel is equal to .flat except it
     2310#        can work with non-contigous arrays
     2311        if len(Numeric.ravel(args)) > textwidth:
    23062312          args = 'Array: ' + str(args.shape)
    23072313
Note: See TracChangeset for help on using the changeset viewer.