Ignore:
Timestamp:
Jan 31, 2006, 5:41:13 PM (19 years ago)
Author:
ole
Message:

Deployed geo_spatial stuff

Location:
inundation/geospatial_data
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/geospatial_data/geospatial_data.py

    r2306 r2309  
    4242        self.set_attributes(attributes)
    4343        self.set_geo_reference(geo_reference)
    44         self.default_attribute_name = default_attribute_name
     44        self.set_default_attribute_name(default_attribute_name)
     45       
     46
    4547
    4648
     
    8587
    8688
     89    def set_default_attribute_name(self, default_attribute_name):
     90        self.default_attribute_name = default_attribute_name
    8791
     92
     93    def get_geo_reference(self):
     94        return self.geo_reference
     95       
    8896    def get_data_points(self):
    8997        return self.data_points
    9098
    91     def get_attribute_values(self, attribute_name = None):
     99    def get_attributes(self, attribute_name = None):
    92100        """Return values for one named attribute.
    93101
  • inundation/geospatial_data/test_geospatial_data.py

    r2306 r2309  
    5656
    5757
    58     def test_get_attribute_values_1(self):
     58    def test_get_attributes_1(self):
    5959        from coordinate_transforms.geo_reference import Geo_reference
    6060        points = [[1.0, 2.1], [3.0, 5.3]]
     
    6767        assert allclose(P, [[1.0, 2.1], [3.0, 5.3]])       
    6868       
    69         V = G.get_attribute_values() #Simply get them
     69        V = G.get_attributes() #Simply get them
    7070        assert allclose(V, [2, 4])
    7171
    72         V = G.get_attribute_values('attribute') #Get by name
     72        V = G.get_attributes('attribute') #Get by name
    7373        assert allclose(V, [2, 4])
    7474
    7575
    76     def test_get_attribute_values_2(self):
     76    def test_get_attributes_2(self):
    7777        """Multiple attributes
    7878        """
     
    8989        assert allclose(P, [[1.0, 2.1], [3.0, 5.3]])       
    9090       
    91         V = G.get_attribute_values() #Get default attribute
     91        V = G.get_attributes() #Get default attribute
    9292        assert allclose(V, [2, 4])
    9393
    94         V = G.get_attribute_values('a0') #Get by name
     94        V = G.get_attributes('a0') #Get by name
    9595        assert allclose(V, [0, 0])
    9696
    97         V = G.get_attribute_values('a1') #Get by name
     97        V = G.get_attributes('a1') #Get by name
    9898        assert allclose(V, [2, 4])
    9999
    100         V = G.get_attribute_values('a2') #Get by name
     100        V = G.get_attributes('a2') #Get by name
    101101        assert allclose(V, [79.4, -7])
    102102
    103103        try:
    104             V = G.get_attribute_values('hdnoatedu') #Invalid
     104            V = G.get_attributes('hdnoatedu') #Invalid
    105105        except AssertionError:
    106106            pass
     
    166166        #assert allclose(V, [2, 4])
    167167
    168         V = G.get_attribute_values('a0') #Get by name
     168        V = G.get_attributes('a0') #Get by name
    169169        assert allclose(V, [0, 0])
    170170
    171         V = G.get_attribute_values('a1') #Get by name
     171        V = G.get_attributes('a1') #Get by name
    172172        assert allclose(V, [2, 4])
    173173
    174         V = G.get_attribute_values('a2') #Get by name
     174        V = G.get_attributes('a2') #Get by name
    175175        assert allclose(V, [79.4, -7])
    176176
Note: See TracChangeset for help on using the changeset viewer.