gem/oq-risklib — pull request #55 by matley (2013-07-05 15:43:35+00:00)
Title: Refactoring: added risk workflows

This pull request (together with a companion one on the http://github.com/gem/oq-engine repository) concerns a major refactoring of the risk calculators. The goal is to move the calculation logic outside of oq-engine such that it can easily unit tested (without requiring celery, database, etc.).

The calculation logic have been split into two modules: calculators and workflows. The former contains simple wrappers of existing functions in the module ```openquake.risklib.scientific```, designed to be easily pickleable and shared among different workflows. The latter includes the different workflows (e.g. Classical PSHA, Probabilistic Event Based, Scenario, etc.) implemented as generators. The idea is that given in input an iterator over different hazard realization data a workflow generator yield at each iteration the risk outputs for each realization.

I have also started improving the existing documentation. This is an on-going activity that will continue in the next month.

As a "side effect" this pull request removes risklite as it was deprecated and its presence hampers the refactoring activities needed on risklib.

Build status: http://ci.openquake.org/job/z_oq-risklib_template/7/