db/schema/openquake.sql:

Added `weight` to `hazard_curve_data` table. This is just copied from
`lt_realization`... when doing processing, this makes for less joins and
a simpler query.
db/models:

Added `weights` to `HazardCurveData`, to make the schema changes.
calcs/hazard/classical/core:

Added mean curve, quantile curve, and weighted quantile curve post-processing
functions.
calcs/hazard/class/core:

Cleaned up imports.
calcs/hazard/classical/core:

Added a constant to limit HazardCurveData query sizes.
calcs/hazard/classical/core:

Added a couple of utility functions for (incrementally) fetching
hazard curves for post-processing.
calcs/hazard/classical/core:

Added an alternate method for doing mean/quantile post-processing. This method
is currently not distributed.
calcs/hazard/general:

Finalization of hazard curves now inserts the `weight` also.
calcs/hazard/classical/core,post_processing:

Moved mean and quantile curve functions to `post_processing` module.
tests/calcs/hazard/classical/post_processing_test:

Added unit tests for mean/quantile curve functions.
calcs/hazard/classical/post_processing:

Added a an optimized/special-cased version of `mquantiles` for
`compute_quantile_curve`.
tests/calcs/hazard/classical/post_processing_test:

Added a comparison to scipy's mquantiles, to test the quality of the custom
optimized version (see
calcs.hazard.classical.post_processing.compute_quantile_curve).
calcs/hazard/classical/post_processing:

Corrected a comment.
calcs/hazard/classical/core:

Added handling for a corner case so the query block size doesn't get set to
zero.
calcs/hazard/classical/core:

Cleaned up some imports.
calcs/hazard/classical/core:

Minor refactoring to aggregate post processing logic, to make things a bit
clearer.
calcs/hazard/classical/core:

Renamed _MAX_CURVES_PER_SELECT constant to _CURVE_CACHE_SIZE.
calcs/hazard/classical/core:

Added incremental bulk inserter flushes, once the _CURVE_CACHE_SIZE has been
reached.

This keeps memory usage in check somewhat.
calcs/hazard/classical/core, db/models:

Moved `_all_curves_for_imt` into the HazardCurveDataManager.
calcs/hazard/classical/core, db/models:

Moved `queryset_iter` util to `models`.