Index: /anuga_core/source/anuga/caching/caching.py
===================================================================
--- /anuga_core/source/anuga/caching/caching.py	(revision 6116)
+++ /anuga_core/source/anuga/caching/caching.py	(revision 6117)
@@ -407,5 +407,7 @@
 # -----------------------------------------------------------------------------
 
-#Has mostly been moved to proper unit test
+# Has mostly been moved to proper unit test.
+# What remains here includes example of the 
+# cache statistics form.
 def test(cachedir=None,verbose=0,compression=None):
   """Test the functionality of caching.
@@ -424,6 +426,6 @@
   # Initialise
   #
-  import caching
-  reload(caching)
+  #import caching
+  #reload(caching)
 
   if not cachedir:
@@ -520,6 +522,6 @@
     #
     try:
-      T1 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, evaluate=1, \
-                         verbose=verbose, compression=comp)
+      T1 = cache(f,(a,b,c,N), {'x':x, 'y':y}, evaluate=1, \
+                   verbose=verbose, compression=comp)
       if comp:                   
         test_OK('Caching evaluation with compression')
@@ -535,6 +537,6 @@
     #                           
     try:                         
-      T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                         compression=comp) 
+      T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+                   compression=comp) 
 
       if comp:                   
@@ -564,6 +566,6 @@
   #    
   try:
-    FN = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       return_filename=1)    
+    FN = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+                 return_filename=1)    
     assert(FN[:2] == 'f[')
     test_OK('Return of cache filename')
@@ -587,7 +589,7 @@
   #      
   try:
-    #T1 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+    #T1 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
     #                   evaluate=1)  
-    T4 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, test=1)
+    T4 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, test=1)
     assert(T1 == T4)
 
@@ -599,10 +601,10 @@
   #
   #try:
-  #  caching.cache(f,'clear',verbose=verbose)
+  #  cache(f,'clear',verbose=verbose)
   #  test_OK('Clearing of cache files')
   #except:
   #  test_error('Clear does not work')
   try:
-    caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, clear=1)    
+    cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, clear=1)    
     test_OK('Clearing of cache files')
   except:
@@ -614,5 +616,5 @@
   #      
   try:
-    T4 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, test=1)
+    T4 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, test=1)
     assert(T4 is None)
     test_OK("Option 'test' when cache absent")
@@ -622,8 +624,8 @@
   # Test dependencies
   #
-  T1 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       dependencies=DepFN)  
-  T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       dependencies=DepFN)                     
+  T1 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+               dependencies=DepFN)  
+  T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+               dependencies=DepFN)                     
                        
   if T1 == T2:
@@ -634,6 +636,6 @@
   # Test basic wildcard dependency
   #
-  T3 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       dependencies=DepFN_wildcard)                     
+  T3 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+               dependencies=DepFN_wildcard)                     
     
   if T1 == T3:
@@ -650,6 +652,6 @@
   Depfile.close()
   
-  T3 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       dependencies=DepFN, test = 1)                     
+  T3 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+               dependencies=DepFN, test = 1)                     
   
   if T3 is None:
@@ -660,6 +662,6 @@
   # Test recomputation when dependencies have changed
   #
-  T3 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
-                       dependencies=DepFN)                       
+  T3 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, \
+               dependencies=DepFN)                       
   if T1 == T3:
     test_OK('Recomputed value with changed dependencies')
@@ -675,9 +677,9 @@
   N = 20*N   #Should be large on fast computers...
   tt = time.time()
-  T1 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose)
+  T1 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose)
   t1 = time.time() - tt
   
   tt = time.time()
-  T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose)
+  T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose)
   t2 = time.time() - tt
   
@@ -706,7 +708,7 @@
   print_header_box('Show sample output of the caching function:')
   
-  T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=0)
-  T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=0)
-  T2 = caching.cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=1)
+  T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=0)
+  T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=0)
+  T2 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=1)
   
   print_header_box('Show sample output of cachestat():')
@@ -719,5 +721,5 @@
       cachestat()
     except:  
-      print 'caching.cachestat() does not work here, because it'
+      print 'cachestat() does not work here, because it'
       print 'relies on time.strptime() which is unavailable in Windows'
       
@@ -763,5 +765,5 @@
               'Bytecode has changed',
               'Recomputation was requested by caller',
-	      'Cached file was unreadable']              
+              'Cached file was unreadable']              
               
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -982,6 +984,6 @@
         A = raw_input('Delete (Y/N)[N] ?')
       else:
-        A = 'Y'	
-	
+        A = 'Y' 
+        
       if A == 'Y' or A == 'y':
         for file_name in file_names:
@@ -1226,5 +1228,5 @@
         #raise Exception
         reason = 6  # Unreadable file
-	return None, reason  
+        return None, reason  
       
       
@@ -1238,5 +1240,5 @@
         #Catch e.g., file with 0 length or corrupted
         reason = 6  # Unreadable file
-	return None, reason
+        return None, reason
       
   except MemoryError:
@@ -1816,5 +1818,5 @@
             str(round(loadtime,4)) +\
             CR
-	    
+            
     statfile.write(entry)
     statfile.close()
@@ -1899,11 +1901,11 @@
         if len(record) == 9:
           timestamp = record[0]
-	
-	  try:
+        
+          try:
             t = mktime(strptime(timestamp))
-	  except:
-            total_discarded = total_discarded + 1	  
-	    continue    
-	     
+          except:
+            total_discarded = total_discarded + 1         
+            continue    
+             
           if t > lastday:
             lastday = t
