tests package

Submodules

tests.NumpyTestCase module

Title: NumpyTestCase.py Author: Nariman Habili, nariman.habili@ga.gov.au CreationDate: 2006-12-12 Description: Equality tests for numpy arrays.

Version: $Rev: 563 $

$Id: NumpyTestCase.py 563 2007-10-24 02:52:40Z carthur $

class NumpyTestCase(methodName='runTest')

Bases: unittest.case.TestCase

ExtendsTestCase with equality tests for numpy arrays.

numpyAssertAlmostEqual(a1, a2, prec=1e-05)

Test for approximately equality of array fields a1 and a2.

numpyAssertAlmostEqualElements(a, prec=1e-05)

Test for equality of all elements of array a.

numpyAssertEqual(a1, a2)

Test for equality of array fields a1 and a2.

numpyAssertEqualElements(a)

Test for equality of all elements of array a.

tests.pathLocate module

getRootDirectory()
getUnitTestDirectory()
is_frozen()

tests.run module

tests.test_GetType module

tests.test_Intersections module

Version: $Rev: 733 $

$Id: test_Intersections.py 733 2012-11-14 02:52:01Z carthur $

class IntersectionsTest(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Set up the test environment

test_CircleLine()

Test Crossings.CircleLine()

test_inLand()

Test inLand() returns correct value for points in/outside vertices

test_isLeft()

Test _isLeft() returns +ve value for a point to the left of the line

test_isOnLine()

Test _isLeft() returns zero for a point lying on the line

test_isRight()

Test _isLeft() returns -ve value for a point to the right of the line

tests.test_KDEOrigin module

Title: KDEOriginTestCase.py Author: Nariman Habili, nariman.habili@ga.gov.au CreationDate: 2006-12-13 Description: Unit testing module for KDEOrigin.py

Version: $Rev: 563 $

$Id: TestKDEOrigin.py 563 2007-10-24 02:52:40Z carthur $

class TestKDEOrigin(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_GenerateKDE()

Testing GenerateKDE for 2D data

tests.test_KDEParameters module

Title: TestKDEParameters.py Author: Nariman Habili, nariman.habili@ga.gov.au CreationDate: 2007-05-07 Description: Unit testing module for TestKDEParameters.py

Version: $Rev: 480 $

$Id: TestKDEParameters.py 480 2007-05-01 05:03:15Z nhabili $

class TestKDEParameters(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_GenerateKDE()

Testing GenerateKDE for 1-D data

tests.test_SamplingOrigin module

Title: TestSamplingOrigin.py Author: Nariman Habili, nariman.habili@ga.gov.au CreationDate: 2006-12-14 Description: Unit testing module for SamplingOrigin.py

Version: $Rev$

$Id$

class TestSamplingOrigin(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_GenerateOneSample()

Testing GenerateOneSample

test_GenerateSamples()

Testing GenerateSamples

tests.test_SamplingParameters module

Title: TestSamplingParameters.py Author: Nariman Habili, nariman.habili@ga.gov.au CreationDate: 2007-05-03 Description: Unit testing module for SamplingParameters.py

Version: $Rev$

$Id$

class TestSamplingParameters(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_GenerateOneSample()

Testing GenerateOneSample

test_GenerateSamples()

Testing GenerateSamples

tests.test_TrackGenerator module

class TestTrackGenerator(methodName='runTest')

Bases: unittest.case.TestCase

testGeneratePath()

tests.test_evd module

Testing the extreme value distributions

class TestEmpiricalFit(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testEmpFit()

Test calculating empirical return levels

class TestEvd(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testEVD()

Testing extreme value distribution

tests.test_files module

class TestConfigFile(methodName='runTest')

Bases: unittest.case.TestCase

testConfigFile()

Test flConfigFile returns correct filename

class TestFileLoading(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testLoadBrokenFile()

Test flLoadFile on a file with differing length columns

testLoadFile()

Test flLoadFile loads data correctly

testLoadNonFile()

Trying to load a non-file should raise an IOError

class TestFileSize(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testSize()

Test flSize returns correct file size value

testSizeError()

Test flSize raises IOError for non-file

class TestModDate(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testModDate()

Test flModDate function

class TestModuleUtilities(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testModuleName()

Test flModuleName returns correct module name

testModulePath()

Test flModulePath returns correct path, base & extension

tests.test_generateStats module

Title: testWindProfile.py

Author: Nicholas Summons, nicholas.summons@ga.gov.au CreationDate: 2011-06-10 Description: Unit test for the windProfile class

class TestGenerateStats(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

angular = False
configFile = None
gridInc = {'x': 1.0, 'y': 0.5}
gridLimit = {'xMax': 186.0, 'xMin': 150.0, 'yMax': -5.0, 'yMin': -31.0}
gridSpace = {'x': 1.0, 'y': 1.0}
lonLat = array([[ 85. , 6.5, 0. ], [ 85. , 6.5, 0. ], [ 85. , 6.5, 0. ], ..., [ 62.7, -35. , 0. ], [ 66.5, -36.7, 0. ], [ 70.4, -37.6, 0. ]])
minSample = 100
missingValue = 2147483648
parameter = array([2.14748365e+09, 0.00000000e+00, 0.00000000e+00, ..., 6.57500000e+01, 6.46200000e+01, 5.96100000e+01])
pkl_file = <_io.BufferedReader name='C:\\WorkSpace\\tcrm\\tests\\test_data\\generateStatsTestData.pkl'>
test_generateStats()

Testing generateStats (warning: will take about 2 mins to run)

tests.test_grid module

Title: testGrid.py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 07/15/08 1:46:PM Description: Unit test for grid.py

Version :$Rev: 810 $

$Id: test_grid.py 810 2012-02-21 07:52:50Z nsummons $

class TestGrid(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

TestReadGrid:

Description:

setUp()

Hook method for setting up the test fixture before exercising it.

test_SampleGrid()

Test SampleGrid class using an ascii file as input

test_SampleGridNetCDF()

Test SampleGrid class using a netCDF file as input

test_grdRead()

Test grid data is read correctly from ascii file

test_grdReadNetCDF()

Test grid data is read correctly from netCDF file

tests.test_gridNC module

class TestSampleGrid(methodName='runTest')

Bases: unittest.case.TestCase

Test that the range of methods to load gridded data produce expected results. Uses the 0.083 degree land-sea mask dataset as a test dataset.

setUp()

Hook method for setting up the test fixture before exercising it.

test_gridNctools()

Test grid.grdRead produces same result as nctools.ncGetData

test_sampleGridArray()

Test grid.SampleGrid.grid produces flipped result of nctools.ncGetData

test_sampleGridPoints()

Test grid.SampleGrid returns correct values for known points

tests.test_interp3d module

Title: test_interp3d.py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 2013-01-17 Description: Unit test suite for interp3d.py

Version: $Rev$

Id: $Id$

class TestInterp3d(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

TestInterp3d: Description: Parameters: Members: Methods: Internal methods:

setUp()

Hook method for setting up the test fixture before exercising it.

test_interp3d()

Test interp3d returns expected values

test_interp3d_2dinput()

Test interp3d raises ValueError if input_array is 2D

tests.test_lmomentFit module

Title: test_lmomentFit.py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 2012-11-21 Description: Unit testing module for lmomentFit.py

Version: $Rev: 737 $

ModifiedBy: ModifiedDate: Modification:

$Id: test_lmomentFit.py 737 2012-11-21 00:59:42Z carthur $

class Testlmoments(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_pelgev()

Test pelgev returns correct GEV parameters

test_samlmu3()

Test samlmu3 returns same values as samlmu

test_samlmu_list()

Test samlmu works with list input

test_samlmu_mom()

Test samlmu returns correct values for moments

tests.test_loadData module

class TestAgeParsing(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

class TestDateConversion(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_badData()

Test date2ymdh raises ValueError for dodgy input date

test_date2ymdh()

Test date2ymdh function

test_date2ymdhBadFormat()

Test date2ymdh raises ValueError for poorly formatted year data

test_date2ymdhFormats()

Test date2ymdh with different input date formats

class TestDateParsing(methodName='runTest')

Bases: unittest.case.TestCase

Test performance of ParseDates()

setUp()
test_ParseDatesNoMinsInput()

Test parseDates with year, month, day, hour (no minutes) input

test_dateInput()

Test parseDates returns correct values when passed date info

test_parseDatesYMDHInput()

Test parseDates with year, month, day, hourminute (HHMM) input

test_parseDatesYMDHMInput()

Test parseDates with year, month, day, hour, minute input

class TestGetPoci(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_getPociArrayInput()

Test getPoci with array input

test_getPociArrayInvalidInput()

getPoci filters values where penv < pcentre

test_getPociArrayMissingValues()

getPoci filters values where input data is missing

test_getPociDefaults()

Test getPoci returns correct value based on defaults

test_getPociIncompleteCoeffs()

Test getPoci falls back to default coeffs if input incomplete

test_getPociWithCoeffs()

getPoci with user-defined set of coefficients

test_getPociWrongLengths()

getPoci raises exception when inputs are different lengths

class TestInitialPositions(methodName='runTest')

Bases: unittest.case.TestCase

Test performance of getInitialPositions()

setUp()

Hook method for setting up the test fixture before exercising it.

test_getInitPos_failure()

Ensure getInitialPositions fails if insufficient data provided

test_getInitPos_fromSeason()

Test to ensure the function returns correct values based on season

test_getInitPos_fromSerialNo()

Test to ensure the function returns correct values based on serial number

test_getInitPos_fromTCNum()

Test to ensure the function returns correct values based on TC number

class TestJulianDays(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_julianDays()

Test julianDays function

test_julianDaysBadInput()

Test julianDays raises ValueError on bad input

class TestTime(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_getTime()

Test getTime function

test_getTimeBadInput()

Test getTime raises ValueError on bad input

class TestTimeDeltas(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_getTimeDelta()

Test getTimeDelta function

test_getTimeDeltaBadInput()

Test getTimeDelta raises ValueError on bad input

tests.test_maputils module

Title: testMapUtils.py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 2006-11-03 Description: Test output from utils/map.py The functions included in this test were derived from MATLAB code. The MATLAB code is used to generate the results against which output from the Python functions are compared.

SeeAlso: (related programs) Constraints:

class TestMapUtils(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

AZI = array([135.0044, 135.0175, 135.0393, 135.0699, 135.1092, 135.1574, 135.2143, 135.2802, 135.3549, 135.4385, 135.5312, 135.6329, 135.7437, 135.8637, 135.993 , 136.1315, 136.2795, 136.437 , 136.6041, 136.7808])
Dist = array([157.1427, 157.1068, 157.047 , 156.9633, 156.8559, 156.7248, 156.57 , 156.3918, 156.1902, 155.9654, 155.7176, 155.447 , 155.1538, 154.8382, 154.5004, 154.1407, 153.7595, 153.357 , 152.9336, 152.4895])
X = array([ 3, 5, 9, 11, 65])
XN = array([-111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251, -111.1251])
Y = array([ 4, 12, 40, 60, 72])
YE = array([111.1082, 111.0574, 110.9728, 110.8544, 110.7022, 110.5164, 110.2968, 110.0437, 109.757 , 109.4369, 109.0834, 108.6968, 108.277 , 107.8242, 107.3386, 106.8203, 106.2695, 105.6863, 105.0709, 104.4234])
Z = array([ 5, 13, 41, 61, 97])
findpts = [131.5, 135, 140.0, 140.9]
indices = [1, 5, 10, 11]
lat = array([ 0., -1., -2., -3., -4., -5., -6., -7., -8., -9., -10., -11., -12., -13., -14., -15., -16., -17., -18., -19., -20.])
lon = array([130., 131., 132., 133., 134., 135., 136., 137., 138., 139., 140., 141., 142., 143., 144., 145., 146., 147., 148., 149., 150.])
nearvals = [131.0, 135.0, 140.0, 141.0]
test_Bearing()

Test conversion from bearing to theta and back again

test_GridLatLonBear()

Test gridLatLon function

test_GridLatLonDist()

Test gridLatLonDist function

test_ValuesXY2r()

Test xy2R function

test_ValueslatLon2Azi()

Test latLon2Azi function

test_ValueslatLon2XY()

Test latLon2XY function

test_findindex()

Test find_index function

test_findindex_Err()

Test that find_index raises ValueError if second arg is an array

test_findnearest()

Test find_nearest function

test_findnearest_Err()

Test that find_nearest raises ValueError if second arg is an array

theta = array([-6.28318531, -5.49778714, -4.71238898, -3.92699082, -3.14159265, -2.35619449, -1.57079633, -0.78539816, 0. , 0.78539816, 1.57079633, 2.35619449, 3.14159265, 3.92699082, 4.71238898, 5.49778714])

tests.test_metutils module

Title: testMetUtils.py

Author: Craig Arthur Email: craig.arthur@ga.gov.au CreationDate: 2006-11-14 Description: Unit test for utils/met.py

TODO: Update to test all functions in metutils

class TestConvert(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

f = array([ 0.00000000e+00, -2.53834962e-06, -5.07592604e-06, -7.61195628e-06, -1.01456678e-05, -1.26762889e-05, -1.52030487e-05, -1.77251775e-05, -2.02419070e-05, -2.27524707e-05, -2.52561037e-05, -2.77520434e-05, -3.02395297e-05, -3.27178046e-05, -3.51861134e-05, -3.76437042e-05, -4.00898283e-05, -4.25237407e-05, -4.49447000e-05, -4.73519686e-05, -4.97448134e-05])
lat = array([ 0., -1., -2., -3., -4., -5., -6., -7., -8., -9., -10., -11., -12., -13., -14., -15., -16., -17., -18., -19., -20.])
test_celcius2F()

Convert temperatures in Celcius to Farenheit

test_deg2km()

Convert distance in degrees to distance in km

test_farenheit2C()

Convert temperatures in Farenheit to Celcius

test_hPa2Pa()

Convert pressure from hPa to Pa

test_kgmetre2hPa()

Convert from Pa to hPa

test_km2deg()

Convert distance in km to distance in degrees

test_km2m()

Convert distance in km to distance in m

test_m2km()

Convert distance in m to distance in km

test_m2nm()
test_mps2kmphr()

Convert from m/s to km/h

class TestCoriolis(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

f = array([ 0.0000000e+00, -2.5383497e-06, -5.0759259e-06, -7.6119563e-06, -1.0145668e-05, -1.2676289e-05, -1.5203049e-05, -1.7725177e-05, -2.0241907e-05, -2.2752471e-05, -2.5256104e-05, -2.7752043e-05, -3.0239529e-05, -3.2717806e-05, -3.5186113e-05, -3.7643706e-05, -4.0089828e-05, -4.2523741e-05, -4.4944700e-05, -4.7351969e-05, -4.9744813e-05], dtype=float32)
lat = array([ 0., -1., -2., -3., -4., -5., -6., -7., -8., -9., -10., -11., -12., -13., -14., -15., -16., -17., -18., -19., -20.], dtype=float32)
test_coriolisArray()

Test Coriolis with an array of latitudes

test_coriolisScalar()

Test Coriolis with a scalar value for latitude

class TestWetBulb(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

TODO: Test other wet bulb calculations

setUp()

Hook method for setting up the test fixture before exercising it.

test_dp2wb()

Test dewPointToWetBulb conversion

test_dp2wb_input_error()

Test ValueError is raised when inputs are non-sensical

tests.test_nctools module

Title: testNetCDF.py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 07/15/08 1:46:PM Description: Unit test for nctools.py

Version :$Rev: 276 $

$Id: testNetCDF.py 276 2010-04-16 02:24:00Z nsummons $

class TestNCReading(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_ncGetTimeValues()

Test ncGetTimes returns correct time values

test_ncGetTimes()

Test ncGetTimes returns datetime objects

test_ncReadFile()

Test nctools functions for reading dimensions and variables

class TestNetCDF(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

TestNetCDF: test the suite of netCDF tools

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_ncCreateFile()

Test nctools creates a file successfully

test_ncSaveGridExceptions()

Test ncSaveGrid raises correct exceptions

test_ncSaveGridNullValue()

Test ncSaveGrid can save a variable with no values

test_ncSaveGridOpenFile()

Test ncSaveGrid returns netCDF4.Dataset if keepfileopen=True

tests.test_pressureProfile module

Title: TestPressureProfile.py Author: Nicholas Summons, nicholas.summons@ga.gov.au CreationDate: 2011-06-09 Description: Unit testing module for pressureProfile

Version: $Rev$

$Id$

class TestPressureProfile(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

R = array([[304.62324266, 301.10295765, 297.63126618, ..., 296.25657933, 299.70835472, 303.20940525], [300.6183382 , 297.0493591 , 293.52850816, ..., 292.13403433, 295.63514651, 299.18508092], [296.66339877, 293.04500524, 289.47421884, ..., 288.05963173, 291.61087934, 295.21044004], ..., [298.4601161 , 294.7746667 , 291.13714383, ..., 289.69595938, 293.31380597, 296.98029885], [302.43808067, 298.80061379, 295.21162999, ..., 293.79001062, 297.35910345, 300.97738794], [306.46511383, 302.8749448 , 299.33376059, ..., 297.93139478, 301.45249571, 305.02327823]])
beta = 1.5
beta1 = 1.5
beta2 = 1.4
cLat = -20.13
cLon = 158.17
pCentre = 95330.0
pEnv = 101445.0
pkl_file = <_io.BufferedReader name='C:\\WorkSpace\\tcrm\\tests\\test_data\\pressureProfileTestData.pkl'>
prP = <PressureInterface.pressureProfile.PrsProfile object>
rMax = 96.0
rMax2 = 250.0
test_Holland()

Testing Holland profile

test_Powell()

Testing Powell profile

test_Willoughby()

Testing Willoughby profile

test_doubleHolland()

Testing Double Holland profile

test_pHolland = array([[100453.46378844, 100437.54648144, 100421.43717491, ..., 100414.94212627, 100431.12521022, 100447.12055605], [100435.32264082, 100418.69597113, 100401.85228733, ..., 100395.05643538, 100411.98396415, 100428.69864838], [100416.87121971, 100399.50410103, 100381.89265051, ..., 100374.78196819, 100392.4882855 , 100409.95430151], ..., [100425.32112909, 100407.86499594, 100390.15390677, ..., 100383.00030554, 100400.8106223 , 100418.36985404], [100443.63205329, 100426.9097374 , 100409.95999732, ..., 100403.11873014, 100420.15657692, 100436.9710286 ], [100461.62937904, 100445.61031267, 100429.38907719, ..., 100422.84634195, 100439.14550747, 100455.24664314]])
test_pPowell = array([[99987.86592379, 99971.18017265, 99954.37409356, ..., 99947.62077275, 99964.47149707, 99981.20682418], [99968.85533795, 99951.52231197, 99934.04939303, ..., 99927.02385647, 99944.54924981, 99961.93967317], [99949.62522818, 99931.62028324, 99913.45412737, ..., 99906.14530722, 99924.37249058, 99942.4433457 ], ..., [99958.41867974, 99940.27686176, 99921.96416702, ..., 99914.59397532, 99932.97162623, 99951.18319295], [99977.55006291, 99960.07433093, 99942.44925371, ..., 99935.36016623, 99953.04155037, 99970.5784374 ], [99996.45711764, 99979.62326474, 99962.65986598, ..., 99955.84100355, 99972.85277605, 99989.73987318]])
test_pWilloughby = array([[99029.52760876, 99016.62850645, 99003.71485085, ..., 98998.54749376, 99011.46425555, 99024.37031452], [99014.83746316, 99001.53127164, 98988.20057626, ..., 98982.86363912, 98996.20139405, 99009.51853212], [99000.07992283, 98986.35382056, 98972.59237178, ..., 98967.08011094, 98980.85294 , 98994.59433098], ..., [99006.81556384, 98992.94228661, 98979.02816587, ..., 98973.45329138, 98987.38099863, 99001.27175939], [99021.54357728, 99008.08613589, 98994.59883784, ..., 98989.19775978, 99002.69426014, 99016.16478766], [99036.19989395, 99023.14573467, 99010.07182487, ..., 99004.83891423, 99017.91800523, 99030.98120087]])
test_pdoubleHolland = array([[100156.96599828, 100138.48908957, 100119.83870143, ..., 100112.33306022, 100131.04900086, 100149.59688703], [100135.91151598, 100116.67000928, 100097.23066034, ..., 100089.40260049, 100108.91726438, 100128.2394823 ], [100114.56147734, 100094.52483831, 100074.26381938, ..., 100066.09962546, 100086.44662025, 100106.5745619 ], ..., [100124.33079288, 100104.16382656, 100083.76077778, ..., 100075.53642247, 100096.03021948, 100116.29312913], [100145.54750244, 100126.16896565, 100106.5811351 , ..., 100098.69041406, 100118.35821827, 100137.82201214], [100166.46366383, 100147.843539 , 100129.03875949, ..., 100121.46818068, 100140.34304826, 100159.03859123]])

tests.test_stats module

Title: TestStatut.py Author: N. Habili, nariman.habili@ga.gov.au CreationDate: 2006-12-20 Description: Unit testing module for statutils.py

Version: $Rev: 563 $

ModifiedBy: ModifiedDate: Modification:

$Id: TestStat.py 563 2007-10-24 02:52:40Z carthur $

class TestStats(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

gridLimit = {'xMax': 180, 'xMin': 70, 'yMax': 0, 'yMin': -40}
gridSpace = {'x': 5, 'y': 5}
test_BandWidth()

Testing bandwidth function

test_GetCellLonLat()

Testing getCellLonLat

test_GetCellNum()

Testing getCellNum

test_GetMaxRange()

Testing getMaxRange

test_GetMinRange()

Testing getMinRange

test_GetOccurence()

Testing getOccurance

test_MaxCellNum()

Testing maxCellNum

test_ValidCellNum()

Testing validCellNum

test_cdf()

Testing cdf

test_cdf2d()

Testing cdf2d

test_cdfzeros()

Test cdf returns zero array for zero input

tests.test_vmax module

Title: TestVMax.Py Author: Craig Arthur, craig.arthur@ga.gov.au CreationDate: 2006-10-24 Description: Unit test for vmax.py

Version: $Rev: 563 $

ModifiedBy: N. Habili ModifiedDate: 2007-04-27 Modification: vMax and pDiff are now two separate tests

ModifiedBy: N. Habili ModifiedDate: 2007-04-27 Modification: Added tests for exceptions

$Id: TestVMax.py 563 2007-10-24 02:52:40Z carthur $

class TestVMax(methodName='runTest')

Bases: unittest.case.TestCase

pc = array([ 88000, 89000, 90000, 91000, 92000, 93000, 94000, 95000, 96000, 97000, 98000, 99000, 100000, 101000])
pe = 101000
test_pDiff()

Testing pDiff

test_vMax()

Testing vMax

vmax = {'atkin': [69.863944556, 66.3538774077, 62.7379715373, 59.0029306788, 55.1322554425, 51.1050167812, 46.8939397787, 42.4622486228, 37.7581116559, 32.7039505937, 27.1731303211, 20.9284420943, 13.3928678506, 0.0], 'holl': [73.527058, 70.642513, 67.635057, 64.487496, 61.178211, 57.67937, 53.95411, 49.9518, 45.599546, 40.785474, 35.321256, 28.839685, 20.392737, 0], 'will': [71.283768, 68.487229, 65.571529, 62.52, 59.31168, 55.919588, 52.307985, 48.427784, 44.208316, 39.54112, 34.243614, 27.959794, 19.77056, 0]}

tests.test_windmodels module

class TestWindField(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_Hubbert()
test_Kepert()
test_McConochie()
class TestWindVelocity(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testDoubleHolland()

Test Double Holland radial profile

testHolland()

Test Holland radial profile

testJelesnianski()

Test Jelesnianski radial profile

testPowell()

Test Powell radial profile

testRankine()

Test Rankine radial profile

testWilloughby()

Test Willoughby radial profile

class TestWindVorticity(methodName='runTest')

Bases: tests.NumpyTestCase.NumpyTestCase

setUp()

Hook method for setting up the test fixture before exercising it.

testDoubleHolland()
testHolland()
testJelesnianski()
testPowell()
testRankine()
testWilloughby()

Module contents