onetick-py 1.164.0__py3-none-any.whl → 1.165.0__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.
- onetick/py/_version.py +1 -1
- onetick/py/core/source.py +71 -1
- onetick/py/utils/render.py +12 -3
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/METADATA +3 -3
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/RECORD +9 -9
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/WHEEL +0 -0
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/entry_points.txt +0 -0
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/licenses/LICENSE +0 -0
- {onetick_py-1.164.0.dist-info → onetick_py-1.165.0.dist-info}/top_level.txt +0 -0
onetick/py/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# This file was generated automatically. DO NOT CHANGE.
|
|
2
|
-
VERSION = '1.
|
|
2
|
+
VERSION = '1.165.0'
|
onetick/py/core/source.py
CHANGED
|
@@ -24,7 +24,7 @@ from onetick.py.core._source.tmp_otq import TmpOtq
|
|
|
24
24
|
from onetick.py.core.column import _Column
|
|
25
25
|
from onetick.py.core.column_operations.base import _Operation, OnetickParameter
|
|
26
26
|
from onetick.py.core.query_inspector import get_query_parameter_list
|
|
27
|
-
from onetick.py.utils import adaptive, adaptive_to_default, default
|
|
27
|
+
from onetick.py.utils import adaptive, adaptive_to_default, default, render_otq
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def _is_dict_required(symbols):
|
|
@@ -939,6 +939,76 @@ class Source:
|
|
|
939
939
|
kwargs.setdefault('verbose', True)
|
|
940
940
|
self.to_graph().render(**kwargs)
|
|
941
941
|
|
|
942
|
+
def render_otq(
|
|
943
|
+
self,
|
|
944
|
+
image_path: Optional[str] = None,
|
|
945
|
+
output_format: Optional[str] = None,
|
|
946
|
+
load_external_otqs: bool = True,
|
|
947
|
+
view: bool = False,
|
|
948
|
+
line_limit: Optional[Tuple[int, int]] = (10, 30),
|
|
949
|
+
parse_eval_from_params: bool = False,
|
|
950
|
+
debug: bool = False,
|
|
951
|
+
**kwargs,
|
|
952
|
+
):
|
|
953
|
+
"""
|
|
954
|
+
Render current :py:class:`~onetick.py.Source` graph.
|
|
955
|
+
|
|
956
|
+
Parameters
|
|
957
|
+
----------
|
|
958
|
+
image_path: str, None
|
|
959
|
+
Path for generated image. If omitted, image will be saved in a temp dir
|
|
960
|
+
output_format: str, None
|
|
961
|
+
`Graphviz` rendering format. Default: `png`.
|
|
962
|
+
If `image_path` contains one of next extensions, `output_format` will be set automatically:
|
|
963
|
+
`png`, `svg`, `dot`.
|
|
964
|
+
load_external_otqs: bool
|
|
965
|
+
If set to `True` (default) dependencies from external .otq files (not listed in ``path`` param)
|
|
966
|
+
will be loaded automatically.
|
|
967
|
+
view: bool
|
|
968
|
+
Defines should generated image be shown after render.
|
|
969
|
+
line_limit: Tuple[int, int], None
|
|
970
|
+
Limit for maximum number of lines and length of some EP parameters strings.
|
|
971
|
+
First param is limit of lines, second - limit of characters in each line.
|
|
972
|
+
If set to None limit disabled.
|
|
973
|
+
If one of tuple values set to zero the corresponding limit disabled.
|
|
974
|
+
parse_eval_from_params: bool
|
|
975
|
+
Enable parsing and printing `eval` sub-queries from EP parameters.
|
|
976
|
+
debug: bool
|
|
977
|
+
Allow to print stdout or stderr from `Graphviz` render.
|
|
978
|
+
kwargs:
|
|
979
|
+
Additional arguments to be passed to :py:meth:`onetick.py.Source.to_otq` method (except
|
|
980
|
+
``file_name``, ``file_suffix`` and ``query_name`` parameters)
|
|
981
|
+
|
|
982
|
+
Returns
|
|
983
|
+
-------
|
|
984
|
+
Path to rendered image
|
|
985
|
+
|
|
986
|
+
See also
|
|
987
|
+
--------
|
|
988
|
+
:py:func:`render_otq <onetick.py.utils.render_otq>`
|
|
989
|
+
|
|
990
|
+
Examples
|
|
991
|
+
--------
|
|
992
|
+
|
|
993
|
+
>>> data = otp.DataSource(db='US_COMP', tick_type='TRD', symbols='AAA') # doctest: +SKIP
|
|
994
|
+
>>> data1, data2 = data[(data['PRICE'] > 50)] # doctest: +SKIP
|
|
995
|
+
>>> data = otp.merge([data1, data2]) # doctest: +SKIP
|
|
996
|
+
>>> data.render_otq('./path/to/image.png') # doctest: +SKIP
|
|
997
|
+
|
|
998
|
+
.. image:: ../../static/testing/images/render_otq_3.png
|
|
999
|
+
"""
|
|
1000
|
+
|
|
1001
|
+
if {'file_name', 'file_suffix', 'query_name'} & kwargs.keys():
|
|
1002
|
+
raise ValueError(
|
|
1003
|
+
'It\'s not allowed to pass parameters `file_name`, `file_suffix` and `query_name` as `kwargs` '
|
|
1004
|
+
'in `render_otq` method.'
|
|
1005
|
+
)
|
|
1006
|
+
|
|
1007
|
+
otq_path = self.to_otq(**kwargs)
|
|
1008
|
+
return render_otq(
|
|
1009
|
+
otq_path, image_path, output_format, load_external_otqs, view, line_limit, parse_eval_from_params, debug,
|
|
1010
|
+
)
|
|
1011
|
+
|
|
942
1012
|
def copy(self, ep=None, columns=None, deep=False) -> 'Source':
|
|
943
1013
|
"""
|
|
944
1014
|
Build an object with copied calculation graph.
|
onetick/py/utils/render.py
CHANGED
|
@@ -20,6 +20,7 @@ EPS_WITH_QUERIES = {
|
|
|
20
20
|
"modify_state_var_from_query": (1, "otq_query"),
|
|
21
21
|
"create_cache": (1, "otq_file_path"),
|
|
22
22
|
"read_cache": (4, "create_cache_query"),
|
|
23
|
+
"generic_aggregation": (0, "query_name"),
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
IF_ELSE_EPS = {
|
|
@@ -1018,10 +1019,10 @@ def render_otq(
|
|
|
1018
1019
|
`Graphviz` rendering format. Default: `png`.
|
|
1019
1020
|
If `image_path` contains one of next extensions, `output_format` will be set automatically: `png`, `svg`, `dot`.
|
|
1020
1021
|
load_external_otqs: bool
|
|
1021
|
-
If set to `True` (default) dependencies from external .otq files (not listed in
|
|
1022
|
+
If set to `True` (default) dependencies from external .otq files (not listed in ``path`` param)
|
|
1022
1023
|
will be loaded automatically.
|
|
1023
1024
|
view: bool
|
|
1024
|
-
Defines should generated image be
|
|
1025
|
+
Defines should generated image be shown after render.
|
|
1025
1026
|
line_limit: Tuple[int, int], None
|
|
1026
1027
|
Limit for maximum number of lines and length of some EP parameters strings.
|
|
1027
1028
|
First param is limit of lines, second - limit of characters in each line.
|
|
@@ -1030,7 +1031,11 @@ def render_otq(
|
|
|
1030
1031
|
parse_eval_from_params: bool
|
|
1031
1032
|
Enable parsing and printing `eval` sub-queries from EP parameters.
|
|
1032
1033
|
debug: bool
|
|
1033
|
-
Allow to print stdout or stderr from `
|
|
1034
|
+
Allow to print stdout or stderr from `Graphviz` render.
|
|
1035
|
+
|
|
1036
|
+
Returns
|
|
1037
|
+
-------
|
|
1038
|
+
Path to rendered image
|
|
1034
1039
|
|
|
1035
1040
|
Examples
|
|
1036
1041
|
--------
|
|
@@ -1039,10 +1044,14 @@ def render_otq(
|
|
|
1039
1044
|
|
|
1040
1045
|
>>> otp.utils.render_otq("./test.otq") # doctest: +SKIP
|
|
1041
1046
|
|
|
1047
|
+
.. image:: ../../static/testing/images/render_otq_1.png
|
|
1048
|
+
|
|
1042
1049
|
Render multiple files:
|
|
1043
1050
|
|
|
1044
1051
|
>>> otp.utils.render_otq(["./first.otq", "./second.otq"]) # doctest: +SKIP
|
|
1045
1052
|
|
|
1053
|
+
.. image:: ../../static/testing/images/render_otq_2.png
|
|
1054
|
+
|
|
1046
1055
|
Render specific queries from multiple files:
|
|
1047
1056
|
|
|
1048
1057
|
>>> otp.utils.render_otq(["./first.otq", "./second.otq::some_query"]) # doctest: +SKIP
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onetick-py
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.165.0
|
|
4
4
|
Summary: Python package that allows you to work with OneTick
|
|
5
5
|
Author-email: solutions <solutions@onetick.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,14 +8,14 @@ Project-URL: Documentation, https://docs.pip.distribution.sol.onetick.com
|
|
|
8
8
|
Project-URL: OneTick, https://onetick.com/
|
|
9
9
|
Classifier: Topic :: Database :: Front-Ends
|
|
10
10
|
Classifier: Topic :: Scientific/Engineering
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
17
17
|
Classifier: Environment :: Console
|
|
18
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: pandas==1.1.5; python_version == "3.6"
|
|
@@ -13,7 +13,7 @@ onetick/lib/__init__.py,sha256=Rp7CIDoA4E6LIm1f2mNvl_5b_n-0U3suA3FmBXbmKoU,114
|
|
|
13
13
|
onetick/lib/instance.py,sha256=Fn3yoowjBtImAhR6n-f-Ti5J1q-RdDI-EGLpZvNwTi4,4773
|
|
14
14
|
onetick/py/__init__.py,sha256=j2WBnhu01i8VdOYkn9BGc-7JeAqXQoCFjVfXFZCSz-4,10950
|
|
15
15
|
onetick/py/_stack_info.py,sha256=PHZOkW_fK7Fbl4YEj5CaYK9L6vh4j-bUU7_cSYOWZ30,2546
|
|
16
|
-
onetick/py/_version.py,sha256=
|
|
16
|
+
onetick/py/_version.py,sha256=SnHwTlsfIDaXromEXCs1EwviFRUhLjLkAqleAcGSiho,76
|
|
17
17
|
onetick/py/backports.py,sha256=mR00mxe7E7UgBljf-Wa93Mo6lpi-C4Op561uhPUoEt8,815
|
|
18
18
|
onetick/py/cache.py,sha256=f9WwFFCTqCP3eaA4V57tNPjCBHNPzU8ZvH81IuUsBE8,12756
|
|
19
19
|
onetick/py/compatibility.py,sha256=KUBRyt_VayU7UnssXe2q_jOQoqCA4-HwIvUSDl9Xn1M,29696
|
|
@@ -54,7 +54,7 @@ onetick/py/core/lambda_object.py,sha256=ayob_2c2XYSG7vFsqp-2b9FSPD-3TFReLbx3de3t
|
|
|
54
54
|
onetick/py/core/multi_output_source.py,sha256=i9mxtM3yIF30hsVZ-6XttU407VmHklCdPjNDabgB374,7769
|
|
55
55
|
onetick/py/core/per_tick_script.py,sha256=thuNKR4T6v5vxADLaX4ldTAHo_Yvt5HCHGIrNMEK6z8,83237
|
|
56
56
|
onetick/py/core/query_inspector.py,sha256=Jwnw7qUVvjvaT63mQ5PkUSy8x36knoxWrNll3aXuLZw,16440
|
|
57
|
-
onetick/py/core/source.py,sha256=
|
|
57
|
+
onetick/py/core/source.py,sha256=AX4DUK1frV_FUCG5sywsn42xYX7Y2sYC7vMCOq6TeRg,63998
|
|
58
58
|
onetick/py/core/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
59
|
onetick/py/core/_internal/_manually_bound_value.py,sha256=a4JF63g9MtXsIwpDqm_PCLBH51_SaG1-T6jWV5-IJ1k,191
|
|
60
60
|
onetick/py/core/_internal/_nodes_history.py,sha256=fCpJ4FWFDzM-bmi-YyCHmNYuFM-CL_lE2bXySOi-TPY,7194
|
|
@@ -139,14 +139,14 @@ onetick/py/utils/helpers.py,sha256=XY2PaMUSzFNIpiuiAY_gPQ0TnYTmfoPAGNAFh_6aB14,2
|
|
|
139
139
|
onetick/py/utils/locator.py,sha256=YUOXU0yh0ZZZOJpJniAq9WNn0_u3X_M5q2tEwt1cp_4,2887
|
|
140
140
|
onetick/py/utils/perf.py,sha256=g0r-9YUc2mx9Lj4PjG6Fk1keO3m9nC3t2cpHx3M-AeQ,19299
|
|
141
141
|
onetick/py/utils/query.py,sha256=b60JmfJDx3mpP74rTQC3qnlCb6t4fYFEauVaH9ulwL8,1330
|
|
142
|
-
onetick/py/utils/render.py,sha256=
|
|
142
|
+
onetick/py/utils/render.py,sha256=UpN8XTRnbRY62INUs5ydN2neSx2Abtw8pHaOLUByDD4,37819
|
|
143
143
|
onetick/py/utils/script.py,sha256=Y8NujEo2_5QaP6KDnLKJiKQ7SmMjw8_dv8sYL9rHDCE,11184
|
|
144
144
|
onetick/py/utils/temp.py,sha256=j-BC155dE46k0zfKTTs26KTF0CK6WA1hO2GD54iunyM,17380
|
|
145
145
|
onetick/py/utils/types.py,sha256=_tYf66r9JVgjtiCJfxIxrg_BQEjHkjlnck_i86dBYEY,3606
|
|
146
146
|
onetick/py/utils/tz.py,sha256=QXclESLGU8YXysUT9DXkcBqLWWO47Bb_tanFUzYpPZI,2800
|
|
147
|
-
onetick_py-1.
|
|
148
|
-
onetick_py-1.
|
|
149
|
-
onetick_py-1.
|
|
150
|
-
onetick_py-1.
|
|
151
|
-
onetick_py-1.
|
|
152
|
-
onetick_py-1.
|
|
147
|
+
onetick_py-1.165.0.dist-info/licenses/LICENSE,sha256=Yhu7lKNFS0fsaN-jSattEMRtCOPueP58Eu5BPH8ZGjM,1075
|
|
148
|
+
onetick_py-1.165.0.dist-info/METADATA,sha256=_-jvj9sP16Sa4ntC0CSqpmEG6jI3WRPFZDtboiEHadU,7960
|
|
149
|
+
onetick_py-1.165.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
150
|
+
onetick_py-1.165.0.dist-info/entry_points.txt,sha256=QmK_tFswIN-SQRmtnTSBEi8GvT0TVq-66IzXXZIsV3U,81
|
|
151
|
+
onetick_py-1.165.0.dist-info/top_level.txt,sha256=Na1jSJmVMyYGOndaswt554QKIUwQjcYh6th2ATsmw0U,23
|
|
152
|
+
onetick_py-1.165.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|