Changeset 1743


Ignore:
Timestamp:
Aug 23, 2005, 3:03:08 PM (20 years ago)
Author:
ole
Message:

Work on new set_quantity and caching

Location:
inundation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inundation/caching/__init__.py

    r1737 r1743  
    22"""
    33
    4 pass
     4from caching import *
    55
     6
  • inundation/pyvolution/quantity.py

    r1697 r1743  
    7979
    8080
     81
     82
     83    #New leaner interface to setting values
     84    #def set_quantity(self,
     85    #                 numeric = None,  #List, numeric array or constant
     86    #                 function = None, #Callable object: f(x,y) where x any are arrays
     87    #                 points = None, values = None, alpha = None, #Input for least squares
     88    #                 filename, attribute_name,                   #Input from file
     89    #                 location
     90   
     91
     92
     93    #Old interface to setting values
    8194    def set_values(self, X,
    8295                   location='vertices',
  • inundation/pyvolution/util.py

    r1681 r1743  
    348348
    349349        # Get the variables
    350         points = fid.variables['points']
     350        points = fid.variables['points'][:]
    351351        keys = fid.variables.keys()
    352352        attributes = {}
    353353        for key in keys:
    354354            if key != 'points':
    355                 attributes[key] = fid.variables[key]
    356         #Don't close - arrays are needed outside this function,
    357         #alternatively take a copy here
     355                attributes[key] = fid.variables[key][:]
     356
     357        fid.close()       
    358358    else:
    359359        #Read as ASCII file assuming that it is separated by whitespace
Note: See TracChangeset for help on using the changeset viewer.