mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-09 11:19:23 +08:00
better filter for nan check
This commit is contained in:
@@ -141,8 +141,10 @@ class RiskMetrics():
|
|||||||
'period_label' : period_label
|
'period_label' : period_label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if a field in rval is nan, and replace it with
|
||||||
|
# None.
|
||||||
def check_entry(key, value):
|
def check_entry(key, value):
|
||||||
if key in {'algo_volatility', 'benchmark_volatility', 'beta'}:
|
if key != 'period_label':
|
||||||
return np.isnan(value)
|
return np.isnan(value)
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user