Ignore:
Timestamp:
Mar 4, 2009, 8:37:22 AM (14 years ago)
Author:
rwilson
Message:

Added tests for get_relative().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/coordinate_transforms/geo_reference.py

    r6441 r6442  
    318318                msg = 'Single point must have two elements'
    319319                raise ShapeError, msg
    320                 #points = reshape(points, (1,2))
    321320
    322321        if not points.shape[1] == 2:
     
    348347        """
    349348
    350         is_list = False
    351         if type(points) == types.ListType:
    352             is_list = True
    353 
    354         points = ensure_numeric(points, num.float)
     349        # remember if we got a list
     350        is_list = isinstance(points, list)
     351
     352        # convert to a numeric array, force a copy
     353        points = ensure_numeric(copy.copy(points), num.float)
     354
     355        # sanity checks
    355356        if len(points.shape) == 1:
    356357            #One point has been passed
     
    358359                msg = 'Single point must have two elements'
    359360                raise ShapeError, msg
    360                 #points = reshape(points, (1,2))
    361361
    362362        if not points.shape[1] == 2:
Note: See TracChangeset for help on using the changeset viewer.