Changeset 6166


Ignore:
Timestamp:
Jan 14, 2009, 4:07:10 PM (10 years ago)
Author:
rwilson
Message:

Changes: array(A).astype(X) -> array(A, X).

Location:
anuga_core/source/anuga
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py

    r6161 r6166  
    406406        K = 3*M       # Total number of unique vertices
    407407       
    408         T = num.reshape(num.arange(K).astype(num.Int), (M,3))
     408        T = num.reshape(num.arange(K, typecode=num.Int), (M,3))
    409409       
    410410        return T     
  • anuga_core/source/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py

    r6145 r6166  
    6969            raise Exception, msg
    7070
    71         self.conserved_quantities=num.array(conserved_quantities).astype(num.Float)
     71        self.conserved_quantities=num.array(conserved_quantities, num.Float)
    7272
    7373    def __repr__(self):
     
    9999
    100100        try:
    101             q = num.array(q).astype(num.Float)
     101            q = num.array(q, num.Float)
    102102        except:
    103103            msg = 'Return value from time boundary function could '
  • anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py

    r6145 r6166  
    394394            #Check that all keys in given boundary exist
    395395            for tag in tagged_elements.keys():
    396                 tagged_elements[tag] = num.array(tagged_elements[tag]).astype(num.Int)
     396                tagged_elements[tag] = num.array(tagged_elements[tag], num.Int)
    397397
    398398                msg = 'Not all elements exist. '
  • anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py

    r6145 r6166  
    4040            self.vertex_values = num.zeros((N, 3), num.Float)
    4141        else:
    42             self.vertex_values = num.array(vertex_values).astype(num.Float)
     42            self.vertex_values = num.array(vertex_values, num.Float)
    4343
    4444            N, V = self.vertex_values.shape
     
    611611        """
    612612
    613         values = num.array(values).astype(num.Float)
     613        values = num.array(values, num.Float)
    614614
    615615        if indices is not None:
    616             indices = num.array(indices).astype(num.Int)
     616            indices = num.array(indices, num.Int)
    617617            msg = 'Number of values must match number of indices:'
    618618            msg += ' You specified %d values and %d indices'\
  • anuga_core/source/anuga/alpha_shape/alpha_shape.py

    r6147 r6166  
    8989       
    9090        #Convert input to Numeric arrays
    91         self.points = num.array(points).astype(num.Float)
     91        self.points = num.array(points, num.Float)
    9292
    9393   
  • anuga_core/source/anuga/geospatial_data/geospatial_data.py

    r6162 r6166  
    11501150        raise StopIteration
    11511151
    1152     pointlist = num.array(points).astype(num.Float)
     1152    pointlist = num.array(points, num.Float)
    11531153    for key in att_dict.keys():
    1154         att_dict[key] = num.array(att_dict[key]).astype(num.Float)
     1154        att_dict[key] = num.array(att_dict[key], num.Float)
    11551155
    11561156    # Do stuff here so the info is in lat's and longs
     
    13611361# @return ??
    13621362def _point_atts2array(point_atts):
    1363     point_atts['pointlist'] = num.array(point_atts['pointlist']).astype(num.Float)
     1363    point_atts['pointlist'] = num.array(point_atts['pointlist'], num.Float)
    13641364
    13651365    for key in point_atts['attributelist'].keys():
    13661366        point_atts['attributelist'][key] = \
    1367                 num.array(point_atts['attributelist'][key]).astype(num.Float)
     1367                num.array(point_atts['attributelist'][key], num.Float)
    13681368
    13691369    return point_atts
  • anuga_core/source/anuga/load_mesh/loadASCII.py

    r6162 r6166  
    653653
    654654    #the triangulation
    655     mesh['vertices'] = num.array(mesh['vertices']).astype(num.Float)
     655    mesh['vertices'] = num.array(mesh['vertices'], num.Float)
    656656    if mesh['vertex_attributes'] != None:
    657657        mesh['vertex_attributes'] = \
    658             num.array(mesh['vertex_attributes']).astype(num.Float)
     658            num.array(mesh['vertex_attributes'], num.Float)
    659659    mesh['vertex_attribute_titles'] = \
    660         num.array(mesh['vertex_attribute_titles']).astype(num.Character)
    661     mesh['segments'] = num.array(mesh['segments']).astype(IntType)
    662     mesh['segment_tags'] = num.array(mesh['segment_tags']).astype(num.Character)
    663     mesh['triangles'] = num.array(mesh['triangles']).astype(IntType)
     660        num.array(mesh['vertex_attribute_titles'], num.Character)
     661    mesh['segments'] = num.array(mesh['segments'], IntType)
     662    mesh['segment_tags'] = num.array(mesh['segment_tags'], num.Character)
     663    mesh['triangles'] = num.array(mesh['triangles'], IntType)
    664664    mesh['triangle_tags'] = num.array(mesh['triangle_tags']) #.astype(Character)
    665665    mesh['triangle_neighbors'] = \
    666         num.array(mesh['triangle_neighbors']).astype(IntType)
     666        num.array(mesh['triangle_neighbors'], IntType)
    667667
    668668    #the outline
    669     mesh['points'] = num.array(mesh['points']).astype(num.Float)
    670     mesh['point_attributes'] = num.array(mesh['point_attributes']).astype(num.Float)
    671     mesh['outline_segments'] = num.array(mesh['outline_segments']).astype(IntType)
     669    mesh['points'] = num.array(mesh['points'], num.Float)
     670    mesh['point_attributes'] = num.array(mesh['point_attributes'], num.Float)
     671    mesh['outline_segments'] = num.array(mesh['outline_segments'], IntType)
    672672    mesh['outline_segment_tags'] = \
    673         num.array(mesh['outline_segment_tags']).astype(num.Character)
    674     mesh['holes'] = num.array(mesh['holes']).astype(num.Float)
    675     mesh['regions'] = num.array(mesh['regions']).astype(num.Float)
    676     mesh['region_tags'] = num.array(mesh['region_tags']).astype(num.Character)
    677     mesh['region_max_areas'] = num.array(mesh['region_max_areas']).astype(num.Float)
     673        num.array(mesh['outline_segment_tags'], num.Character)
     674    mesh['holes'] = num.array(mesh['holes'], num.Float)
     675    mesh['regions'] = num.array(mesh['regions'], num.Float)
     676    mesh['region_tags'] = num.array(mesh['region_tags'], num.Character)
     677    mesh['region_max_areas'] = num.array(mesh['region_max_areas'], num.Float)
    678678
    679679    #mesh = mesh_dict2array(mesh)
     
    10181018#                                  [max_x, max_y], [min_x, max_y]]
    10191019def extent(points):
    1020     points = num.array(points).astype(num.Float)
     1020    points = num.array(points, num.Float)
    10211021
    10221022    max_x = min_x = points[0][0]
     
    10951095def point_atts2array(point_atts):
    10961096    # convert attribute list to array of floats
    1097     point_atts['pointlist'] = num.array(point_atts['pointlist']).astype(num.Float)
     1097    point_atts['pointlist'] = num.array(point_atts['pointlist'], num.Float)
    10981098
    10991099    for key in point_atts['attributelist'].keys():
    11001100        point_atts['attributelist'][key] = \
    1101             num.array(point_atts['attributelist'][key]).astype(num.Float)
     1101            num.array(point_atts['attributelist'][key], num.Float)
    11021102
    11031103    return point_atts
     
    11271127    """
    11281128
    1129     point_attributes = num.array([]).astype(num.Float)
     1129    point_attributes = num.array([], num.Float)
    11301130    keys = dic.keys()
    11311131    key = keys.pop(0)
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r6157 r6166  
    15081508
    15091509        try:
    1510             q = num.array(q).astype(num.Float)
     1510            q = num.array(q, num.Float)
    15111511        except:
    15121512            msg = 'Return value from vector function %s could ' %f
  • anuga_core/source/anuga/utilities/polygon.py

    r6158 r6166  
    708708
    709709    def __call__(self, x, y):
    710         x = num.array(x).astype(num.Float)
    711         y = num.array(y).astype(num.Float)
     710        x = num.array(x, num.Float)
     711        y = num.array(y, num.Float)
    712712
    713713        N = len(x)
Note: See TracChangeset for help on using the changeset viewer.