onetick-py 1.162.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. locator_parser/__init__.py +0 -0
  2. locator_parser/acl.py +73 -0
  3. locator_parser/actions.py +266 -0
  4. locator_parser/common.py +365 -0
  5. locator_parser/io.py +41 -0
  6. locator_parser/locator.py +150 -0
  7. onetick/__init__.py +101 -0
  8. onetick/doc_utilities/__init__.py +3 -0
  9. onetick/doc_utilities/napoleon.py +40 -0
  10. onetick/doc_utilities/ot_doctest.py +140 -0
  11. onetick/doc_utilities/snippets.py +280 -0
  12. onetick/lib/__init__.py +4 -0
  13. onetick/lib/instance.py +138 -0
  14. onetick/py/__init__.py +290 -0
  15. onetick/py/_stack_info.py +89 -0
  16. onetick/py/_version.py +2 -0
  17. onetick/py/aggregations/__init__.py +11 -0
  18. onetick/py/aggregations/_base.py +645 -0
  19. onetick/py/aggregations/_docs.py +912 -0
  20. onetick/py/aggregations/compute.py +286 -0
  21. onetick/py/aggregations/functions.py +2216 -0
  22. onetick/py/aggregations/generic.py +104 -0
  23. onetick/py/aggregations/high_low.py +80 -0
  24. onetick/py/aggregations/num_distinct.py +83 -0
  25. onetick/py/aggregations/order_book.py +427 -0
  26. onetick/py/aggregations/other.py +1014 -0
  27. onetick/py/backports.py +26 -0
  28. onetick/py/cache.py +373 -0
  29. onetick/py/callback/__init__.py +5 -0
  30. onetick/py/callback/callback.py +275 -0
  31. onetick/py/callback/callbacks.py +131 -0
  32. onetick/py/compatibility.py +752 -0
  33. onetick/py/configuration.py +736 -0
  34. onetick/py/core/__init__.py +0 -0
  35. onetick/py/core/_csv_inspector.py +93 -0
  36. onetick/py/core/_internal/__init__.py +0 -0
  37. onetick/py/core/_internal/_manually_bound_value.py +6 -0
  38. onetick/py/core/_internal/_nodes_history.py +250 -0
  39. onetick/py/core/_internal/_op_utils/__init__.py +0 -0
  40. onetick/py/core/_internal/_op_utils/every_operand.py +9 -0
  41. onetick/py/core/_internal/_op_utils/is_const.py +10 -0
  42. onetick/py/core/_internal/_per_tick_scripts/tick_list_sort_template.script +121 -0
  43. onetick/py/core/_internal/_proxy_node.py +140 -0
  44. onetick/py/core/_internal/_state_objects.py +2307 -0
  45. onetick/py/core/_internal/_state_vars.py +87 -0
  46. onetick/py/core/_source/__init__.py +0 -0
  47. onetick/py/core/_source/_symbol_param.py +95 -0
  48. onetick/py/core/_source/schema.py +97 -0
  49. onetick/py/core/_source/source_methods/__init__.py +0 -0
  50. onetick/py/core/_source/source_methods/aggregations.py +810 -0
  51. onetick/py/core/_source/source_methods/applyers.py +296 -0
  52. onetick/py/core/_source/source_methods/columns.py +141 -0
  53. onetick/py/core/_source/source_methods/data_quality.py +301 -0
  54. onetick/py/core/_source/source_methods/debugs.py +270 -0
  55. onetick/py/core/_source/source_methods/drops.py +120 -0
  56. onetick/py/core/_source/source_methods/fields.py +619 -0
  57. onetick/py/core/_source/source_methods/filters.py +1001 -0
  58. onetick/py/core/_source/source_methods/joins.py +1393 -0
  59. onetick/py/core/_source/source_methods/merges.py +566 -0
  60. onetick/py/core/_source/source_methods/misc.py +1325 -0
  61. onetick/py/core/_source/source_methods/pandases.py +155 -0
  62. onetick/py/core/_source/source_methods/renames.py +356 -0
  63. onetick/py/core/_source/source_methods/sorts.py +183 -0
  64. onetick/py/core/_source/source_methods/switches.py +142 -0
  65. onetick/py/core/_source/source_methods/symbols.py +117 -0
  66. onetick/py/core/_source/source_methods/times.py +627 -0
  67. onetick/py/core/_source/source_methods/writes.py +702 -0
  68. onetick/py/core/_source/symbol.py +202 -0
  69. onetick/py/core/_source/tmp_otq.py +222 -0
  70. onetick/py/core/column.py +209 -0
  71. onetick/py/core/column_operations/__init__.py +0 -0
  72. onetick/py/core/column_operations/_methods/__init__.py +4 -0
  73. onetick/py/core/column_operations/_methods/_internal.py +28 -0
  74. onetick/py/core/column_operations/_methods/conversions.py +215 -0
  75. onetick/py/core/column_operations/_methods/methods.py +294 -0
  76. onetick/py/core/column_operations/_methods/op_types.py +150 -0
  77. onetick/py/core/column_operations/accessors/__init__.py +0 -0
  78. onetick/py/core/column_operations/accessors/_accessor.py +30 -0
  79. onetick/py/core/column_operations/accessors/decimal_accessor.py +92 -0
  80. onetick/py/core/column_operations/accessors/dt_accessor.py +464 -0
  81. onetick/py/core/column_operations/accessors/float_accessor.py +160 -0
  82. onetick/py/core/column_operations/accessors/str_accessor.py +1374 -0
  83. onetick/py/core/column_operations/base.py +1061 -0
  84. onetick/py/core/cut_builder.py +149 -0
  85. onetick/py/core/db_constants.py +20 -0
  86. onetick/py/core/eval_query.py +244 -0
  87. onetick/py/core/lambda_object.py +442 -0
  88. onetick/py/core/multi_output_source.py +193 -0
  89. onetick/py/core/per_tick_script.py +2253 -0
  90. onetick/py/core/query_inspector.py +465 -0
  91. onetick/py/core/source.py +1663 -0
  92. onetick/py/db/__init__.py +2 -0
  93. onetick/py/db/_inspection.py +1042 -0
  94. onetick/py/db/db.py +1423 -0
  95. onetick/py/db/utils.py +64 -0
  96. onetick/py/docs/__init__.py +0 -0
  97. onetick/py/docs/docstring_parser.py +112 -0
  98. onetick/py/docs/utils.py +81 -0
  99. onetick/py/functions.py +2354 -0
  100. onetick/py/license.py +188 -0
  101. onetick/py/log.py +88 -0
  102. onetick/py/math.py +947 -0
  103. onetick/py/misc.py +437 -0
  104. onetick/py/oqd/__init__.py +22 -0
  105. onetick/py/oqd/eps.py +1195 -0
  106. onetick/py/oqd/sources.py +325 -0
  107. onetick/py/otq.py +211 -0
  108. onetick/py/pyomd_mock.py +47 -0
  109. onetick/py/run.py +841 -0
  110. onetick/py/servers.py +173 -0
  111. onetick/py/session.py +1342 -0
  112. onetick/py/sources/__init__.py +19 -0
  113. onetick/py/sources/cache.py +167 -0
  114. onetick/py/sources/common.py +126 -0
  115. onetick/py/sources/csv.py +642 -0
  116. onetick/py/sources/custom.py +85 -0
  117. onetick/py/sources/data_file.py +305 -0
  118. onetick/py/sources/data_source.py +1049 -0
  119. onetick/py/sources/empty.py +94 -0
  120. onetick/py/sources/odbc.py +337 -0
  121. onetick/py/sources/order_book.py +238 -0
  122. onetick/py/sources/parquet.py +168 -0
  123. onetick/py/sources/pit.py +191 -0
  124. onetick/py/sources/query.py +495 -0
  125. onetick/py/sources/snapshots.py +419 -0
  126. onetick/py/sources/split_query_output_by_symbol.py +198 -0
  127. onetick/py/sources/symbology_mapping.py +123 -0
  128. onetick/py/sources/symbols.py +357 -0
  129. onetick/py/sources/ticks.py +825 -0
  130. onetick/py/sql.py +70 -0
  131. onetick/py/state.py +256 -0
  132. onetick/py/types.py +2056 -0
  133. onetick/py/utils/__init__.py +70 -0
  134. onetick/py/utils/acl.py +93 -0
  135. onetick/py/utils/config.py +186 -0
  136. onetick/py/utils/default.py +49 -0
  137. onetick/py/utils/file.py +38 -0
  138. onetick/py/utils/helpers.py +76 -0
  139. onetick/py/utils/locator.py +94 -0
  140. onetick/py/utils/perf.py +499 -0
  141. onetick/py/utils/query.py +49 -0
  142. onetick/py/utils/render.py +1139 -0
  143. onetick/py/utils/script.py +244 -0
  144. onetick/py/utils/temp.py +471 -0
  145. onetick/py/utils/types.py +118 -0
  146. onetick/py/utils/tz.py +82 -0
  147. onetick_py-1.162.2.dist-info/METADATA +148 -0
  148. onetick_py-1.162.2.dist-info/RECORD +152 -0
  149. onetick_py-1.162.2.dist-info/WHEEL +5 -0
  150. onetick_py-1.162.2.dist-info/entry_points.txt +2 -0
  151. onetick_py-1.162.2.dist-info/licenses/LICENSE +21 -0
  152. onetick_py-1.162.2.dist-info/top_level.txt +2 -0
