[et=12h]
[at=12.5h]
The Scenario Risk calculation does not have a QA test; it needs one.
The biggest difficulty identified so far is the following:
Part of the scenario calculation includes randomly sampling a normal distribution. We're currently using scipy.stats.norm.rvs to generate random variates. Unfortunately, this means that getting consistent test results every time is impossible unless we seed the random number generator. I read the scipy documentation and some related source code and there is no obvious way to specify a seed. However, we should instead be able to use the Python standard 'random' module as a replacement. See: http://docs.python.org/dev/library/random.html#random.normalvariate. This implementation can be seeded and should enable us to get predictable test results.
Tasks:
- Create a small demo file set that can run quickly
- Gather 'expected result' test data
- Add an EPSILON_RANDOM_SEED parameter to the job profile for Scenario Risk calculations
- This seed should be used in the random normal distribution sample (see description above).
Open Issues:
- Need to talk with Vitor to if test data/expected results are need on the Hazard side. If so, that adds significant amount of scope to this work package.
Currently waiting on some feedback and test data from Damiano and Vitor. Blocked.