Permalink
Browse files

Reverted revert 313d962

  • Loading branch information...
timlinux committed Dec 4, 2012
1 parent 89f9b47 commit 676497564ebb7a94d9b9de1be3cdd74075b33078
Showing with 5,377 additions and 1,116 deletions.
  1. +10 −2 Makefile
  2. +1 −2 __init__.py
  3. +4 −4 docs/source/api-docs/safe.rst
  4. +11 −11 docs/source/api-docs/safe/common.rst
  5. +6 −6 docs/source/api-docs/safe/engine/impact_functions_for_testing.rst
  6. +5 −4 docs/source/api-docs/safe/impact_functions.rst
  7. +2 −2 docs/source/api-docs/safe/impact_functions/earthquake.rst
  8. +1 −1 docs/source/api-docs/safe/impact_functions/inundation.rst
  9. +1 −1 docs/source/api-docs/safe/impact_functions/volcanic.rst
  10. +2 −2 docs/source/api-docs/safe/postprocessors.rst
  11. +9 −9 docs/source/api-docs/safe/storage.rst
  12. +18 −18 docs/source/api-docs/safe_qgis.rst
  13. +10 −10 docs/source/api-docs/safe_qgis_tests.rst
  14. +1 −0 docs/source/developer-docs/index.rst
  15. +10 −0 docs/source/developer-docs/logging.rst
  16. +5 −0 docs/source/developer-docs/platform_windows.rst
  17. +24 −0 docs/source/developer-docs/profiling.rst
  18. +16 −8 docs/source/user-docs/faq.rst
  19. +18 −0 docs/source/user-docs/impact_function_docs/CategorisedHazardBuildingImpactFunction.rst
  20. +18 −0 docs/source/user-docs/impact_function_docs/CategorisedHazardPopulationImpactFunction.rst
  21. +14 −0 docs/source/user-docs/impact_function_docs/EarthquakeBuildingImpactFunction.rst
  22. +33 −0 docs/source/user-docs/impact_function_docs/FloodBuildingImpactFunction.rst
  23. +18 −0 docs/source/user-docs/impact_function_docs/FloodEvacuationFunction.rst
  24. +18 −0 docs/source/user-docs/impact_function_docs/FloodEvacuationFunctionVectorHazard.rst
  25. +14 −0 docs/source/user-docs/impact_function_docs/FloodRoadImpactFunctionExperimental.rst
  26. +18 −0 docs/source/user-docs/impact_function_docs/ITBFatalityFunction.rst
  27. +14 −0 docs/source/user-docs/impact_function_docs/PadangEarthquakeBuildingDamageFunction.rst
  28. +18 −0 docs/source/user-docs/impact_function_docs/VolcanoBuildingImpact.rst
  29. +18 −0 docs/source/user-docs/impact_function_docs/VolcanoPolygonHazardPopulation.rst
  30. +20 −0 docs/source/user-docs/impact_functions_doc.rst
  31. +1 −0 docs/source/user-docs/index.rst
  32. +23 −3 docs/source/user-docs/options.rst
  33. +0 −103 docs/web_site/index.html
  34. +115 −0 extras/swap_gml_coords.py
  35. +2 −2 metadata.txt
  36. +1 −1 pylintrc
  37. +1 −1 pylintrc_jenkins
  38. +5 −3 safe/api.py
  39. +3 −0 safe/common/dynamic_translations.py
  40. +1 −0 safe/common/polygon.py
  41. +1 −1 safe/common/utilities.py
  42. +19 −13 safe/engine/impact_functions_for_testing/itb_fatality_model_configurable.py
  43. +55 −0 safe/engine/interpolation.py
  44. +77 −1 safe/engine/test_engine.py
  45. BIN safe/i18n/af/LC_MESSAGES/inasafe.mo
  46. +179 −113 safe/i18n/af/LC_MESSAGES/inasafe.po
  47. BIN safe/i18n/id/LC_MESSAGES/inasafe.mo
  48. +196 −113 safe/i18n/id/LC_MESSAGES/inasafe.po
  49. +2 −0 safe/impact_functions/__init__.py
  50. +59 −34 safe/impact_functions/core.py
  51. +4 −3 safe/impact_functions/earthquake/earthquake_building_impact.py
  52. +2 −1 safe/impact_functions/earthquake/itb_building_impact_model.py
  53. +35 −20 safe/impact_functions/earthquake/itb_earthquake_fatality_model.py
  54. +5 −4 safe/impact_functions/earthquake/padang_building_impact_model.py
  55. +62 −0 safe/impact_functions/earthquake/pager_earthquake_fatality_model.py
  56. +54 −12 safe/impact_functions/inundation/flood_OSM_building_impact.py
  57. +11 −9 safe/impact_functions/inundation/flood_population_evacuation.py
  58. +37 −20 safe/impact_functions/inundation/flood_population_evacuation_polygon_hazard.py
  59. +10 −8 safe/impact_functions/test_plugin_core.py
  60. +4 −2 safe/impact_functions/volcanic/volcano_building_impact.py
  61. +15 −0 safe/postprocessors/postprocessor_factory.py
  62. +10 −4 safe/storage/test_io.py
  63. +6 −2 safe/storage/vector.py
  64. +120 −34 safe_qgis/clipper.py
  65. +20 −15 safe_qgis/exceptions.py
  66. +170 −62 safe_qgis/function_options_dialog.py
  67. +44 −53 safe_qgis/function_options_dialog_base.py
  68. +41 −15 safe_qgis/function_options_dialog_base.ui
  69. +8 −3 safe_qgis/help.py
  70. BIN safe_qgis/i18n/inasafe_id.qm
  71. +228 −208 safe_qgis/i18n/inasafe_id.ts
  72. +5 −5 safe_qgis/impact_calculator.py
  73. +4 −4 safe_qgis/impact_calculator_thread.py
  74. +9 −9 safe_qgis/keyword_io.py
  75. +4 −4 safe_qgis/keywords_dialog.py
  76. +2 −2 safe_qgis/map.py
  77. +6 −6 safe_qgis/map_legend.py
  78. +12 −0 safe_qgis/options_dialog.py
  79. +32 −11 safe_qgis/options_dialog_base.py
  80. +43 −12 safe_qgis/options_dialog_base.ui
  81. +2 −2 safe_qgis/plugin.py
  82. +22 −22 safe_qgis/safe_interface.py
  83. +98 −6 safe_qgis/test_clipper.py
  84. BIN safe_qgis/test_data/test_images/addSymbolToLegend-variantWindowsXPSP3-32.png
  85. BIN safe_qgis/test_data/test_images/getClassToLegend-variantWindowsXPSP3-32.png
  86. BIN safe_qgis/test_data/test_images/getLegend-variantWindowsXPSP3-32.png
  87. BIN safe_qgis/test_data/test_images/getRasterLegend-variantWindowsXPSP3-32.png
  88. BIN safe_qgis/test_data/test_images/getVectorLegend-variantWindowsXPSP3-32.png
  89. BIN safe_qgis/test_data/test_images/renderHtmlToImage-variantWindowsXPSP3-32.png
  90. +67 −1 safe_qgis/test_dock.py
  91. +68 −13 safe_qgis/test_function_options_dialog.py
  92. +1 −0 safe_qgis/test_html_renderer.py
  93. +7 −7 safe_qgis/test_impact_calculator.py
  94. +3 −3 safe_qgis/test_keyword_io.py
  95. +3 −3 safe_qgis/test_keywords_dialog.py
  96. +5 −0 safe_qgis/test_map_legend.py
  97. +27 −1 safe_qgis/test_qgis_environment.py
  98. +5 −5 safe_qgis/test_safe_interface.py
  99. +20 −13 safe_qgis/utilities.py
  100. +121 −0 scripts/gen_impfunc_doc.py
  101. +12 −3 scripts/gen_rst_script.py
  102. +5 −3 scripts/inasafe-install
  103. +74 −38 scripts/netcdf2tif.py
  104. +2 −0 scripts/update-website.sh
  105. +12 −0 third_party/raven/LICENSE
  106. +18 −0 third_party/raven/__init__.py
  107. +563 −0 third_party/raven/base.py
  108. +86 −0 third_party/raven/conf/__init__.py
  109. +67 −0 third_party/raven/conf/defaults.py
  110. 0 third_party/raven/contrib/__init__.py
  111. +28 −0 third_party/raven/contrib/async.py
  112. +7 −0 third_party/raven/contrib/paste.py
  113. 0 third_party/raven/contrib/transports/__init__.py
  114. +58 −0 third_party/raven/contrib/zerorpc/__init__.py
  115. +148 −0 third_party/raven/events.py
  116. +7 −0 third_party/raven/handlers/__init__.py
  117. +78 −0 third_party/raven/handlers/logbook.py
  118. +129 −0 third_party/raven/handlers/logging.py
  119. +51 −0 third_party/raven/middleware.py
  120. +111 −0 third_party/raven/processors.py
  121. +7 −0 third_party/raven/scripts/__init__.py
  122. +88 −0 third_party/raven/scripts/runner.py
  123. +12 −0 third_party/raven/transport/__init__.py
  124. +243 −0 third_party/raven/transport/base.py
  125. +21 −0 third_party/raven/transport/exceptions.py
  126. +67 −0 third_party/raven/transport/registry.py
  127. +103 −0 third_party/raven/transport/threaded.py
  128. +125 −0 third_party/raven/utils/__init__.py
  129. +94 −0 third_party/raven/utils/encoding.py
  130. +34 −0 third_party/raven/utils/json.py
  131. +10 −0 third_party/raven/utils/serializer/__init__.py
  132. +139 −0 third_party/raven/utils/serializer/base.py
  133. +85 −0 third_party/raven/utils/serializer/manager.py
  134. +239 −0 third_party/raven/utils/stacks.py
  135. +12 −0 third_party/raven/utils/urlparse.py
  136. +93 −0 third_party/raven/utils/wsgi.py
