DEV: Fixes typo in git stash message comparison.
MAINT: Factor out risk metric logic from risk objects.

Move the risk metric definitions to functions at the module level
with defined parameters.

Both risk implementations call these functions, where the difference
between risk implementations is with which internal data they
send to the various risk metrics.

Metrics moved:
- Sharpe Ratio
- Sortino Ratio
- Information Ration
- Alpha
MAINT: Use trading day increment instead of timedelta in test factory.

In the test factory creation of returns, the date creation was using
a timedelta of one day instead of incrementing by trading days.

Working towards changing risk module behavior which would leverage
the trading day map, but tests fail because non-trading days are
created.

Remove `factory.create_returns`, moving uses of that function to us
`factory.create_returns_from_period`, since the number of days input
for `create_returns` was more difficult to use when specifying ranges
over arbirtray dates.
BUG: Fix error during benchmark update over empty period.

On ranges with missing data from Yahoo, e.g.:
On 2013-04-2 the date range of April 2013-03-29 failed because
of the first day in the range being Good Friday, and the API not
yet updating for the Monday after.

Handle the 404 that is found by raising and warning that no
benchmark data was found, but continuing on.
REL: v0.5.9

Highlights:

- Benchmark updating now permits empty ranges.
  (Fixes runtime crash when running immediately after Easter 2013.)
- Risk metrics
  - Performance improvents from converting to numpy and pandas.
    <@wesm, wesmckinn@gmail.com>
  - Refactoring of risk metric calculation out of class structure.
MAINT: Rename risk metric function names to include '_ratio' suffix.

To make the risk metrics being calculated more clear, change the
naming convention that ratios have a '_risk' suffix.

Also, fixes typo in beta docstring.
DEV: Update pegged version of requests. 1.1.0 -> 1.2.0
MAINT: Remove unused RiskReport.find_metric_by_end
MAINT: Use dateutil module for adding months to a datetime.

Instead of having an advance_by_months function maintained in
Zipline, leverage the relativedelta module provided by dateutil.
MAINT: Convert treasury curves data to pd.Series

Instead of using OrderedDict, use a pd.Series so that utilities
like searchsorted, etc. can be used.
STY: Add Test prefix to risk module test case.
MAINT: Remove unused members from risk test module.
MAINT: Factored out _create_data_generator helper method
MAINT: Specify --use-mirrors to pip install
MAINT: Move search day distance function to module level.
MAINT: Move get_treasury_rate to risk module level.
MAINT: Factor out start and end date choose_treasury parameters.

Preparing for move of method to a module level function.
MAINT: Remove saving of treasury duration.

The treasury_duration member in RiskMetrics is never used except
for in unit tests.

Remove the saving of treasury_duration in preparation for the
move of the choose_treasury method out of the RiskMetrics classes.

Down the line, if we do restore the sanving of treasury_duration,
choose_treasury can return a tuple that includes treasury_duration
instead of just returning the rate.
MAINT: Factor out treasury_curve argument from risk choose_benchmark

Move the reference to self.treasury_curve to a parameter, on the path
of making this method a module level function.
MAINT: Move choose_treasury method from risk metrics class to module.