Changeset 7012


Ignore:
Timestamp:
May 11, 2009, 3:53:16 PM (11 years ago)
Author:
rwilson
Message:

Replaced usage of 'sets' module with set/frozenset builtin functions.

Location:
anuga_core/source/anuga
Files:
4 edited

Legend:

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

    r6320 r7012  
    11361136    """
    11371137    import sys
    1138     from sets import Set as set
    11391138
    11401139    all_quantity = ['stage', 'depth', 'momentum', 'xmomentum',
  • anuga_core/source/anuga/geospatial_data/test_geospatial_data.py

    r6546 r7012  
    66from math import sqrt, pi
    77import tempfile
    8 from sets import ImmutableSet
    98
    109import Numeric as num
     
    17401739        p1 = (lat_gong, lon_gong)
    17411740        p2 = (lat_2, lon_2)
    1742         points = ImmutableSet([p1, p2, p1])
     1741        points = frozenset([p1, p2, p1])
    17431742        gsd = Geospatial_data(data_points=list(points),
    17441743                              points_are_lats_longs=True)
     
    17631762        p1 = (lat_gong, lon_gong)
    17641763        p2 = (lat_2, lon_2)
    1765         points = ImmutableSet([p1, p2, p1])
     1764        points = frozenset([p1, p2, p1])
    17661765        gsd = Geospatial_data(data_points=list(points),
    17671766                              points_are_lats_longs=True)
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r7003 r7012  
    50105010    """
    50115011
    5012     from sets import ImmutableSet
    5013 
    50145012    msg = "grid_spacing can not be zero"
    50155013    assert not grid_spacing == 0, msg
     
    50235021    # Don't assume the zone of the segments is the same as the lower left
    50245022    # corner of the lat long data!!  They can easily be in different zones
    5025     lat_long_set = ImmutableSet()
     5023    lat_long_set = frozenset()
    50265024    for seg in segs:
    50275025        points_lat_long = points_needed(seg, ll_lat, ll_long, grid_spacing,
    50285026                                        lat_amount, long_amount, zone,
    50295027                                        isSouthHemisphere)
    5030         lat_long_set |= ImmutableSet(points_lat_long)
    5031 
    5032     if lat_long_set == ImmutableSet([]):
     5028        lat_long_set |= frozenset(points_lat_long)
     5029
     5030    if lat_long_set == frozenset([]):
    50335031        msg = "URS region specified and polygon does not overlap."
    50345032        raise ValueError, msg
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r6873 r7012  
    1414from Scientific.IO.NetCDF import NetCDFFile
    1515from struct import pack, unpack
    16 from sets import ImmutableSet
    1716import shutil
    1817
     
    95589557        # the poly as points though.
    95599558        #geo.export_points_file("results.txt", as_lat_long=True)
    9560         results = ImmutableSet(geo.get_data_points(as_lat_long=True))
     9559        results = frozenset(geo.get_data_points(as_lat_long=True))
    95619560        #print 'results',results
    95629561
     
    95729571                                     points_are_lats_longs=True)
    95739572        #geo_answer.export_points_file("answer.txt", as_lat_long=True) 
    9574         answer = ImmutableSet(points)
     9573        answer = frozenset(points)
    95759574       
    95769575        outs = answer.difference(results)
     
    96629661                                  verbose=self.verbose)
    96639662       
    9664         results = ImmutableSet(geo.get_data_points(as_lat_long=True,
    9665                                   isSouthHemisphere=False))
     9663        results = frozenset(geo.get_data_points(as_lat_long=True,
     9664                                                isSouthHemisphere=False))
    96669665        #print 'results',results
    96679666
     
    96739672                               degminsec2decimal_degrees(97,i*2,0)))
    96749673        #print "answer points", points
    9675         answer = ImmutableSet(points)
     9674        answer = frozenset(points)
    96769675       
    96779676        for point in points:
Note: See TracChangeset for help on using the changeset viewer.