View
@@ -152,7 +152,7 @@ testdata:
@echo "Updating inasafe_data - public test and demo data repository"
@echo "Update the hash to check out a specific data version "
@echo "------------------------------------------------------------"
- @scripts/update-test-data.sh 0a33f7d27c28a8fb7ad7951ed7163341ef1ea7ad 2>&1 | tee tmp_warnings.txt; [ $${PIPESTATUS[0]} -eq 0 ] && rm -f tmp_warnings.txt || echo "Stored update warnings in tmp_warnings.txt";
+ @scripts/update-test-data.sh 87153042627bb1a7ae1547521708bb9bc12a3fd3 2>&1 | tee tmp_warnings.txt; [ $${PIPESTATUS[0]} -eq 0 ] && rm -f tmp_warnings.txt || echo "Stored update warnings in tmp_warnings.txt";
#check and show if there was an error retrieving the test data
testdata_errorcheck:
@@ -216,6 +216,14 @@ run_data_audit:
@echo "-----------------------------------"
@-export PYTHONPATH=`pwd`:$(PYTHONPATH); python scripts/data_IP_audit.py
+gen_impact_function_doc:
+ @echo
+ @echo "-----------------------------------"
+ @echo "Generate impact functions' documentation"
+ @echo "-----------------------------------"
+ @-export PYTHONPATH=`pwd`:$(PYTHONPATH); python scripts/gen_impfunc_doc.py
+ @echo $(PYTHONPATH)
+
pylint-count:
@echo
@echo "---------------------------"
@@ -298,4 +306,4 @@ jenkins-pep8:
@echo "-----------------------------"
@echo "PEP8 issue check for Jenkins"
@echo "-----------------------------"
- @pep8 --repeat --ignore=E203 --exclude docs,odict.py,keywords_dialog_base.py,dock_base.py,options_dialog_base.py,resources.py,resources_rc.py,help_base.py,xml_tools.py,system_tools.py,data_audit.py,data_audit_wrapper.py,impact_functions_doc_base.py,configurable_impact_functions_dialog_base.py . > pep8.log || :
+ @pep8 --repeat --ignore=E203 --exclude docs,odict.py,keywords_dialog_base.py,dock_base.py,options_dialog_base.py,resources.py,resources_rc.py,help_base.py,xml_tools.py,system_tools.py,data_audit.py,data_audit_wrapper.py,impact_functions_doc_base.py,function_options_dialog_base.py . > pep8.log || :
View
@@ -14,7 +14,6 @@
"""
__author__ = 'tim@linfiniti.com'
-__version__ = '1.0.0'
__date__ = '10/01/2011'
__copyright__ = ('Copyright 2012, Australia Indonesia Facility for '
'Disaster Reduction')
@@ -49,7 +48,7 @@ def description():
def version():
"""Version of the plugin."""
- return 'Version 1.0.1'
+ return 'Version 1.1.0'
def qgisMinimumVersion():
@@ -6,10 +6,10 @@ Package::safe
safe/api
safe/defaults
- safe/storage
- safe/postprocessors
- safe/engine
- safe/impact_functions
safe/i18n
safe/test
+ safe/engine
+ safe/postprocessors
+ safe/impact_functions
safe/common
+ safe/storage
@@ -4,19 +4,19 @@ Package::safe.common
.. toctree::
:maxdepth: 2
- common/geodesy
- common/tables
- common/exceptions
+ common/test_geodesy
+ common/version
+ common/utilities
common/numerics
+ common/tables
+ common/test_interpolate
common/testing
- common/polygon
- common/test_tables
- common/interpolation2d
- common/utilities
+ common/test_numerics
common/test_polygon
- common/version
- common/test_interpolate
common/dynamic_translations
- common/test_numerics
+ common/test_tables
+ common/exceptions
+ common/interpolation2d
common/interpolation1d
- common/test_geodesy
+ common/polygon
+ common/geodesy
@@ -4,15 +4,15 @@ Package::safe.engine.impact_functions_for_testing
.. toctree::
:maxdepth: 2
+ impact_functions_for_testing/flood_road_impact
+ impact_functions_for_testing/itb_fatality_model_org
impact_functions_for_testing/error_raising_functions
- impact_functions_for_testing/BNPB_earthquake_guidelines
- impact_functions_for_testing/earthquake_impact_on_women
impact_functions_for_testing/unspecific_building_impact_model
- impact_functions_for_testing/itb_fatality_model_org
- impact_functions_for_testing/flood_road_impact
impact_functions_for_testing/allen_fatality_model
+ impact_functions_for_testing/NEXIS_building_impact_model
+ impact_functions_for_testing/BNPB_earthquake_guidelines
impact_functions_for_testing/general_ashload_impact
- impact_functions_for_testing/itb_fatality_model_configurable
impact_functions_for_testing/empirical_fatality_model
+ impact_functions_for_testing/itb_fatality_model_configurable
impact_functions_for_testing/HKV_flood_study
- impact_functions_for_testing/NEXIS_building_impact_model
+ impact_functions_for_testing/earthquake_impact_on_women
@@ -4,16 +4,17 @@ Package::safe.impact_functions
.. toctree::
:maxdepth: 2
- impact_functions/test_plugin_core
impact_functions/test_real_impact_functions
+ impact_functions/test_plugin_core
impact_functions/test_mappings
- impact_functions/mappings
- impact_functions/styles
impact_functions/utilities
+ impact_functions/mappings
impact_functions/test_plugins
impact_functions/core
+ impact_functions/styles
impact_functions/tephra
impact_functions/generic
- impact_functions/inundation
impact_functions/volcanic
impact_functions/earthquake
+ impact_functions/experimental
+ impact_functions/inundation
@@ -4,7 +4,7 @@ Package::safe.impact_functions.earthquake
.. toctree::
:maxdepth: 2
- earthquake/itb_building_impact_model
+ earthquake/padang_building_impact_model
earthquake/itb_earthquake_fatality_model
earthquake/earthquake_building_impact
- earthquake/padang_building_impact_model
+ earthquake/itb_building_impact_model
@@ -5,6 +5,6 @@ Package::safe.impact_functions.inundation
:maxdepth: 2
inundation/flood_road_impact_experimental
- inundation/flood_population_evacuation
inundation/flood_OSM_building_impact
inundation/flood_population_evacuation_polygon_hazard
+ inundation/flood_population_evacuation
@@ -4,5 +4,5 @@ Package::safe.impact_functions.volcanic
.. toctree::
:maxdepth: 2
- volcanic/volcano_population_evacuation_polygon_hazard
volcanic/volcano_building_impact
+ volcanic/volcano_population_evacuation_polygon_hazard
@@ -4,7 +4,7 @@ Package::safe.postprocessors
.. toctree::
:maxdepth: 2
- postprocessors/gender_postprocessor
- postprocessors/abstract_postprocessor
postprocessors/age_postprocessor
+ postprocessors/gender_postprocessor
postprocessors/postprocessor_factory
+ postprocessors/abstract_postprocessor
@@ -4,16 +4,16 @@ Package::safe.storage
.. toctree::
:maxdepth: 2
- storage/projection
- storage/test_io
- storage/test_clipping
- storage/utilities_test
- storage/clipping
- storage/layer
- storage/geometry
storage/test_vector
- storage/test_utilities
- storage/raster
storage/utilities
+ storage/test_clipping
+ storage/test_io
+ storage/test_utilities
+ storage/geometry
+ storage/projection
storage/vector
storage/core
+ storage/clipping
+ storage/utilities_test
+ storage/raster
+ storage/layer
@@ -4,29 +4,29 @@ Package::safe_qgis
.. toctree::
:maxdepth: 2
- safe_qgis/options_dialog_base
- safe_qgis/clipper
+ safe_qgis/plugin
+ safe_qgis/dock_base
safe_qgis/impact_calculator
- safe_qgis/keywords_dialog_base
+ safe_qgis/utilities
+ safe_qgis/keyword_io
+ safe_qgis/safe_interface
+ safe_qgis/function_options_dialog
+ safe_qgis/html_renderer
safe_qgis/resources_rc
- safe_qgis/dock
- safe_qgis/help
- safe_qgis/impact_functions_doc
+ safe_qgis/function_options_dialog_base
+ safe_qgis/keywords_dialog_base
safe_qgis/map_legend
+ safe_qgis/qgis_interface
safe_qgis/impact_calculator_thread
+ safe_qgis/map
+ safe_qgis/clipper
+ safe_qgis/help
+ safe_qgis/options_dialog
+ safe_qgis/impact_functions_doc
safe_qgis/exceptions
- safe_qgis/dock_base
+ safe_qgis/utilities_test
safe_qgis/keywords_dialog
safe_qgis/resources
- safe_qgis/keyword_io
- safe_qgis/html_renderer
- safe_qgis/utilities_test
- safe_qgis/plugin
- safe_qgis/safe_interface
- safe_qgis/function_options_dialog
safe_qgis/impact_functions_doc_base
- safe_qgis/function_options_dialog_base
- safe_qgis/options_dialog
- safe_qgis/utilities
- safe_qgis/qgis_interface
- safe_qgis/map
+ safe_qgis/dock
+ safe_qgis/options_dialog_base
@@ -4,20 +4,20 @@ Package::safe_qgis_tests
.. toctree::
:maxdepth: 2
+ safe_qgis_tests/test_map_legend
safe_qgis_tests/test_function_options_dialog
- safe_qgis_tests/test_init
safe_qgis_tests/test_clipper
- safe_qgis_tests/test_qgis_environment
safe_qgis_tests/test_keyword_io
+ safe_qgis_tests/test_dock
+ safe_qgis_tests/test_utilities
+ safe_qgis_tests/test_init
+ safe_qgis_tests/test_impact_functions_doc
+ safe_qgis_tests/test_help
+ safe_qgis_tests/test_safe_translations
+ safe_qgis_tests/test_safe_interface
safe_qgis_tests/test_plugin
safe_qgis_tests/test_html_renderer
- safe_qgis_tests/test_keywords_dialog
safe_qgis_tests/test_map
safe_qgis_tests/test_impact_calculator
- safe_qgis_tests/test_safe_translations
- safe_qgis_tests/test_dock
- safe_qgis_tests/test_impact_functions_doc
- safe_qgis_tests/test_utilities
- safe_qgis_tests/test_safe_interface
- safe_qgis_tests/test_help
- safe_qgis_tests/test_map_legend
+ safe_qgis_tests/test_keywords_dialog
+ safe_qgis_tests/test_qgis_environment
@@ -18,6 +18,7 @@ Developer Documentation Contents:
platform_windows
coding_standards
logging
+ profiling
i18n
version_control
maintaining_documentation
@@ -57,6 +57,16 @@ and the message provided to the LOGGER.exception call to all be logged e.g.::
The above example was contrived in the QGIS python console. When the exception
originates inside a module, the traceback will include the complete call tree.
+Logging in loops
+------------------
+.. warning::
+
+ Please be considerate when logging into loops as this can slow execution a
+ lot (we had a spatial analysis loop with two logged messages and it took
+ 15sec for 1000 itterations, removing logging brought it to 5sec)
+ See also :ref:`profiling`
+
+
Remote logging
--------------
@@ -300,6 +300,11 @@ If the installation goes successfully, you should see output like this::
Processing dependencies for pip
Finished processing dependencies for pip
+.. note:: If your Windows is 64bit, you need to do a little trick to install pip.
+ First you have to install python 32bit and add its path to PATH variable in
+ environment variable (on Windows 7: `System Properties --> Advanced --> Environment Variables`).
+ After that, run command prompt (as administrator if needed) and run `easy_install pip`
+
Installing nose
...............
@@ -0,0 +1,24 @@
+.. _profiling:
+
+Profiling
+---------
+
+Profiling a script in python is as easy as calling:
+python -m cProfile myscript.py
+see also: http://docs.python.org/2/library/profile.html#module-cProfile
+
+the problem is that sometimes the code you want to profile deep in ianSAFE. You
+can still get nice cProfiles by replacing the original call with a call to
+cProfile.runctx()
+
+so::
+
+ self.preparePolygonLayerForAggr(theClippedHazardFilename, myHazardLayer)
+would become::
+
+ cProfile.runctx('self.preparePolygonLayerForAggr(theClippedHazardFilename, myHazardLayer)', globals(), locals())
+see also http://stackoverflow.com/questions/1031657/profiling-self-and-arguments-in-python
+
+You can put a raise statement right after the runctx call so the execution is
+stopped and you can see your cProfile results in the console
+
@@ -10,14 +10,6 @@ issue tracker is open to everyone, though you will first need to register a
(free) account on GitHub to use it. You can find the GitHub self-registration
page `here <https://github.com/signup/free>`_.
-Why can't I find the plugin in the QGIS repositories?
------------------------------------------------------
-
-We do plan to publish the plugin at
-`plugins.qgis.org <http://plugins.qgis.org/>`_ so that it can be effortlessly
-installed from within QGIS, we are just no ready to do that yet. In the mean
-time please use the manual installation procedure to install InaSAFE in QGIS.
-
Do I need to pay to use |project_name|?
---------------------------------------
@@ -125,3 +117,19 @@ For vector to raster conversion, use gdal_rasterize utility, for example::
gdal_rasterize -a <attribute_name> -l <source>.shp <destination>.tif
+Why does the plugin not show up in my QGIS Plugin Manager?
+----------------------------------------------------------
+
+One common issue is that if you upgraded from QGIS 1.7.x to 1.8 you may not
+get the new plugin repo added to your repo list. To fix this you can do:
+
+* open QGIS
+* Go Plugins -> Fetch Python Plugins
+* click 'Repositories' tab
+* click add
+* :guilabel:`Name`: Official QGIS Repository
+* :guilabel:`Url`: http://plugins.qgis.org/plugins/plugins.xml
+* Save it and the plugin repo list should update. If it doesn't,
+ close and open QGIS to force an update.
+* In the python plugin manager main tab now you should find InaSAFE available
+
@@ -0,0 +1,18 @@
+Categorised Hazard Building Impact Function
+===========================================
+
+Overview
+--------
+
+**Unique Identifier**: Categorised Hazard Building Impact Function
+
+**Rating**: The Rating
+
+**Title**: Be affected
+
+**Author**: The Author
+
+Details
+-------
+
+No documentation found
Oops, something went wrong.

0 comments on commit 6764975

Please sign in to comment.