Changeset 5520
- Timestamp:
- Jul 17, 2008, 10:25:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r5518 r5520 259 259 260 260 261 # New leaner interface to setting values 261 #--------------------------------------------- 262 # Public interface for setting quantity values 263 #--------------------------------------------- 262 264 def set_values(self, 263 265 numeric=None, # List, numeric array or constant … … 265 267 function=None, # Callable object: f(x,y) 266 268 geospatial_data=None, # Arbitrary dataset 267 points=None, values=None, data_georef=None, # Obsoleted by use of geo_spatial object 268 filename=None, attribute_name=None, #Input from file 269 filename=None, attribute_name=None, # Input from file 269 270 alpha=None, 270 271 location='vertices', … … 298 299 fit_interpolate.fit fitting 299 300 300 points:301 Nx2 array of data points for use with fit_interpolate.fit302 If points are present, an N array of attribute303 values corresponding to304 each data point must be present.305 (Obsoleted by geospatial_data)306 307 values:308 If points is specified, values is an array of length N containing309 attribute values for each point.310 (Obsoleted by geospatial_data)311 312 data_georef:313 If points is specified, geo_reference applies to each point.314 (Obsoleted by geospatial_data)315 316 301 filename: 317 302 Name of a points file containing data points and attributes for … … 375 360 376 361 Exactly one of the arguments 377 numeric, quantity, function, points,filename362 numeric, quantity, function, filename 378 363 must be present. 379 364 """ … … 431 416 432 417 # General input checks 433 L = [numeric, quantity, function, geospatial_data, points,filename]418 L = [numeric, quantity, function, geospatial_data, filename] 434 419 msg = 'Exactly one of the arguments '+\ 435 'numeric, quantity, function, geospatial_data, points,'+\420 'numeric, quantity, function, geospatial_data, '+\ 436 421 'or filename must be present.' 437 422 assert L.count(None) == len(L)-1, msg … … 446 431 msg = 'Indices must be a list or None' 447 432 assert type(indices) in [ListType, NoneType, ArrayType], msg 448 449 450 if not(points is None and values is None and data_georef is None):451 from warnings import warn452 453 msg = 'Using points, values or data_georef with set_quantity '454 msg += 'is obsolete. Please use a Geospatial_data object instead.'455 #warn(msg, DeprecationWarning)456 raise Exception, msg457 433 458 434 … … 497 473 verbose=verbose, 498 474 use_cache=use_cache) 499 elif points is not None:500 msg = 'The usage of points in set_values has been deprecated.' +\501 'Please use the geospatial_data object instead.'502 raise Exception, msg503 504 505 475 506 476 elif filename is not None: … … 530 500 531 501 532 # Specific functions for setting values 502 #------------------------------------------------------------- 503 # Specific internal functions for setting values based on type 504 #------------------------------------------------------------- 505 533 506 def set_values_from_constant(self, X, 534 507 location, indices, verbose): … … 776 749 self.vertex_values[:,j] = values[j::3] 777 750 else: 778 # Brute force751 # Brute force 779 752 for i in indices: 780 753 for j in range(3): … … 902 875 location, indices, verbose) 903 876 904 877 878 879 #----------------------------------------------------- 905 880 def get_extremum_index(self, mode=None, indices=None): 906 881 """Return index for maximum or minimum value of quantity (on centroids)
Note: See TracChangeset
for help on using the changeset viewer.