otp.adaptive#
- class adaptive#
Bases:
objectThis class is mostly used as the default value for the functions’ parameters when the value of
Nonehas some other meaning or when the meaning of the parameter depends on the other parameter’s values, otp.config options or the context.Examples
For example, setting
DataSourcesymbolsparameter tootp.adaptiveallows to set symbols when running the query later.>>> data = otp.DataSource('SOME_DB', tick_type='TT', symbols=otp.adaptive) >>> otp.run(data, symbols='S1') Time X 0 2003-12-01 00:00:00.000 1 1 2003-12-01 00:00:00.001 2 2 2003-12-01 00:00:00.002 3
This is the default value of
symbolsparameter, so omitting it also works:>>> data = otp.DataSource('SOME_DB', tick_type='TT') >>> otp.run(data, symbols='S1') Time X 0 2003-12-01 00:00:00.000 1 1 2003-12-01 00:00:00.001 2 2 2003-12-01 00:00:00.002 3