Ignore:
Timestamp:
May 28, 2007, 1:14:38 PM (18 years ago)
Author:
nick
Message:

fixed split function to run quicker and use less memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/geospatial_data/test_geospatial_data.py

    r4484 r4501  
    44import unittest
    55import os
    6 from Numeric import zeros, array, allclose, concatenate
     6from Numeric import zeros, array, allclose, concatenate,sort
    77from math import sqrt, pi
    88import tempfile
     
    22322232                      14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}
    22332233        G = Geospatial_data(points, attributes)
    2234 #        print G.get_data_points()
    2235 #        print G.get_attributes()
    22362234
    22372235        factor = 0.21
     
    22402238        G1, G2  = G.split(factor)
    22412239       
    2242 #        print 'len(G): %s len(G1): %s len(G2): %s' %(len(G), len(G1), len(G2))
    2243 #        print 'G: ', len(G),'G1: ', len(G1), 'G2: ', len(G2)
    2244 
    22452240        assert allclose(len(G), len(G1)+len(G2))
    22462241        assert allclose(round(len(G)*factor), len(G1))
    22472242       
    2248 #        assert allclose(G == G1 + G2) must implentent __equal__
     2243#        assert allclose(G, G1+G2)# must implentent __equal__ or a sort
    22492244       
    22502245         
Note: See TracChangeset for help on using the changeset viewer.