Skip to content

Instantly share code, notes, and snippets.

@timlinux
Created August 23, 2013 13:19
Show Gist options
  • Select an option

  • Save timlinux/6319257 to your computer and use it in GitHub Desktop.

Select an option

Save timlinux/6319257 to your computer and use it in GitHub Desktop.
======================================================================
FAIL: Aggregation results are correct using native QGIS zonal stats.
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Jenkins\jobs\inasafe-master-win8-64\workspace\safe_qgis\widgets\test\test_dock.py", line 1060, in test_full_run_qgszstats
self.assertIn(line, myResult)
AssertionError: 'JAKARTA UTARA 344,655 172,327 136,776 16,058' not found in u'::InaSAFE Logo [qrc:/plugins/inasafe/inasafe-logo.svg]\n*****Analysis Results\n\n<table class="table table-striped condensed"> <tbody> <tr> <td colspan="100%">In the event of <i>a flood in jakarta like in 2007</i> how many <i>people</i> might <i>need evacuation</i></td> </tr> <tr> <th>People in 1.0 m of water</th> <th>977,000*</th> </tr> <tr> <td colspan="100%">* Number is rounded to the nearest 1000</td> </tr> <tr> <td colspan="100%">Map shows population density needing evacuation</td> </tr> <tr> <td colspan="100%">Table below shows the weekly minium needs for all evacuated people</td> </tr> <tr> <th>Needs per week</th> <th>Total</th> </tr> <tr> <td>Rice [kg] 2,735,600</td> </tr> <tr> <td>Drinking Water [l] 17,097,500</td> </tr> <tr> <td>Clean Water [l] 102,585,000</td> </tr> <tr> <td>Family Kits 195,400</td> </tr> <tr> <td>Toilets 48,850</td> </tr> <tr> <th colspan="100%">Action Checklist:</th> </tr> <tr> <td colspan="100%">How will warnings be disseminated?</td> </tr> <tr> <td colspan="100%">How will we reach stranded people?</td> </tr> <tr> <td colspan="100%">Do we have enough relief items?</td> </tr> <tr> <td colspan="100%">If yes, where are they located and how will we distribute them?</td> </tr> <tr> <td colspan="100%">If no, where can we obtain additional relief items from and how will we transport them to here?</td> </tr> <tr> <th colspan="100%">Notes</th> </tr> <tr> <td colspan="100%">Total population: 10,484,000</td> </tr> <tr> <td colspan="100%">People need evacuation if flood levels exceed 1.0 m</td> </tr> <tr> <td colspan="100%">Minimum needs are defined in BNPB regulation 7/2008</td> </tr> <tr> <td colspan="100%">All values are rounded up to the nearest integer in order to avoid representing human lives as fractionals.</td> </tr> </tbody></table><table class="table table-condensed table-striped"> <caption>Detailed gender report</caption> <tbody> <tr> <td>Kab_name Total Female population (affected) Weekly hygiene packs Additional weekly rice kg for pregnant and lactating women</td> </tr> <tr> <td>JAKARTA UTARA 344,641 172,321 136,771 16,058</td> </tr> <tr> <td>JAKARTA BARAT 278,349 139,174 110,463 12,969</td> </tr> <tr> <td>JAKARTA TIMUR 251,506 125,753 99,810 11,718</td> </tr> <tr> <td>JAKARTA PUSAT 66,870 33,435 26,537 3,116</td> </tr> <tr> <td>JAKARTA SELATAN 33,203 16,601 13,176 1,547</td> </tr> </tbody> </table> <table class="table table-condensed table-striped"> <caption>Detailed age report</caption> <tbody> <tr> <td>Kab_name Total Youth count (affected) Adult count (affected) Elderly count (affected)</td> </tr> <tr> <td>JAKARTA UTARA 344,641 90,641 227,118 26,882</td> </tr> <tr> <td>JAKARTA BARAT 278,349 73,206 183,432 21,711</td> </tr> <tr> <td>JAKARTA TIMUR 251,506 66,146 165,743 19,617</td> </tr> <tr> <td>JAKARTA PUSAT 66,870 17,587 44,067 5,216</td> </tr> <tr> <td>JAKARTA SELATAN 33,203 8,732 21,881 2,590</td> </tr> </tbody> </table> <table class="table table-condensed table-striped"> <caption>Detailed minimum needs report</caption> <tbody> <tr> <td>Kab_name Rice Drinking Water Water Family Kits Toilets</td> </tr> <tr> <td>JAKARTA UTARA 964,995 6,031,218 36,187,305 68,928 17,232</td> </tr> <tr> <td>JAKARTA BARAT 779,377 4,871,108 29,226,645 55,670 13,917</td> </tr> <tr> <td>JAKARTA TIMUR 704,217 4,401,355 26,408,130 50,301 12,575</td> </tr> <tr> <td>JAKARTA PUSAT 187,236 1,170,225 7,021,350 13,374 3,344</td> </tr> <tr> <td>JAKARTA SELATAN 92,968 581,053 3,486,315 6,641 1,660</td> </tr> </tbody> </table><h5 class="info"><i class="icon-info-sign icon-white"></i> Hazard details</h5><p>A flood in Jakarta like in 2007 - sourced from HKV</p><h5 class="info"><i class="icon-info-sign icon-white"></i> Exposure details</h5><p>People - sourced from Center for International Earth Science Information Network (CIESIN)</p>\n\n'
-------------------- >> begin captured stdout << ---------------------
min_value, max_value: 0.0 60.7295593145
NEW AGGR: 0
NEW AGGR: 1
NEW AGGR: 2
NEW AGGR: 3
NEW AGGR: 4
--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
InaSAFE: DEBUG: get_layer argument: <PyQt4.QtCore.QStringList object at 0x0BC92E30>
InaSAFE: DEBUG: get_layer argument: <PyQt4.QtCore.QStringList object at 0x0DC293B0>
InaSAFE: DEBUG: get_layer argument: <PyQt4.QtCore.QStringList object at 0x0DC293B0>
InaSAFE: DEBUG: get_layer argument: <PyQt4.QtCore.QStringList object at 0x0DC293B0>
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: INFO: *****Checking available memory
- *Width: * 638.0
- *Height: * 649.0
- *Cell Size: * 0.00045228819716
Memory requirement: about 3.15904 mb per raster layer (1408 mb available)Memory used / available: 0.224364/10
InaSAFE: DEBUG: my pre dialog keywords{'category': 'postprocessing', 'aggregation attribute': 'KAB_NAME', 'title': 'kabupaten jakarta', 'source': 'OpenStreetMap', 'female ratio attribute': 'Use default', 'female ratio default': 0.5}
InaSAFE: DEBUG: AOImode: False
InaSAFE: DEBUG: adjust ing dialog size
InaSAFE: DEBUG: adjust ing dialog size
InaSAFE: DEBUG: togglePostprocessingWidgets
InaSAFE: DEBUG: adjust ing dialog size
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Search path: c:\python27;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\lib;C:\PROGRA~2\Quantum GIS Lisboa\apps\msys\bin;C:\PROGRA~2\Quantum GIS Lisboa\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;;"C:\Users\inasafe\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\bin\bin\";C:\PROGRA~2\Quantum GIS Lisboa\apps\msys\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\Scripts;C:\PROGRA~2\Quantum GIS Lisboa\apps\qgis\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\lib;"C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\Scripts\"
InaSAFE: DEBUG: Path for gdalwarp: ['C:\\PROGRA~2\\Quantum GIS Lisboa\\bin\\gdalwarp.EXE']
InaSAFE: DEBUG: "C:\PROGRA~2\Quantum GIS Lisboa\bin\gdalwarp.EXE" -q -t_srs EPSG:4326 -r near -tr 0.000452 0.000452 -cutline c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\work\extent_kmdcso.kml -crop_to_cutline -of GTiff "C:\Jenkins\jobs\inasafe-master-win8-64\inasafe_data\hazard\Flood_Current_Depth_Jakarta_geographic.asc" "c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\work\clip_fpw7nt.tif"
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Search path: c:\python27;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\lib;C:\PROGRA~2\Quantum GIS Lisboa\apps\msys\bin;C:\PROGRA~2\Quantum GIS Lisboa\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;;"C:\Users\inasafe\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\bin\bin\";C:\PROGRA~2\Quantum GIS Lisboa\apps\msys\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\Scripts;C:\PROGRA~2\Quantum GIS Lisboa\apps\qgis\bin;C:\PROGRA~2\Quantum GIS Lisboa\apps\grass\grass-6.4.2\lib;"C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\Scripts\"
InaSAFE: DEBUG: Path for gdalwarp: ['C:\\PROGRA~2\\Quantum GIS Lisboa\\bin\\gdalwarp.EXE']
InaSAFE: DEBUG: "C:\PROGRA~2\Quantum GIS Lisboa\bin\gdalwarp.EXE" -q -t_srs EPSG:4326 -r near -tr 0.000452 0.000452 -cutline c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\work\extent_i8bhdt.kml -crop_to_cutline -of GTiff "C:\Jenkins\jobs\inasafe-master-win8-64\inasafe_data\exposure\glp10ag.asc" "c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\work\clip_xsbnso.tif"
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: calculate_impact called with:
Layers: [<safe.storage.raster.Raster instance at 0x0D3C8B98>, <safe.storage.raster.Raster instance at 0x0D3C8B20>]
Function:<class 'workspace.safe.impact_functions.inundation.flood_population_evacuation.FloodEvacuationFunction'>
InaSAFE: DEBUG: Do aggregation
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Dynamic message event
InaSAFE: DEBUG: Removing this attributes: [1, 2]
InaSAFE: DEBUG: Calculating zonal stats for:
InaSAFE: DEBUG: Raster: c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\impacts\tmpjs2aca.tif
InaSAFE: DEBUG: Vector: c:\windows\temp\inasafe\2013-08-23\INASAFE-WIN8-64$\work\clip_1occui.shp
InaSAFE: DEBUG: Pixel box: W: 316 H: 294 Offset Left: 0 Offset Bottom: 34
InaSAFE: DEBUG: Pixel box: W: 200 H: 209 Offset Left: 234 Offset Bottom: 122
InaSAFE: DEBUG: Pixel box: W: 288 H: 360 Offset Left: 113 Offset Bottom: 271
InaSAFE: DEBUG: Pixel box: W: 576 H: 209 Offset Left: 59 Offset Bottom: 19
InaSAFE: DEBUG: Pixel box: W: 301 H: 490 Offset Left: 337 Offset Bottom: 158
InaSAFE: DEBUG: Python zonal stats duration: 0.15797394441s
InaSAFE: DEBUG: Do postprocessing
InaSAFE: DEBUG: Running this postprocessors: {'Gender': <safe.postprocessors.gender_postprocessor.GenderPostprocessor instance at 0x0DC223F0>, 'Age': <safe.postprocessors.age_postprocessor.AgePostprocessor instance at 0x0C9AC3A0>, 'MinimumNeeds': <safe.postprocessors.minimum_needs_postprocessor.MinimumNeedsPostprocessor instance at 0x0DC225D0>}
InaSAFE: DEBUG: name : Total
result : 278349
InaSAFE: DEBUG: name : Female population (affected)
result : 139174
InaSAFE: DEBUG: name : Weekly hygiene packs
result : 110463
InaSAFE: DEBUG: name : Additional weekly rice kg for pregnant and lactating women
result : 12969
InaSAFE: DEBUG: name : Total
result : 278349
InaSAFE: DEBUG: name : Youth count (affected)
result : 73206
InaSAFE: DEBUG: name : Adult count (affected)
result : 183432
InaSAFE: DEBUG: name : Elderly count (affected)
result : 21711
InaSAFE: DEBUG: name : Rice
result : 779377
InaSAFE: DEBUG: name : Drinking Water
result : 4871108
InaSAFE: DEBUG: name : Water
result : 29226645
InaSAFE: DEBUG: name : Family Kits
result : 55670
InaSAFE: DEBUG: name : Toilets
result : 13917
InaSAFE: DEBUG: name : Total
result : 66870
InaSAFE: DEBUG: name : Female population (affected)
result : 33435
InaSAFE: DEBUG: name : Weekly hygiene packs
result : 26537
InaSAFE: DEBUG: name : Additional weekly rice kg for pregnant and lactating women
result : 3116
InaSAFE: DEBUG: name : Total
result : 66870
InaSAFE: DEBUG: name : Youth count (affected)
result : 17587
InaSAFE: DEBUG: name : Adult count (affected)
result : 44067
InaSAFE: DEBUG: name : Elderly count (affected)
result : 5216
InaSAFE: DEBUG: name : Rice
result : 187236
InaSAFE: DEBUG: name : Drinking Water
result : 1170225
InaSAFE: DEBUG: name : Water
result : 7021350
InaSAFE: DEBUG: name : Family Kits
result : 13374
InaSAFE: DEBUG: name : Toilets
result : 3344
InaSAFE: DEBUG: name : Total
result : 33203
InaSAFE: DEBUG: name : Female population (affected)
result : 16601
InaSAFE: DEBUG: name : Weekly hygiene packs
result : 13176
InaSAFE: DEBUG: name : Additional weekly rice kg for pregnant and lactating women
result : 1547
InaSAFE: DEBUG: name : Total
result : 33203
InaSAFE: DEBUG: name : Youth count (affected)
result : 8732
InaSAFE: DEBUG: name : Adult count (affected)
result : 21881
InaSAFE: DEBUG: name : Elderly count (affected)
result : 2590
InaSAFE: DEBUG: name : Rice
result : 92968
InaSAFE: DEBUG: name : Drinking Water
result : 581053
InaSAFE: DEBUG: name : Water
result : 3486315
InaSAFE: DEBUG: name : Family Kits
result : 6641
InaSAFE: DEBUG: name : Toilets
result : 1660
InaSAFE: DEBUG: name : Total
result : 344641
InaSAFE: DEBUG: name : Female population (affected)
result : 172321
InaSAFE: DEBUG: name : Weekly hygiene packs
result : 136771
InaSAFE: DEBUG: name : Additional weekly rice kg for pregnant and lactating women
result : 16058
InaSAFE: DEBUG: name : Total
result : 344641
InaSAFE: DEBUG: name : Youth count (affected)
result : 90641
InaSAFE: DEBUG: name : Adult count (affected)
result : 227118
InaSAFE: DEBUG: name : Elderly count (affected)
result : 26882
InaSAFE: DEBUG: name : Rice
result : 964995
InaSAFE: DEBUG: name : Drinking Water
result : 6031218
InaSAFE: DEBUG: name : Water
result : 36187305
InaSAFE: DEBUG: name : Family Kits
result : 68928
InaSAFE: DEBUG: name : Toilets
result : 17232
InaSAFE: DEBUG: name : Total
result : 251506
InaSAFE: DEBUG: name : Female population (affected)
result : 125753
InaSAFE: DEBUG: name : Weekly hygiene packs
result : 99810
InaSAFE: DEBUG: name : Additional weekly rice kg for pregnant and lactating women
result : 11718
InaSAFE: DEBUG: name : Total
result : 251506
InaSAFE: DEBUG: name : Youth count (affected)
result : 66146
InaSAFE: DEBUG: name : Adult count (affected)
result : 165743
InaSAFE: DEBUG: name : Elderly count (affected)
result : 19617
InaSAFE: DEBUG: name : Rice
result : 704217
InaSAFE: DEBUG: name : Drinking Water
result : 4401355
InaSAFE: DEBUG: name : Water
result : 26408130
InaSAFE: DEBUG: name : Family Kits
result : 50301
InaSAFE: DEBUG: name : Toilets
result : 12575
InaSAFE: DEBUG: Showing Impact Keywords
InaSAFE: DEBUG: myEngineImpactLayer.is_raster
InaSAFE: DEBUG: Rendering raster using <= 1.8 styling
InaSAFE: DEBUG: [{'min': 0.0, 'max': 7.591194914315853, 'colour': '#FFFFFF', 'label': '[0 - 8]', 'transparency': 100, 'quantity': 7.591194914315853}, {'min': 7.5911949143158539, 'max': 15.182389828631706, 'colour': '#38A800', 'label': '[8 - 15] Low', 'transparency': 0, 'quantity': 15.182389828631706}, {'min': 15.182389828631708, 'max': 22.77358474294756, 'colour': '#79C900', 'label': '[15 - 23]', 'transparency': 0, 'quantity': 22.77358474294756}, {'min': 22.773584742947563, 'max': 30.364779657263412, 'colour': '#CEED00', 'label': '[23 - 30]', 'transparency': 0, 'quantity': 30.364779657263412}, {'min': 30.364779657263416, 'max': 37.95597457157926, 'colour': '#FFCC00', 'label': '[30 - 38] Medium', 'transparency': 0, 'quantity': 37.95597457157926}, {'min': 37.955974571579269, 'max': 45.54716948589512, 'colour': '#FF6600', 'label': '[38 - 46]', 'transparency': 0, 'quantity': 45.54716948589512}, {'min': 45.547169485895125, 'max': 53.138364400210975, 'colour': '#FF0000', 'label': '[46 - 53]', 'transparency': 0, 'quantity': 53.138364400210975}, {'min': 53.138364400210982, 'max': 60.729559314526824, 'colour': '#7A0000', 'label': '[53 - 61] High', 'transparency': 0, 'quantity': 60.729559314526824}]
InaSAFE: DEBUG: Evaluating class:
{'min': 0.0, 'max': 7.591194914315853, 'colour': '#FFFFFF', 'label': '[0 - 8]', 'transparency': 100, 'quantity': 7.591194914315853}
InaSAFE: DEBUG: Evaluating class:
{'min': 7.5911949143158539, 'max': 15.182389828631706, 'colour': '#38A800', 'label': '[8 - 15] Low', 'transparency': 0, 'quantity': 15.182389828631706}
InaSAFE: DEBUG: Evaluating class:
{'min': 15.182389828631708, 'max': 22.77358474294756, 'colour': '#79C900', 'label': '[15 - 23]', 'transparency': 0, 'quantity': 22.77358474294756}
InaSAFE: DEBUG: Evaluating class:
{'min': 22.773584742947563, 'max': 30.364779657263412, 'colour': '#CEED00', 'label': '[23 - 30]', 'transparency': 0, 'quantity': 30.364779657263412}
InaSAFE: DEBUG: Evaluating class:
{'min': 30.364779657263416, 'max': 37.95597457157926, 'colour': '#FFCC00', 'label': '[30 - 38] Medium', 'transparency': 0, 'quantity': 37.95597457157926}
InaSAFE: DEBUG: Evaluating class:
{'min': 37.955974571579269, 'max': 45.54716948589512, 'colour': '#FF6600', 'label': '[38 - 46]', 'transparency': 0, 'quantity': 45.54716948589512}
InaSAFE: DEBUG: Evaluating class:
{'min': 45.547169485895125, 'max': 53.138364400210975, 'colour': '#FF0000', 'label': '[46 - 53]', 'transparency': 0, 'quantity': 53.138364400210975}
InaSAFE: DEBUG: Evaluating class:
{'min': 53.138364400210982, 'max': 60.729559314526824, 'colour': '#7A0000', 'label': '[53 - 61] High', 'transparency': 0, 'quantity': 60.729559314526824}
--------------------- >> end captured logging << ---------------------
Coverage.py warning: Trace function changed, measurement is likely wrong: None
Coverage.py warning: Trace function changed, measurement is likely wrong: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment