otp.adaptive#

class adaptive#

Bases: object

This class is mostly used as the default value for the functions’ parameters when the value of None has 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 DataSource symbols parameter to otp.adaptive allows 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 symbols parameter, 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