Changeset 7009


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

Replaced 'sets' module with 'frozenset' builtin class.

Location:
branches/numpy/anuga
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/abstract_2d_finite_volumes/util.py

    r6689 r7009  
    11361136    """
    11371137    import sys
    1138     from sets import Set as set
    11391138
    11401139    all_quantity = ['stage', 'depth', 'momentum', 'xmomentum',
  • branches/numpy/anuga/geospatial_data/test_geospatial_data.py

    r6768 r7009  
    55import tempfile
    66from math import sqrt, pi
    7 from sets import ImmutableSet
    87
    98import numpy as num
     
    15991598        p1 = (lat_gong, lon_gong)
    16001599        p2 = (lat_2, lon_2)
    1601         points = ImmutableSet([p1, p2, p1])
     1600        points = frozenset([p1, p2, p1])
    16021601        gsd = Geospatial_data(data_points=list(points),
    16031602                              points_are_lats_longs=True)
     
    16211620        p1 = (lat_gong, lon_gong)
    16221621        p2 = (lat_2, lon_2)
    1623         points = ImmutableSet([p1, p2, p1])
     1622        points = frozenset([p1, p2, p1])
    16241623        gsd = Geospatial_data(data_points=list(points),
    16251624                              points_are_lats_longs=True)
  • branches/numpy/anuga/shallow_water/data_manager.py

    r6902 r7009  
    50035003    """
    50045004
    5005     from sets import ImmutableSet
    5006 
    50075005    msg = "grid_spacing can not be zero"
    50085006    assert not grid_spacing == 0, msg
     
    50165014    # Don't assume the zone of the segments is the same as the lower left
    50175015    # corner of the lat long data!!  They can easily be in different zones
    5018     lat_long_set = ImmutableSet()
     5016    lat_long_set = frozenset()
    50195017    for seg in segs:
    50205018        points_lat_long = points_needed(seg, ll_lat, ll_long, grid_spacing,
    50215019                                        lat_amount, long_amount, zone,
    50225020                                        isSouthHemisphere)
    5023         lat_long_set |= ImmutableSet(points_lat_long)
    5024 
    5025     if lat_long_set == ImmutableSet([]):
     5021        lat_long_set |= frozenset(points_lat_long)
     5022
     5023    if lat_long_set == frozenset([]):
    50265024        msg = "URS region specified and polygon does not overlap."
    50275025        raise ValueError, msg
  • branches/numpy/anuga/shallow_water/test_data_manager.py

    r6902 r7009  
    1414from Scientific.IO.NetCDF import NetCDFFile
    1515from struct import pack, unpack
    16 from sets import ImmutableSet
    1716import shutil
    1817
     
    95529551        # the poly as points though.
    95539552        #geo.export_points_file("results.txt", as_lat_long=True)
    9554         results = ImmutableSet(geo.get_data_points(as_lat_long=True))
     9553        results = frozenset(geo.get_data_points(as_lat_long=True))
    95559554        #print 'results',results
    95569555
     
    95669565                                     points_are_lats_longs=True)
    95679566        #geo_answer.export_points_file("answer.txt", as_lat_long=True) 
    9568         answer = ImmutableSet(points)
     9567        answer = frozenset(points)
    95699568       
    95709569        outs = answer.difference(results)
     
    96569655                                  verbose=self.verbose)
    96579656       
    9658         results = ImmutableSet(geo.get_data_points(as_lat_long=True,
    9659                                   isSouthHemisphere=False))
     9657        results = frozenset(geo.get_data_points(as_lat_long=True,
     9658                                                isSouthHemisphere=False))
    96609659        #print 'results',results
    96619660
     
    96679666                               degminsec2decimal_degrees(97,i*2,0)))
    96689667        #print "answer points", points
    9669         answer = ImmutableSet(points)
     9668        answer = frozenset(points)
    96709669       
    96719670        for point in points:
Note: See TracChangeset for help on using the changeset viewer.