mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-12 08:51:54 +08:00
added a filter for nan values in risk data relay
This commit is contained in:
@@ -126,7 +126,7 @@ class RiskMetrics():
|
||||
Returns a dict object of the form:
|
||||
"""
|
||||
period_label = self.end_date.strftime("%Y-%m")
|
||||
return {
|
||||
rval = {
|
||||
'trading_days' : self.trading_days,
|
||||
'benchmark_volatility' : self.benchmark_volatility,
|
||||
'algo_volatility' : self.algorithm_volatility,
|
||||
@@ -141,6 +141,8 @@ class RiskMetrics():
|
||||
'period_label' : period_label
|
||||
}
|
||||
|
||||
return {k:None if np.isnan(v) else v for k,v in rval.iteritems()}
|
||||
|
||||
def __repr__(self):
|
||||
statements = []
|
||||
metrics = [
|
||||
|
||||
Reference in New Issue
Block a user