onetick/py/__init__.py ADDED
@@ -0,0 +1,290 @@
1
+ # pylama:ignore=E402,W0611
2
+ import os
3
+ from . import _version
4
+ __version__ = _version.VERSION
5
+ __webapi__: bool = bool(os.getenv("OTP_WEBAPI", False))
6
+
7
+
8
+ def __validate_onetick_query_integration(): # noqa
9
+ """Logic that checks correctness of integration of python with onetick.query and/or onetick.query_webapi.
10
+ One of the modules should be installed and available to import.
11
+
12
+ We first try to import onetick.query and NumPy_OneTickQuery, and if it fails,
13
+ before raising an exception, we check if onetick.query_webapi is installed.
14
+ If it is installed, we set OTP_WEBAPI environment variable and avoid raising any exception/warning.
15
+ """
16
+ import os
17
+ global __webapi__
18
+
19
+ if os.getenv("OTP_SKIP_OTQ_VALIDATION", False):
20
+ return
21
+
22
+ _otq_import_ex = None
23
+
24
+ try:
25
+ # this import will fail if onetick python directory is not in sys.path
26
+ import onetick.query # noqa
27
+ try:
28
+ # this import will fail if numpy directory is not in sys.path on old OneTick versions
29
+ import NumPy_OneTickQuery
30
+ except ModuleNotFoundError as e:
31
+ _otq_import_ex = e
32
+ except Exception:
33
+ pass
34
+ except ImportError as e:
35
+ _otq_import_ex = e
36
+
37
+ import sysconfig
38
+
39
+ config_vars = sysconfig.get_config_vars()
40
+
41
+ ot_bin_path = os.path.join("bin")
42
+ ot_python_path = os.path.join(ot_bin_path, "python")
43
+ ot_numpy_path = os.path.join(
44
+ ot_bin_path,
45
+ "numpy",
46
+ "python"
47
+ # short python version 27, 36, 37, etc
48
+ + config_vars["py_version_nodot"]
49
+ # suffix at the end, either empty string for python with the standard memory allocator,
50
+ # or 'm' for python with the py-malloc allocator
51
+ + config_vars["abiflags"],
52
+ )
53
+
54
+ pythonpath = os.environ.get('PYTHONPATH')
55
+
56
+ missed_required = __get_missed_paths(pythonpath, ot_bin_path, ot_python_path)
57
+ missed_optional = __get_missed_paths(pythonpath, ot_numpy_path)
58
+
59
+ import warnings
60
+ if len(missed_required + missed_optional) != 3:
61
+ # TODO: move to onetick.py.compatibility
62
+ if _otq_import_ex is None and onetick.query.OneTickLib.get_build_number() >= 20230711120000:
63
+ warnings.warn(
64
+ 'Using PYTHONPATH to specify the location of OneTick python libraries is deprecated.'
65
+ ' Starting from OneTick build 20230711 onetick-py is also distributed as the part of the build,'
66
+ ' and it will override onetick-py you may have installed from pip.'
67
+ ' Use MAIN_ONE_TICK_DIR instead.'
68
+ )
69
+
70
+ try:
71
+ from .. import __search_main_one_tick_dir
72
+ main_one_tick_dirs = __search_main_one_tick_dir()
73
+ except ImportError:
74
+ # this exception will be raised if PYTHONPATH was used to specify the location of OneTick libraries
75
+ # and onetick-py doesn't exist in the specified OneTick or have older version than these lines
76
+ main_one_tick_dirs = None
77
+
78
+ if _otq_import_ex is None:
79
+ return
80
+
81
+ # webapi is installed to pip and OTP_WEBAPI=1, we don't need to raise any exception
82
+ try:
83
+ import onetick.query_webapi
84
+ __webapi__ = True
85
+ return
86
+ except ImportError:
87
+ print('onetick.query_webapi is not available')
88
+
89
+ if type(_otq_import_ex) is ImportError:
90
+ raise ImportError(
91
+ 'The above exception is probably raised '
92
+ 'because your python version is unsupported in this OneTick build'
93
+ ) from _otq_import_ex
94
+
95
+ # numpy directory is not needed on the latest onetick versions
96
+ # so checking it only if we couldn't import library
97
+ missed_paths = missed_required or missed_optional
98
+
99
+ if missed_paths or not main_one_tick_dirs:
100
+
101
+ if not missed_paths:
102
+ missed_paths = [ot_bin_path, ot_python_path, ot_numpy_path]
103
+
104
+ missed_paths = ', '.join(
105
+ "'" + os.path.join("<path-to-OneTick-dist>", p) + "'"
106
+ for p in missed_paths
107
+ )
108
+ if __webapi__:
109
+ raise ImportError(
110
+ "Environment variable OTP_WEBAPI is set, but we can't import onetick.query_webapi.\n"
111
+ "because we can't find it and related libraries.\n"
112
+ "Please, make sure you installed it with pip.\n"
113
+ "If you want to use OneTick distributed version\n"
114
+ f", make sure that directories {missed_paths} exist and:\n"
115
+ "- either those directories are specified in PYTHONPATH,\n"
116
+ "- or <path-to-OneTick-dist> directory is specified in MAIN_ONE_TICK_DIR (recommended)."
117
+ )
118
+
119
+ raise ImportError(
120
+ "We can't import onetick.query, because we can't find it and related libraries.\n"
121
+ f"Please, make sure that directories {missed_paths} exist and:\n"
122
+ "- either those directories are specified in PYTHONPATH,\n"
123
+ "- or <path-to-OneTick-dist> directory is specified in MAIN_ONE_TICK_DIR (recommended)."
124
+ ) from _otq_import_ex
125
+
126
+ raise _otq_import_ex
127
+
128
+
129
+ def __get_missed_paths(env, *paths, found_callback=None):
130
+ import os
131
+ from pathlib import Path
132
+
133
+ missed_paths = []
134
+ env = env or ''
135
+ global_python_path = env.split(os.pathsep)
136
+ for p in paths:
137
+ match = False
138
+ for gb in global_python_path:
139
+ if Path(gb).match(f"*/{p}"):
140
+ match = True
141
+ if found_callback:
142
+ found_callback(gb, p)
143
+ break
144
+ if not match:
145
+ missed_paths.append(p)
146
+ return missed_paths
147
+
148
+
149
+ def __set_onetick_path_variables():
150
+ import os
151
+ global __webapi__
152
+ if __webapi__ or os.getenv("OTP_SKIP_OTQ_VALIDATION", False):
153
+ return
154
+ import warnings
155
+ import onetick.query as otq
156
+ from pathlib import Path
157
+
158
+ onetick_query_init = Path(otq.__file__)
159
+
160
+ global __main_one_tick_dir__, __one_tick_bin_dir__, __one_tick_python_dir__
161
+ __one_tick_python_dir__ = str(onetick_query_init.parents[2])
162
+ __one_tick_bin_dir__ = str(onetick_query_init.parents[3])
163
+ __main_one_tick_dir__ = str(onetick_query_init.parents[4])
164
+
165
+ if os.name == 'nt' and __one_tick_bin_dir__ not in os.environ.get('PATH', '').split(os.pathsep):
166
+ warnings.warn(
167
+ f'OneTick {__one_tick_bin_dir__} is not specified in PATH environment variable.'
168
+ ' Some functionality, e.g. using per-tick script, may be unavailable in this case.'
169
+ )
170
+
171
+
172
+ __validate_onetick_query_integration()
173
+ __set_onetick_path_variables()
174
+
175
+ # -------------------------------------------- #
176
+
177
+ from ._stack_info import _modify_stack_info_in_onetick_query
178
+ _modify_stack_info_in_onetick_query()
179
+
180
+ # -------------------------------------------- #
181
+
182
+ from onetick.py import functions, aggregations
183
+ from onetick.py.functions import (
184
+ concat, join, join_by_time, apply_query, apply, cut, qcut, merge, coalesce, corp_actions, format,
185
+ join_with_aggregated_window
186
+ )
187
+ from onetick.py.types import (
188
+ msectime, nsectime, string, nan, inf, datetime, date, dt, varstring,
189
+ _int as int, uint, long, ulong, byte, short, decimal,
190
+ Year, Quarter, Month, Week, Day, Hour, Minute, Second, Milli, Nano,
191
+ default_by_type, timedelta,
192
+ )
193
+ from onetick.py.sources import (Tick, TTicks, Ticks, Orders, Trades, NBBO, Quotes, Query, CSV, ReadCache, ReadParquet,
194
+ Custom, query, Symbols, Empty, DataSource, LocalCSVTicks, SymbologyMapping,
195
+ ObSnapshot, ObSnapshotWide, ObSnapshotFlat, ObSummary, ObSize, ObVwap, ObNumLevels,
196
+ by_symbol, ODBC, SplitQueryOutputBySymbol, DataFile, PointInTime,
197
+ ReadSnapshot, ShowSnapshotList, FindSnapshotSymbols)
198
+ from onetick.py.utils import adaptive, range, perf
199
+ from onetick.py.core.eval_query import eval
200
+ from onetick.py.session import Session, TestSession, Config, Locator, HTTPSession
201
+ from onetick.py.servers import RemoteTS, LoadBalancing, FaultTolerance
202
+ from onetick.py.db import DB, RefDB
203
+ from onetick.py.db._inspection import databases, derived_databases
204
+ from onetick.py.cache import create_cache, delete_cache, modify_cache_config
205
+ from onetick.py import state
206
+ from onetick.py.core.source import Source, MetaFields
207
+ from onetick.py.core.multi_output_source import MultiOutputSource
208
+ from onetick.py.core.eval_query import eval # noqa: it is ok to redefine built-in function
209
+ from onetick.py.core.per_tick_script import (
210
+ # TODO: wanna access per_tick_script classes as otp.script.static and so on
211
+ Static as static,
212
+ TickDescriptorFields as tick_descriptor_fields,
213
+ tick_list_tick,
214
+ tick_set_tick,
215
+ tick_deque_tick,
216
+ dynamic_tick,
217
+ )
218
+ from onetick.py.callback import CallbackBase
219
+ from onetick.py.sql import SqlQuery
220
+ from onetick.py.run import run
221
+ from onetick.py.math import rand, now
222
+ from onetick.py.misc import bit_and, bit_or, bit_at, bit_xor, bit_not, hash_code, get_symbology_mapping
223
+ from onetick.py.core.column import Column
224
+ from onetick.py.core.column_operations.base import Operation, Expr as expr, Raw as raw, OnetickParameter as param
225
+ from onetick.py.core.per_tick_script import remote, Once, once, logf, throw_exception
226
+ from onetick.py.configuration import config
227
+ from onetick.py import oqd
228
+ from onetick.py.otq import otli
229
+ OneTickLib = otli.OneTickLib
230
+
231
+ try:
232
+ from pandas import date_range
233
+ except Exception:
234
+ pass
235
+
236
+ meta_fields = MetaFields()
237
+
238
+
239
+ def __getattr__(name):
240
+ # actually, these values are not evaluated on module loading anymore,
241
+ # so they can be used without fear
242
+ # but let's raise deprecation warning anyway
243
+ # to encourage users to use otp.config only
244
+ defaults = dict(
245
+ # lambdas are needed in case some config values are not set,
246
+ # so we don't raise exception on getting any attribute
247
+ DEFAULT_START_TIME=lambda: config.default_start_time,
248
+ DEFAULT_END_TIME=lambda: config.default_end_time,
249
+ DEFAULT_TZ=lambda: config.tz,
250
+ DEFAULT_SYMBOL=lambda: config.default_symbol,
251
+ DEFAULT_DB=lambda: config.default_db,
252
+ DEFAULT_DB_SYMBOL=lambda: config.default_db_symbol,
253
+ )
254
+ if name in defaults:
255
+ import warnings
256
+ warnings.warn(
257
+ f'Using otp.{name} is deprecated, use otp.config.* properties instead.',
258
+ FutureWarning
259
+ )
260
+ return defaults[name]()
261
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
262
+
263
+
264
+ # aliases
265
+ funcs = functions # type: ignore # noqa
266
+ agg = aggregations # type: ignore # noqa
267
+
268
+
269
+ # set pandas default pandas options to show all columns
270
+ import pandas as _pd
271
+
272
+ _pd.set_option("display.max_columns", None)
273
+ _pd.set_option("display.expand_frame_repr", False)
274
+ _pd.set_option("max_colwidth", None)
275
+
276
+
277
+ from onetick.py.otq import otq as _otq
278
+ try:
279
+ __build__ = str(_otq.OneTickLib.get_build_number())
280
+ except AttributeError:
281
+ __build__ = 'webapi'
282
+
283
+ # initialize logger module and import public api
284
+ from .log import get_logger
285
+
286
+ del (_version,
287
+ _otq,
288
+ _pd,
289
+ _modify_stack_info_in_onetick_query,
290
+ otli)
@@ -0,0 +1,89 @@
1
+ import os
2
+ import traceback
3
+ from typing import List
4
+
5
+ from .configuration import config
6
+
7
+
8
+ # dictionary to save traceback lines
9
+ _TRACE_LINES = {}
10
+ # dictionary to save traceback tuples
11
+ _TRACE_TUPLES = {}
12
+
13
+
14
+ def _get_id_with_traceback(tb_list: List[str]) -> str:
15
+ """
16
+ Save traceback in some memory-efficient way
17
+ and return unique id of the traceback.
18
+ """
19
+ trace_list = []
20
+ for line in tb_list:
21
+ if line not in _TRACE_LINES:
22
+ # using the same string objects for different tracebacks
23
+ _TRACE_LINES[line] = line
24
+ trace_list.append(_TRACE_LINES[line])
25
+
26
+ trace_tuple = tuple(trace_list)
27
+ trace_hash = str(hash(trace_tuple))
28
+ if trace_hash not in _TRACE_TUPLES:
29
+ # using the same tuple objects for different tracebacks
30
+ _TRACE_TUPLES[trace_hash] = trace_tuple
31
+ return trace_hash
32
+
33
+
34
+ def _get_traceback_with_id(trace_hash: str) -> str:
35
+ """
36
+ Get our custom saved traceback from dictionary by hash.
37
+ """
38
+ return ''.join(_TRACE_TUPLES[trace_hash])
39
+
40
+
41
+ def _modify_stack_info_in_onetick_query():
42
+ """
43
+ Change stack_info parameter in all OneTick's event processors.
44
+ Save full traceback instead of filename + line number.
45
+ """
46
+
47
+ def modify_init(cls):
48
+ old_init = cls.__init__
49
+
50
+ def new_init(self, *args, **kwargs):
51
+ old_init(self, *args, **kwargs)
52
+ if config.show_stack_info and hasattr(self, 'stack_info'):
53
+ self.stack_info = _get_id_with_traceback(traceback.format_stack()[:-1])
54
+
55
+ cls.__init__ = new_init
56
+
57
+ from onetick.py.otq import otq
58
+ eps_classes = (
59
+ cls for cls in otq.__dict__.values()
60
+ if isinstance(cls, type) and issubclass(cls, otq.EpBase) and cls is not otq.EpBase
61
+ )
62
+ for ep_cls in eps_classes:
63
+ modify_init(ep_cls)
64
+
65
+
66
+ def _add_stack_info_to_exception(exc):
67
+ """
68
+ Find stack_info parameter in OneTick exception message.
69
+ Get stack trace and append it to the passed exception.
70
+ """
71
+ if not config.show_stack_info:
72
+ return exc
73
+
74
+ _, _, location_details = str(exc).partition('Problem location details:')
75
+ stack_info_uuid = None
76
+ for block in location_details.strip().split(','):
77
+ name, _, value = block.partition('=')
78
+ if name == 'stack_info':
79
+ stack_info_uuid = value
80
+ break
81
+
82
+ if not stack_info_uuid:
83
+ return exc
84
+
85
+ stack_info = _get_traceback_with_id(stack_info_uuid)
86
+
87
+ if exc.args:
88
+ exc.args = (exc.args[0] + os.linesep + stack_info, *exc.args[1:])
89
+ return exc
onetick/py/_version.py ADDED
@@ -0,0 +1,2 @@
1
+ # This file was generated automatically. DO NOT CHANGE.
2
+ VERSION = '1.162.2'
@@ -0,0 +1,11 @@
1
+ from .functions import (compute, max, min, high_tick, low_tick, high_time, low_time, first, last, first_time, last_time,
2
+ count, vwap, first_tick, last_tick, distinct, sum, average, mean, stddev, tw_average, median,
3
+ ob_num_levels, ob_size, ob_snapshot, ob_snapshot_wide, ob_snapshot_flat, ob_summary, ob_vwap,
4
+ generic, correlation, option_price, ranking, variance, percentile, find_value_for_percentile,
5
+ exp_w_average, exp_tw_average, standardized_moment, portfolio_price, multi_portfolio_price,
6
+ return_ep, implied_vol, linear_regression)
7
+
8
+ try:
9
+ from .num_distinct import num_distinct
10
+ except ImportError:
11
+ pass