mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-08 11:16:58 +08:00
Added parameter type validation to record_variables
This commit is contained in:
@@ -283,9 +283,13 @@ class TradingAlgorithm(object):
|
||||
then set self.mavg to some value and it will be recorded.
|
||||
|
||||
"""
|
||||
if isinstance(names, basestring):
|
||||
if not isinstance(names, list):
|
||||
names = [names]
|
||||
|
||||
for name in names:
|
||||
if not isinstance(name, basestring):
|
||||
raise TypeError("record_variables expects only strings")
|
||||
|
||||
if self.initialized:
|
||||
raise Exception(MESSAGES.ERRORS.CALL_RECORD_VARIABLES_POST_INIT)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user