Changeset 5349
- Timestamp:
- May 21, 2008, 10:32:42 AM (17 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/test_quantity.py
r4957 r5349 884 884 os.remove(pts_file) 885 885 886 def verbose_test_set_values_from_UTM_pts(self):886 def test_set_values_from_UTM_pts(self): 887 887 quantity = Quantity(self.mesh_onslow) 888 888 889 VERBOSE = False # Change this to True to see output 889 890 #Get (enough) datapoints 890 891 data_points = [[-21.5, 114.5],[-21.4, 114.6],[-21.45,114.65], … … 941 942 #Check that values can be set from file 942 943 quantity.set_values_from_file(pts_file, att, 0, 943 'vertices', None, verbose = True,944 'vertices', None, verbose = VERBOSE, 944 945 max_read_lines=2) 945 946 answer = linear_function(quantity.domain.get_vertex_coordinates()) … … 949 950 950 951 #Check that values can be set from file 951 quantity.set_values(filename = pts_file, 952 quantity.set_values(filename = pts_file, verbose = VERBOSE, 952 953 attribute_name = att, alpha = 0) 953 954 answer = linear_function(quantity.domain.get_vertex_coordinates()) … … 961 962 assert allclose(quantity.vertex_values.flat, answer) 962 963 964 #Check that values can be block read from a text file 965 quantity.set_values_from_file(txt_file, att, 0, 966 'vertices', None, verbose = VERBOSE, 967 max_read_lines=2) 968 963 969 #Cleanup 964 970 import os … … 2348 2354 #print "restricted test" 2349 2355 #suite = unittest.makeSuite(Test_Quantity,'verbose_test_set_values_from_UTM_pts') 2350 runner = unittest.TextTestRunner() 2356 runner = unittest.TextTestRunner() #verbosity=2) 2351 2357 runner.run(suite) -
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r5327 r5349 19 19 from anuga.geospatial_data.geospatial_data import ensure_absolute 20 20 from math import sqrt, atan, degrees 21 21 from exceptions import IOError 22 22 23 23 … … 179 179 try: 180 180 fid = open(filename) 181 except Exception, e:181 except IOError, e: 182 182 msg = 'File "%s" could not be opened: Error="%s"'\ 183 183 %(filename, e) 184 raise msg184 raise IOError, msg # So IOErrors can be caught 185 185 186 186 line = fid.readline() -
anuga_core/source/anuga/fit_interpolate/fit.py
r4884 r5349 2 2 3 3 Implements a penalised least-squares fit. 4 putting point data onto the mesh. 4 5 5 6 The penalty term (or smoothing term) is controlled by the smoothing -
anuga_core/source/anuga/fit_interpolate/test_fit.py
r4859 r5349 1 1 #!/usr/bin/env python 2 3 """ 4 Note, fitting/blocking is also tested in 5 test_quantity.test_set_values_from_UTM_pts. 6 """ 2 7 3 8 #TEST -
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r5253 r5349 728 728 file pointer position 729 729 """ 730 731 730 from Scientific.IO.NetCDF import NetCDFFile 732 731 #print "Starting to block" 733 732 #FIXME - what to do if the file isn't there 734 733 … … 739 738 if self.max_read_lines is None: 740 739 self.max_read_lines = MAX_READ_LINES 741 742 740 if self.file_name[-4:] == ".pts": 743 741 … … 833 831 # Assume the file is a csv file 834 832 try: 833 #print "self.max_read_lines", self.max_read_lines 835 834 pointlist, att_dict, geo_ref, self.file_pointer = \ 836 835 _read_csv_file_blocking( self.file_pointer,
Note: See TracChangeset
for help on using the changeset viewer.