pixeltable 0.2.28__py3-none-any.whl → 0.2.30__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.
Potentially problematic release.
This version of pixeltable might be problematic. Click here for more details.
- pixeltable/__init__.py +1 -1
- pixeltable/__version__.py +2 -2
- pixeltable/catalog/__init__.py +1 -1
- pixeltable/catalog/dir.py +6 -0
- pixeltable/catalog/globals.py +25 -0
- pixeltable/catalog/named_function.py +4 -0
- pixeltable/catalog/path_dict.py +37 -11
- pixeltable/catalog/schema_object.py +6 -0
- pixeltable/catalog/table.py +96 -19
- pixeltable/catalog/table_version.py +22 -8
- pixeltable/dataframe.py +201 -3
- pixeltable/env.py +9 -3
- pixeltable/exec/expr_eval_node.py +1 -1
- pixeltable/exec/sql_node.py +2 -2
- pixeltable/exprs/function_call.py +134 -29
- pixeltable/exprs/inline_expr.py +22 -2
- pixeltable/exprs/row_builder.py +1 -1
- pixeltable/exprs/similarity_expr.py +9 -2
- pixeltable/func/__init__.py +1 -0
- pixeltable/func/aggregate_function.py +151 -68
- pixeltable/func/callable_function.py +50 -16
- pixeltable/func/expr_template_function.py +62 -24
- pixeltable/func/function.py +191 -23
- pixeltable/func/function_registry.py +2 -1
- pixeltable/func/query_template_function.py +11 -6
- pixeltable/func/signature.py +64 -7
- pixeltable/func/tools.py +116 -0
- pixeltable/func/udf.py +57 -35
- pixeltable/functions/__init__.py +2 -2
- pixeltable/functions/anthropic.py +36 -2
- pixeltable/functions/globals.py +54 -34
- pixeltable/functions/json.py +3 -8
- pixeltable/functions/math.py +67 -0
- pixeltable/functions/ollama.py +4 -4
- pixeltable/functions/openai.py +31 -2
- pixeltable/functions/timestamp.py +1 -1
- pixeltable/functions/video.py +2 -8
- pixeltable/functions/vision.py +1 -1
- pixeltable/globals.py +347 -79
- pixeltable/index/embedding_index.py +44 -24
- pixeltable/metadata/__init__.py +1 -1
- pixeltable/metadata/converters/convert_16.py +2 -1
- pixeltable/metadata/converters/convert_17.py +2 -1
- pixeltable/metadata/converters/convert_23.py +35 -0
- pixeltable/metadata/converters/convert_24.py +47 -0
- pixeltable/metadata/converters/util.py +4 -2
- pixeltable/metadata/notes.py +2 -0
- pixeltable/metadata/schema.py +1 -0
- pixeltable/type_system.py +192 -48
- {pixeltable-0.2.28.dist-info → pixeltable-0.2.30.dist-info}/METADATA +4 -2
- {pixeltable-0.2.28.dist-info → pixeltable-0.2.30.dist-info}/RECORD +54 -57
- pixeltable-0.2.30.dist-info/entry_points.txt +3 -0
- pixeltable/tool/create_test_db_dump.py +0 -311
- pixeltable/tool/create_test_video.py +0 -81
- pixeltable/tool/doc_plugins/griffe.py +0 -50
- pixeltable/tool/doc_plugins/mkdocstrings.py +0 -6
- pixeltable/tool/doc_plugins/templates/material/udf.html.jinja +0 -135
- pixeltable/tool/embed_udf.py +0 -9
- pixeltable/tool/mypy_plugin.py +0 -55
- pixeltable-0.2.28.dist-info/entry_points.txt +0 -3
- {pixeltable-0.2.28.dist-info → pixeltable-0.2.30.dist-info}/LICENSE +0 -0
- {pixeltable-0.2.28.dist-info → pixeltable-0.2.30.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pixeltable
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.30
|
|
4
4
|
Summary: AI Data Infrastructure: Declarative, Multimodal, and Incremental
|
|
5
5
|
Home-page: https://pixeltable.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -29,16 +29,18 @@ Requires-Dist: cloudpickle (>=2.2.1,<3.0.0)
|
|
|
29
29
|
Requires-Dist: ftfy (>=6.2.0,<7.0.0)
|
|
30
30
|
Requires-Dist: jinja2 (>=3.1.3,<4.0.0)
|
|
31
31
|
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
|
|
32
|
+
Requires-Dist: jsonschema (>=4.1.0)
|
|
32
33
|
Requires-Dist: lxml (>=5.0)
|
|
33
34
|
Requires-Dist: more-itertools (>=10.2,<11.0)
|
|
34
35
|
Requires-Dist: numpy (>=1.25,<2.0)
|
|
35
36
|
Requires-Dist: pandas (>=2.0,<3.0)
|
|
36
37
|
Requires-Dist: pgvector (>=0.2.1,<0.3.0)
|
|
37
38
|
Requires-Dist: pillow (>=9.3.0)
|
|
38
|
-
Requires-Dist: pixeltable-pgserver (==0.2.
|
|
39
|
+
Requires-Dist: pixeltable-pgserver (==0.2.9)
|
|
39
40
|
Requires-Dist: psutil (>=5.9.5,<6.0.0)
|
|
40
41
|
Requires-Dist: psycopg[binary] (>=3.1.18)
|
|
41
42
|
Requires-Dist: puremagic (>=1.20)
|
|
43
|
+
Requires-Dist: pydantic (>=2.7.4)
|
|
42
44
|
Requires-Dist: pymupdf (>=1.24.1,<2.0.0)
|
|
43
45
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
44
46
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
pixeltable/__init__.py,sha256=
|
|
2
|
-
pixeltable/__version__.py,sha256=
|
|
3
|
-
pixeltable/catalog/__init__.py,sha256=
|
|
1
|
+
pixeltable/__init__.py,sha256=A711Bh7Ew071NB80_QB-G8U3MCzE8c_Eie4Eze5oTU0,1404
|
|
2
|
+
pixeltable/__version__.py,sha256=KcLib9jD_4YKaDT35NWGIWWIsVEcFCuYxeR4qAISynA,114
|
|
3
|
+
pixeltable/catalog/__init__.py,sha256=u8Ods4ncTY7DI5w0jyHVC0QDVDLHAy8Rqia3qsM5OH8,517
|
|
4
4
|
pixeltable/catalog/catalog.py,sha256=tyDyI5wQw7vV6_FChrp9qgGCRClcjiSdW3eygYT0p9s,7849
|
|
5
5
|
pixeltable/catalog/column.py,sha256=ezeKoGl6aBTzSZBihDA6vdETcvyCguAD4OsmrxWs73A,9595
|
|
6
|
-
pixeltable/catalog/dir.py,sha256
|
|
7
|
-
pixeltable/catalog/globals.py,sha256=
|
|
6
|
+
pixeltable/catalog/dir.py,sha256=-dV0-gn5GfqRmVIJbuUBOXqPuNLDm219cud_kBTNzuk,1203
|
|
7
|
+
pixeltable/catalog/globals.py,sha256=VgcmwtKYYDQtvtHShVde52n4FzGBtAIFYxoS-WD7OBw,3242
|
|
8
8
|
pixeltable/catalog/insertable_table.py,sha256=hOsdYhkhtRcDOrRkweIGFUfjweWF3fLUErkUTlGYoSU,7172
|
|
9
|
-
pixeltable/catalog/named_function.py,sha256=
|
|
9
|
+
pixeltable/catalog/named_function.py,sha256=cWf9WxAagSY9uqE7mM0IwWSsDOvQUkJlcHlGqgVciJg,1225
|
|
10
10
|
pixeltable/catalog/path.py,sha256=QgccEi_QOfaKt8YsR2zLtd_z7z7QQkU_1kprJFi2SPQ,1677
|
|
11
|
-
pixeltable/catalog/path_dict.py,sha256=
|
|
12
|
-
pixeltable/catalog/schema_object.py,sha256=
|
|
13
|
-
pixeltable/catalog/table.py,sha256=
|
|
14
|
-
pixeltable/catalog/table_version.py,sha256=
|
|
11
|
+
pixeltable/catalog/path_dict.py,sha256=V7YQM0QhUWr4FbgUiDUIweGbmMJr687QCm2p614Xrs0,6473
|
|
12
|
+
pixeltable/catalog/schema_object.py,sha256=NUE6Fx6Km0UUJ6WcE9mOgL2UQCLBMQjINQLp_mljzKA,2382
|
|
13
|
+
pixeltable/catalog/table.py,sha256=ePJkkQnQIthCFhsxtH2HU-gbefduJt54l-OV_fWAv7I,58738
|
|
14
|
+
pixeltable/catalog/table_version.py,sha256=hbnAtd-0EsVFCuWE1yrmm_CLar6NNQDRevgDjduh2CY,58581
|
|
15
15
|
pixeltable/catalog/table_version_path.py,sha256=CczGbcz5ESq663arreri_p4chMZHozgG6k3y-ajkJN4,5787
|
|
16
16
|
pixeltable/catalog/view.py,sha256=mJbaVE63GaBDy7EcQkQ2q5NKlrHlGyENkRyQVzU-ak8,10854
|
|
17
|
-
pixeltable/dataframe.py,sha256
|
|
18
|
-
pixeltable/env.py,sha256=
|
|
17
|
+
pixeltable/dataframe.py,sha256=-jByrlncEV7ns_pChPGpBhcTf1sU4mp1OJB7uX9HlXE,48199
|
|
18
|
+
pixeltable/env.py,sha256=RNUzaLMeEIpCYlReMS_s3yY55h8DA41x33uRvcv_o70,31267
|
|
19
19
|
pixeltable/exceptions.py,sha256=NuFY2WtkQpLfLHT_J70kOw9Tr0kEDkkgo-u7As4Gaq4,410
|
|
20
20
|
pixeltable/exec/__init__.py,sha256=bWbIA7U7y1hC40VOSv_p9doaMuOB0i3r1O2UFNw0VEs,494
|
|
21
21
|
pixeltable/exec/aggregation_node.py,sha256=0LdoPp_CR_UbcS60XkDw66SqlrQnw6Dy6KDWqi4PJ6k,4005
|
|
@@ -24,10 +24,10 @@ pixeltable/exec/component_iteration_node.py,sha256=ABuXGbDRQWLGuaBnfK7bvOxCrz81v
|
|
|
24
24
|
pixeltable/exec/data_row_batch.py,sha256=qPN0GtBGt72Jnap-UN53VlUPOpYEvqJhp1nuTeJ_8Co,2925
|
|
25
25
|
pixeltable/exec/exec_context.py,sha256=-FbfYLcGOL7mviru5dE1A7x4YxLbdKoXBHN3OSbqbcg,1084
|
|
26
26
|
pixeltable/exec/exec_node.py,sha256=3t_Ri_FQfc-dV91YGSq17Av3vPJth5mHC-LAVc-1Whc,3222
|
|
27
|
-
pixeltable/exec/expr_eval_node.py,sha256=
|
|
27
|
+
pixeltable/exec/expr_eval_node.py,sha256=8IzcxHvXCj69RKFfrt4XEol88SGAlLWMl0bjAijX7Ug,11887
|
|
28
28
|
pixeltable/exec/in_memory_data_node.py,sha256=uK3puLZDzUSJUJwGwkTMYoPqNIvE67jtQodhE2sCz2M,3452
|
|
29
29
|
pixeltable/exec/row_update_node.py,sha256=b8yuKtkmI2Q6U-7svKbkjdM3Z85ddZoJgJgUa17j-YE,2773
|
|
30
|
-
pixeltable/exec/sql_node.py,sha256=
|
|
30
|
+
pixeltable/exec/sql_node.py,sha256=TOeSI7TIUh8SG3esExj5zaWgLrjmpqMN74iJlPq16D0,19546
|
|
31
31
|
pixeltable/exprs/__init__.py,sha256=zx5OTxfUpFs_U36CAO-81v6RCX49wqRw3eHaLfytvkE,1044
|
|
32
32
|
pixeltable/exprs/arithmetic_expr.py,sha256=I_OESFmUHlMSDmMy699-2JnFb7KbRjvh1GF06u8rBQ8,6322
|
|
33
33
|
pixeltable/exprs/array_slice.py,sha256=eSqtQRxvweW_CwTRgkDD189i-BmTJ48dsW3znRPDebg,2180
|
|
@@ -39,19 +39,19 @@ pixeltable/exprs/data_row.py,sha256=rLtKxlst9mK6684A5y-nsjBcalyKEcKAWcYCtNpK10w,
|
|
|
39
39
|
pixeltable/exprs/expr.py,sha256=E1V_fU1qA4nkHLHTqGkxr8exJE6I9-b9LwNVXxGNTXo,30463
|
|
40
40
|
pixeltable/exprs/expr_dict.py,sha256=xkvo_iVPOLMq3WkBZQ2FOoXqYoebuV6XGlidPJxdOkY,1588
|
|
41
41
|
pixeltable/exprs/expr_set.py,sha256=GeUQXadzJbAqQOGdsO6Z5hPAp0A03YUr2hyIvfZDYEE,2576
|
|
42
|
-
pixeltable/exprs/function_call.py,sha256=
|
|
42
|
+
pixeltable/exprs/function_call.py,sha256=5lMTj4G6jOarabZ0b3xpgAMJe3rgDdCSXbYwnrZEjxs,26196
|
|
43
43
|
pixeltable/exprs/globals.py,sha256=5pwn5vdi-EEpYBpPty658YV45myY7W0iFIfTH7QIzak,2032
|
|
44
44
|
pixeltable/exprs/in_predicate.py,sha256=VxSn9TA_3UDHTC6rqQ12No5HbZO7SuE4DglpwAoI58s,3783
|
|
45
|
-
pixeltable/exprs/inline_expr.py,sha256=
|
|
45
|
+
pixeltable/exprs/inline_expr.py,sha256=oALVAM5BVFskEQgkfgGIhKFm6V2FUlrPtocGtqtXM0w,7867
|
|
46
46
|
pixeltable/exprs/is_null.py,sha256=rnusy1j33o48Z-qjguj09G7AmsBHFJI5SWQXOAjgKQw,1092
|
|
47
47
|
pixeltable/exprs/json_mapper.py,sha256=yhefrgvy76czfyTER_oRXnfxOVQb42Q4Us1KkXhSsLM,4545
|
|
48
48
|
pixeltable/exprs/json_path.py,sha256=UTf3VUcyEmEBJs6yU4kONGcZ8fy1o6mIe9MlntnUd6M,6811
|
|
49
49
|
pixeltable/exprs/literal.py,sha256=TTKb0gw6qck9D61SwVDuBrLrBrGwEhkCB-m0ILFpWFk,3764
|
|
50
50
|
pixeltable/exprs/method_ref.py,sha256=3O_uFMP6wWGiwJWri8on-47EVl-QD3AiAc7hXJMADxs,2615
|
|
51
51
|
pixeltable/exprs/object_ref.py,sha256=GVg6uxZnKwFVTC0kouJq-wMFP-gUPb_ld_syHrsGMdE,1283
|
|
52
|
-
pixeltable/exprs/row_builder.py,sha256=
|
|
52
|
+
pixeltable/exprs/row_builder.py,sha256=fJEb8XU7j8M4PIc67O35a5Pzhoh_fs-i77lYxJPrA6o,18444
|
|
53
53
|
pixeltable/exprs/rowid_ref.py,sha256=iNBZ0wIhBAGkGCrNP9UQ2FeK8OajVX-eI4dtDA_bfHU,4401
|
|
54
|
-
pixeltable/exprs/similarity_expr.py,sha256=
|
|
54
|
+
pixeltable/exprs/similarity_expr.py,sha256=VHPpTea-rkatBfDfkZbFVF5dYCswdeULP40SwltBnLI,4364
|
|
55
55
|
pixeltable/exprs/sql_element_cache.py,sha256=8i9ZslKWKTd1lUN7JvwRtQ-PFD1QMi5LBYdwcGA2-p0,1364
|
|
56
56
|
pixeltable/exprs/type_cast.py,sha256=DzVVpMo3msAJm42SAGOV4P0ECyM6LEao3zdfmob4MQo,1862
|
|
57
57
|
pixeltable/exprs/variable.py,sha256=3ZV3HzqULk05LKGG1p1T_xIlBfhqHIK4KJSCgoCDDSY,1488
|
|
@@ -59,42 +59,44 @@ pixeltable/ext/__init__.py,sha256=iO0J_Jfnv38F5y40sDAW54gpXjIyZgOGgoWQJAwjQec,42
|
|
|
59
59
|
pixeltable/ext/functions/__init__.py,sha256=hIjPEKC5E5uJOXlQqUyhP9yn9ZqWOCJAlj0kXWDlhlE,159
|
|
60
60
|
pixeltable/ext/functions/whisperx.py,sha256=jojjNhazcYiAh1scwUl-erhIDRr4kOTkcLrjy0xcp6g,2325
|
|
61
61
|
pixeltable/ext/functions/yolox.py,sha256=k-pQTelv4Tea3AXvDB7Kc7YCIa1uexjVGqxETP0B_hc,5351
|
|
62
|
-
pixeltable/func/__init__.py,sha256=
|
|
63
|
-
pixeltable/func/aggregate_function.py,sha256=
|
|
64
|
-
pixeltable/func/callable_function.py,sha256=
|
|
65
|
-
pixeltable/func/expr_template_function.py,sha256=
|
|
66
|
-
pixeltable/func/function.py,sha256=
|
|
67
|
-
pixeltable/func/function_registry.py,sha256=
|
|
62
|
+
pixeltable/func/__init__.py,sha256=o2UZs6nKwV_wovGQT-lrtETHj9ZOB7ygqaNmX19oXdA,438
|
|
63
|
+
pixeltable/func/aggregate_function.py,sha256=SWqU3stHBzrZbzoNCNHBhMHqQbT9rpVTelWY6otboSg,12649
|
|
64
|
+
pixeltable/func/callable_function.py,sha256=Dq2Az5VtP7HNYZsecdDPSfhGAm-4py9G_3rP_L9mxlA,6609
|
|
65
|
+
pixeltable/func/expr_template_function.py,sha256=xoi7yngicX4F_-qa64a38_dvX3Bs_4BDphodTEul06o,5381
|
|
66
|
+
pixeltable/func/function.py,sha256=e1QjaOTU0hGDjuyDaRVVOdpyGhokcsZajRTqhibtX2U,16811
|
|
67
|
+
pixeltable/func/function_registry.py,sha256=Ps09iPDRJRKj-NQtancrI07zqFBIPpASGZ636mpBiI0,12333
|
|
68
68
|
pixeltable/func/globals.py,sha256=sEwn6lGgHMp6VQORb_P5qRd_-Q2_bUSqvqM9-XPN_ec,1483
|
|
69
|
-
pixeltable/func/query_template_function.py,sha256=
|
|
70
|
-
pixeltable/func/signature.py,sha256=
|
|
71
|
-
pixeltable/func/
|
|
72
|
-
pixeltable/
|
|
73
|
-
pixeltable/functions/
|
|
69
|
+
pixeltable/func/query_template_function.py,sha256=PngD4THjiQz816MPjeOFIvqhJ0mb5y3YGNh4Zv1Xr4Q,3766
|
|
70
|
+
pixeltable/func/signature.py,sha256=wWf07OawOwDmqZOjUPgHJHAhAQ-fd61PGBx82aWLBgA,11212
|
|
71
|
+
pixeltable/func/tools.py,sha256=CqadtWd17sib9zm7XPGDNOCG4-Ai-hGPFYTCZgjkoSY,4690
|
|
72
|
+
pixeltable/func/udf.py,sha256=a8FqOcDqPvUICvELpPOQVsrvr0sgZBQuV4aVHXuexac,8603
|
|
73
|
+
pixeltable/functions/__init__.py,sha256=2vdpJ3S1pUle8dBzCVM70o8Lj1c0lgccZPJgPYms_CQ,403
|
|
74
|
+
pixeltable/functions/anthropic.py,sha256=k80_oGuVXFn0_DjccExw8QWkwi5uutlkeqZ7k77iG8M,4198
|
|
74
75
|
pixeltable/functions/audio.py,sha256=7213nTnqKJ6vM9kalaoJ283OwX5SGEJN10vDhaRNZ6E,644
|
|
75
76
|
pixeltable/functions/fireworks.py,sha256=qwFC_eIaDs-glxyJ_IVXaNGkpgPzeRsQ_SdpzueBxq0,2605
|
|
76
77
|
pixeltable/functions/gemini.py,sha256=RQ3I25nXSXUXdF0rmhnv5XOgZXb_6SIgMc_hEyF83SI,2783
|
|
77
|
-
pixeltable/functions/globals.py,sha256=
|
|
78
|
+
pixeltable/functions/globals.py,sha256=Q5S84Vk_ovCADLivXkn4vfUnX8oSgW8v1dZ0aPoz7C4,4844
|
|
78
79
|
pixeltable/functions/huggingface.py,sha256=s5KmOfi9-TOYyrL1Wv-voKP7ykkUN7LlLAA_uo01UQc,21210
|
|
79
80
|
pixeltable/functions/image.py,sha256=3Qm4ybAT_o4YUl3bzhEXy8dKOwgZ7RCUV-ky-dbL_jc,13836
|
|
80
|
-
pixeltable/functions/json.py,sha256=
|
|
81
|
+
pixeltable/functions/json.py,sha256=cptFpuxQED5wSXXsH8steeHu3pCkZ_zXRE7lccjXybU,756
|
|
81
82
|
pixeltable/functions/llama_cpp.py,sha256=1awALuAXVpQH64l7vQlM8gvxLDix4c1-6DV3nG5RHu4,3881
|
|
83
|
+
pixeltable/functions/math.py,sha256=WPoH9zD9_GdwvBs-FSC3Sqb70gOPNouhPcBZABsuLwI,1541
|
|
82
84
|
pixeltable/functions/mistralai.py,sha256=GpxtT-a8ltx1kQC8XTJRflxkh-17VhzzFTkxqIUsba8,5494
|
|
83
|
-
pixeltable/functions/ollama.py,sha256=
|
|
84
|
-
pixeltable/functions/openai.py,sha256=
|
|
85
|
+
pixeltable/functions/ollama.py,sha256=z-g0cCJ-WMf6RI3SXIVVbbOlrWNR8nxGTyzET1rratU,4320
|
|
86
|
+
pixeltable/functions/openai.py,sha256=rro4m8k2l5UCWnBiXp63HyKkH36937raiavr9Q_nsvs,16463
|
|
85
87
|
pixeltable/functions/replicate.py,sha256=j8ZedScOMInmHWmriQSUOviw6tp8gQr-W6n21PNNL2g,2188
|
|
86
88
|
pixeltable/functions/string.py,sha256=VqzhVildxTt_XblW89Kl5Zd6MVOU71eaX2LTMY5jkUg,20366
|
|
87
|
-
pixeltable/functions/timestamp.py,sha256=
|
|
89
|
+
pixeltable/functions/timestamp.py,sha256=KOm5eVF51PqOCTqwq8cKCAEJNWMgu2xN_yTtGf7yixU,9095
|
|
88
90
|
pixeltable/functions/together.py,sha256=xbgQMlA2G2FXdoQR4O9DlkmBsm2mivAdiOnxtxcyPwo,9440
|
|
89
91
|
pixeltable/functions/util.py,sha256=GgKTzCjvzUQNjWtSObTkfxkvJ9GVUOzKimY45WhE25M,759
|
|
90
|
-
pixeltable/functions/video.py,sha256=
|
|
91
|
-
pixeltable/functions/vision.py,sha256=
|
|
92
|
+
pixeltable/functions/video.py,sha256=12jnOdU0G-Hk42rJx-S5QC77-bDkUflkxfkjej8n5pM,6702
|
|
93
|
+
pixeltable/functions/vision.py,sha256=MEgkNp-4tUUeQS05VEJBrMgQFM48aNsNlksfAl9rH7w,15494
|
|
92
94
|
pixeltable/functions/whisper.py,sha256=f2wqRd0n9jSBqRZN3W93UaetiAHtbsK0j9jXR2j2kkQ,2913
|
|
93
|
-
pixeltable/globals.py,sha256=
|
|
95
|
+
pixeltable/globals.py,sha256=WD4K7V2t6KDUs4VMU-SJWSpIbWeybSnOfQioYRsZGNU,33688
|
|
94
96
|
pixeltable/index/__init__.py,sha256=XBwetNQQwnz0fiKwonOKhyy_U32l_cjt77kNvEIdjWs,102
|
|
95
97
|
pixeltable/index/base.py,sha256=zo0YvJI3oXiK6hZJztB36ZftKKhLfO75Zq3t-PeQA6M,1556
|
|
96
98
|
pixeltable/index/btree.py,sha256=JFerLyyLoBaD0FSF_jJ6iJFBVa-z_et--KdNR02xjRg,2264
|
|
97
|
-
pixeltable/index/embedding_index.py,sha256=
|
|
99
|
+
pixeltable/index/embedding_index.py,sha256=oXslQMTC0rPdmKpRD6Bq6zSdtFv_1XL9-HidgirTB0c,8794
|
|
98
100
|
pixeltable/io/__init__.py,sha256=j3qDyGO1ejLce-UzIncK3eRqyOCLoOlDqClecMBSJGc,563
|
|
99
101
|
pixeltable/io/external_store.py,sha256=H1jt7MDn464QRgBvU-PmcPcFlo3EZBCG7fKWEZXOfyc,16676
|
|
100
102
|
pixeltable/io/fiftyone.py,sha256=hH-FahW6BuMQY8lGa2atnNnJto_pK8kWrP_y_EMsq6g,6965
|
|
@@ -109,33 +111,28 @@ pixeltable/iterators/document.py,sha256=e5EMUAW4f5SqfC5mRN7Oo2E3gw_vcMSzq2707NVL
|
|
|
109
111
|
pixeltable/iterators/image.py,sha256=7eJupbyLEl_q4bemEozL8WgTgkxjl-DYnSXyHTQ7Rck,3628
|
|
110
112
|
pixeltable/iterators/string.py,sha256=NG_fWc_GAITDfzl6MvrDOMrSoMcZdMZf6hPQztCSatE,1305
|
|
111
113
|
pixeltable/iterators/video.py,sha256=anedQpSOnjYhHLa8UiEx-6ROagb14rpXh9am8oTriUg,9382
|
|
112
|
-
pixeltable/metadata/__init__.py,sha256=
|
|
114
|
+
pixeltable/metadata/__init__.py,sha256=dE1y6A_ZjvM8bE6q40HDh_BV5plISXG4dPKfaytozcQ,2209
|
|
113
115
|
pixeltable/metadata/converters/convert_10.py,sha256=J1_r7LNNAWTdb042AwqFpJ4sEB-i4qhUdk5iOjcZk34,719
|
|
114
116
|
pixeltable/metadata/converters/convert_12.py,sha256=Ci-qyZW1gqci-8wnjeOB5afdq7KTuN-hVSV9OqSPx8g,162
|
|
115
117
|
pixeltable/metadata/converters/convert_13.py,sha256=yFR6lD3pOrZ46ZQBFKYvxiIYa7rRxh46Bsq7yiCBNak,1356
|
|
116
118
|
pixeltable/metadata/converters/convert_14.py,sha256=9e_JNm3a35Gs4dvFFaV-_jtCqp3ud6OEOqMIhTQmasE,428
|
|
117
119
|
pixeltable/metadata/converters/convert_15.py,sha256=jMfL5wGil0-gZeIfmCbgtR3LSVNyOcxVp6YRhBECqY4,1741
|
|
118
|
-
pixeltable/metadata/converters/convert_16.py,sha256=
|
|
119
|
-
pixeltable/metadata/converters/convert_17.py,sha256=
|
|
120
|
+
pixeltable/metadata/converters/convert_16.py,sha256=W5pQAcW4JX56NBXAtqdBeKQxzJuFFbwItxLyTa1ZbYg,514
|
|
121
|
+
pixeltable/metadata/converters/convert_17.py,sha256=Z1FiMoN0N5M7Tf4_0LrT6lDJWLBy9U4Lmt1sIns_VFY,899
|
|
120
122
|
pixeltable/metadata/converters/convert_18.py,sha256=NxSroQntVLgmvXfae1f0-jYJIhM2W7dhRY3I7g0RxPY,1482
|
|
121
123
|
pixeltable/metadata/converters/convert_19.py,sha256=QgUDjNoH87KZg_f3cx4k0ZR67NqWRhZQKIIojbqxSkg,2080
|
|
122
124
|
pixeltable/metadata/converters/convert_20.py,sha256=NLMeke9QUGqIJUe5MNqKmVdaLs6pPFrjyigImhogaT4,2768
|
|
123
125
|
pixeltable/metadata/converters/convert_21.py,sha256=YTztkbqOC2zQcTWrXfhrP8diUbfxy5DHwsu_IT-bBok,1115
|
|
124
126
|
pixeltable/metadata/converters/convert_22.py,sha256=f_oauWGEiefr9tZOtGBJMcqqIsTmJwhLNr6DqKlZZkg,590
|
|
125
|
-
pixeltable/metadata/converters/
|
|
126
|
-
pixeltable/metadata/
|
|
127
|
-
pixeltable/metadata/
|
|
127
|
+
pixeltable/metadata/converters/convert_23.py,sha256=ih_3st9Y6A4ZbI8G5HTaUE9xDhiClN-QaT1k1iATIb4,1235
|
|
128
|
+
pixeltable/metadata/converters/convert_24.py,sha256=AUK-lNKwCMhIe3jBRNiw1exMOcqCVMr8ZtIM5IYsrVI,1833
|
|
129
|
+
pixeltable/metadata/converters/util.py,sha256=NgzoKralRIXwOqtguifVsBbpEN2M2X1v8lvOnsdGnPs,6100
|
|
130
|
+
pixeltable/metadata/notes.py,sha256=13qwbuY-3gA3kO-YyBPAFNqpJ04KInIVTVyMcCIJ3Mk,728
|
|
131
|
+
pixeltable/metadata/schema.py,sha256=H9t51cbhXOhNu9Xog2VTjZlkTCx4cjQAlwOXi3HSd2E,9448
|
|
128
132
|
pixeltable/plan.py,sha256=dzG3iD9ClggFyIYmDuIK7H3eBC8HV3ft__f4ZULQvow,40687
|
|
129
133
|
pixeltable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
130
134
|
pixeltable/store.py,sha256=m-OeilqOFai5wUXvtXTV9txzn-GhK2lfA7fkvzrfWFg,21974
|
|
131
|
-
pixeltable/
|
|
132
|
-
pixeltable/tool/create_test_video.py,sha256=4cQmqoKjn3juy7Ilty75gWBygqBxTZ1E9XPlrsC0Ssk,2931
|
|
133
|
-
pixeltable/tool/doc_plugins/griffe.py,sha256=J5zxyEUchfR3mkWmhx4Vjl_iSodL_pHiuOyD2eczbNU,2182
|
|
134
|
-
pixeltable/tool/doc_plugins/mkdocstrings.py,sha256=afq7XOaSC5WRmugkh-FMFMK8PqOgIlDIsJdD8cuPhtE,207
|
|
135
|
-
pixeltable/tool/doc_plugins/templates/material/udf.html.jinja,sha256=R-7Q57nmDd5BUea-F1-MjwjK3pq7uBHXNoSo8_QjZG4,4890
|
|
136
|
-
pixeltable/tool/embed_udf.py,sha256=EXvfvuzZm0uTgH-aAATSrKV8ixCU8OMwpzXlJMg845Y,299
|
|
137
|
-
pixeltable/tool/mypy_plugin.py,sha256=__oTFElirrK25jCX1z_asD_gxGnGxtD2TaU6r1if-Ic,1784
|
|
138
|
-
pixeltable/type_system.py,sha256=80Q70uiOKOm3EOv2Gj0PFgwLUdMq7unMEEok58xvtgQ,41960
|
|
135
|
+
pixeltable/type_system.py,sha256=AfDZqgcMd5i1p_rlQ79-1aDpfbS6yRQCk6_feRUhJro,48399
|
|
139
136
|
pixeltable/utils/__init__.py,sha256=UYlrf6TIWJT0g-Hac0b34-dEk478B5Qx8dGco34YlIk,439
|
|
140
137
|
pixeltable/utils/arrow.py,sha256=4AyCAkkNfNChVTaPAVS5j1ZO7BtTxn11duonolfktV8,3931
|
|
141
138
|
pixeltable/utils/coco.py,sha256=WCUyoj0dTyJFbPB7frEQUvY92SlEPxQ068r-3QAwROE,7285
|
|
@@ -150,8 +147,8 @@ pixeltable/utils/pytorch.py,sha256=6RvOCjy_QV4gc-aht-3d0zoASkuv-warfpl87vgmuKw,3
|
|
|
150
147
|
pixeltable/utils/s3.py,sha256=huA5hxDGkPIu18zWet76o0FsO7Vbtp-iPmnOzCe-MvA,586
|
|
151
148
|
pixeltable/utils/sql.py,sha256=j_tj0h4ffm-DhUIJbvGphxrVyBKlNTwDKqWGhRQ5_PY,795
|
|
152
149
|
pixeltable/utils/transactional_directory.py,sha256=UGzCrGtLR3hEEf8sYGuWBzLVFAEQml3vdIavigWeTBM,1349
|
|
153
|
-
pixeltable-0.2.
|
|
154
|
-
pixeltable-0.2.
|
|
155
|
-
pixeltable-0.2.
|
|
156
|
-
pixeltable-0.2.
|
|
157
|
-
pixeltable-0.2.
|
|
150
|
+
pixeltable-0.2.30.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
151
|
+
pixeltable-0.2.30.dist-info/METADATA,sha256=tJOG6uUsIWjIrRstj2WjUSwrosTfF_2V67n4WmJ5tBE,19546
|
|
152
|
+
pixeltable-0.2.30.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
153
|
+
pixeltable-0.2.30.dist-info/entry_points.txt,sha256=ToOd-pRgG7AitEBgYoBCRRB4-KVDQ0pj_9T4a1LgwA4,97
|
|
154
|
+
pixeltable-0.2.30.dist-info/RECORD,,
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import json
|
|
3
|
-
import logging
|
|
4
|
-
import os
|
|
5
|
-
import pathlib
|
|
6
|
-
import subprocess
|
|
7
|
-
import sys
|
|
8
|
-
from typing import Any
|
|
9
|
-
from zoneinfo import ZoneInfo
|
|
10
|
-
|
|
11
|
-
import pixeltable_pgserver
|
|
12
|
-
import toml
|
|
13
|
-
|
|
14
|
-
import pixeltable as pxt
|
|
15
|
-
import pixeltable.metadata as metadata
|
|
16
|
-
from pixeltable.env import Env
|
|
17
|
-
from pixeltable.func import Batch
|
|
18
|
-
from pixeltable.io.external_store import Project
|
|
19
|
-
from pixeltable.tool import embed_udf
|
|
20
|
-
from pixeltable.type_system import BoolType, FloatType, ImageType, IntType, JsonType, StringType, TimestampType
|
|
21
|
-
|
|
22
|
-
_logger = logging.getLogger('pixeltable')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class Dumper:
|
|
26
|
-
|
|
27
|
-
def __init__(self, output_dir='target', db_name='pxtdump') -> None:
|
|
28
|
-
if sys.version_info >= (3, 10):
|
|
29
|
-
raise RuntimeError(
|
|
30
|
-
'This script must be run on Python 3.9. '
|
|
31
|
-
'DB dumps are incompatible across versions due to issues with pickling anonymous UDFs.'
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
self.output_dir = pathlib.Path(output_dir)
|
|
35
|
-
shared_home = pathlib.Path(os.environ.get('PIXELTABLE_HOME', '~/.pixeltable')).expanduser()
|
|
36
|
-
mock_home_dir = self.output_dir / '.pixeltable'
|
|
37
|
-
mock_home_dir.mkdir(parents=True, exist_ok=True)
|
|
38
|
-
os.environ['PIXELTABLE_HOME'] = str(mock_home_dir)
|
|
39
|
-
os.environ['PIXELTABLE_CONFIG'] = str(shared_home / 'config.toml')
|
|
40
|
-
os.environ['PIXELTABLE_DB'] = db_name
|
|
41
|
-
os.environ['PIXELTABLE_PGDATA'] = str(shared_home / 'pgdata')
|
|
42
|
-
|
|
43
|
-
Env._init_env(reinit_db=True)
|
|
44
|
-
|
|
45
|
-
Env.get().configure_logging(level=logging.DEBUG, to_stdout=True)
|
|
46
|
-
|
|
47
|
-
def dump_db(self) -> None:
|
|
48
|
-
md_version = metadata.VERSION
|
|
49
|
-
dump_file = self.output_dir / f'pixeltable-v{md_version:03d}-test.dump.gz'
|
|
50
|
-
_logger.info(f'Creating database dump at: {dump_file}')
|
|
51
|
-
pg_package_dir = os.path.dirname(pixeltable_pgserver.__file__)
|
|
52
|
-
pg_dump_binary = f'{pg_package_dir}/pginstall/bin/pg_dump'
|
|
53
|
-
_logger.info(f'Using pg_dump binary at: {pg_dump_binary}')
|
|
54
|
-
# We need the raw DB URL, without a driver qualifier. (The driver qualifier is needed by
|
|
55
|
-
# SQLAlchemy, but command-line Postgres won't know how to interpret it.)
|
|
56
|
-
db_url = Env.get()._db_server.get_uri(Env.get()._db_name)
|
|
57
|
-
with open(dump_file, 'wb') as dump:
|
|
58
|
-
pg_dump_process = subprocess.Popen(
|
|
59
|
-
(pg_dump_binary, db_url, '-U', 'postgres', '-Fc'),
|
|
60
|
-
stdout=subprocess.PIPE
|
|
61
|
-
)
|
|
62
|
-
subprocess.run(
|
|
63
|
-
('gzip', '-9'),
|
|
64
|
-
stdin=pg_dump_process.stdout,
|
|
65
|
-
stdout=dump,
|
|
66
|
-
check=True
|
|
67
|
-
)
|
|
68
|
-
if pg_dump_process.poll() != 0:
|
|
69
|
-
raise RuntimeError(f'pg_dump failed with return code {pg_dump_process.returncode}')
|
|
70
|
-
info_file = self.output_dir / f'pixeltable-v{md_version:03d}-test-info.toml'
|
|
71
|
-
git_sha = subprocess.check_output(('git', 'rev-parse', 'HEAD')).decode('ascii').strip()
|
|
72
|
-
user = os.environ.get('USER', os.environ.get('USERNAME'))
|
|
73
|
-
info_dict = {'pixeltable-dump': {
|
|
74
|
-
'metadata-version': md_version,
|
|
75
|
-
'git-sha': git_sha,
|
|
76
|
-
'datetime': datetime.datetime.now(tz=datetime.timezone.utc),
|
|
77
|
-
'user': user
|
|
78
|
-
}}
|
|
79
|
-
with open(info_file, 'w') as info:
|
|
80
|
-
toml.dump(info_dict, info)
|
|
81
|
-
|
|
82
|
-
# Expression types, predicate types, embedding indices, views on views
|
|
83
|
-
def create_tables(self) -> None:
|
|
84
|
-
schema = {
|
|
85
|
-
'c1': StringType(nullable=False),
|
|
86
|
-
'c1n': StringType(nullable=True),
|
|
87
|
-
'c2': IntType(nullable=False),
|
|
88
|
-
'c3': FloatType(nullable=False),
|
|
89
|
-
'c4': BoolType(nullable=False),
|
|
90
|
-
'c5': TimestampType(nullable=False),
|
|
91
|
-
'c6': JsonType(nullable=False),
|
|
92
|
-
'c7': JsonType(nullable=False),
|
|
93
|
-
'c8': ImageType(nullable=True)
|
|
94
|
-
}
|
|
95
|
-
t = pxt.create_table('base_table', schema, primary_key='c2')
|
|
96
|
-
|
|
97
|
-
num_rows = 20
|
|
98
|
-
d1 = {
|
|
99
|
-
'f1': 'test string 1',
|
|
100
|
-
'f2': 1,
|
|
101
|
-
'f3': 1.0,
|
|
102
|
-
'f4': True,
|
|
103
|
-
'f5': [1.0, 2.0, 3.0, 4.0],
|
|
104
|
-
'f6': {
|
|
105
|
-
'f7': 'test string 2',
|
|
106
|
-
'f8': [1.0, 2.0, 3.0, 4.0],
|
|
107
|
-
},
|
|
108
|
-
}
|
|
109
|
-
d2 = [d1, d1]
|
|
110
|
-
|
|
111
|
-
c1_data = [f'test string {i}' for i in range(num_rows)]
|
|
112
|
-
c2_data = [i for i in range(num_rows)]
|
|
113
|
-
c3_data = [float(i) for i in range(num_rows)]
|
|
114
|
-
c4_data = [bool(i % 2) for i in range(num_rows)]
|
|
115
|
-
c5_data = [datetime.datetime.now()] * num_rows
|
|
116
|
-
c6_data = [
|
|
117
|
-
{
|
|
118
|
-
'f1': f'test string {i}',
|
|
119
|
-
'f2': i,
|
|
120
|
-
'f3': float(i),
|
|
121
|
-
'f4': bool(i % 2),
|
|
122
|
-
'f5': [1.0, 2.0, 3.0, 4.0],
|
|
123
|
-
'f6': {
|
|
124
|
-
'f7': 'test string 2',
|
|
125
|
-
'f8': [1.0, 2.0, 3.0, 4.0],
|
|
126
|
-
},
|
|
127
|
-
}
|
|
128
|
-
for i in range(num_rows)
|
|
129
|
-
]
|
|
130
|
-
c7_data = [d2] * num_rows
|
|
131
|
-
rows = [
|
|
132
|
-
{
|
|
133
|
-
'c1': c1_data[i],
|
|
134
|
-
'c1n': c1_data[i] if i % 10 != 0 else None,
|
|
135
|
-
'c2': c2_data[i],
|
|
136
|
-
'c3': c3_data[i],
|
|
137
|
-
'c4': c4_data[i],
|
|
138
|
-
'c5': c5_data[i],
|
|
139
|
-
'c6': c6_data[i],
|
|
140
|
-
'c7': c7_data[i],
|
|
141
|
-
'c8': None
|
|
142
|
-
}
|
|
143
|
-
for i in range(num_rows)
|
|
144
|
-
]
|
|
145
|
-
|
|
146
|
-
self.__add_expr_columns(t, 'base_table')
|
|
147
|
-
t.insert(rows)
|
|
148
|
-
|
|
149
|
-
pxt.create_dir('views')
|
|
150
|
-
|
|
151
|
-
# simple view
|
|
152
|
-
v = pxt.create_view('views.view', t.where(t.c2 < 50))
|
|
153
|
-
self.__add_expr_columns(v, 'view')
|
|
154
|
-
|
|
155
|
-
# snapshot
|
|
156
|
-
_ = pxt.create_snapshot('views.snapshot', t.where(t.c2 >= 75))
|
|
157
|
-
|
|
158
|
-
# view of views
|
|
159
|
-
vv = pxt.create_view('views.view_of_views', v.where(t.c2 >= 25))
|
|
160
|
-
self.__add_expr_columns(vv, 'view_of_views')
|
|
161
|
-
|
|
162
|
-
# empty view
|
|
163
|
-
e = pxt.create_view('views.empty_view', t.where(t.c2 == 4171780))
|
|
164
|
-
assert e.count() == 0
|
|
165
|
-
self.__add_expr_columns(e, 'empty_view', include_expensive_functions=True)
|
|
166
|
-
|
|
167
|
-
# Add external stores
|
|
168
|
-
from pixeltable.io.external_store import MockProject
|
|
169
|
-
v._link_external_store(
|
|
170
|
-
MockProject.create(
|
|
171
|
-
v,
|
|
172
|
-
'project',
|
|
173
|
-
{'int_field': pxt.IntType()},
|
|
174
|
-
{'str_field': pxt.StringType()},
|
|
175
|
-
{'view_test_udf': 'int_field', 'c1': 'str_field'}
|
|
176
|
-
)
|
|
177
|
-
)
|
|
178
|
-
# We're just trying to test metadata here, so it's ok to link a false Label Studio project.
|
|
179
|
-
# We include a computed image column in order to ensure the creation of a stored proxy.
|
|
180
|
-
from pixeltable.io.label_studio import LabelStudioProject
|
|
181
|
-
col_mapping = Project.validate_columns(
|
|
182
|
-
v, {'str_field': pxt.StringType(), 'img_field': pxt.ImageType()}, {},
|
|
183
|
-
{'view_function_call': 'str_field', 'base_table_image_rot': 'img_field'}
|
|
184
|
-
)
|
|
185
|
-
project = LabelStudioProject('ls_project_0', 4171780, media_import_method='file', col_mapping=col_mapping)
|
|
186
|
-
v._link_external_store(project)
|
|
187
|
-
# Sanity check that the stored proxy column did get created
|
|
188
|
-
assert len(project.stored_proxies) == 1
|
|
189
|
-
assert t.base_table_image_rot.col in project.stored_proxies
|
|
190
|
-
|
|
191
|
-
def __add_expr_columns(self, t: pxt.Table, col_prefix: str, include_expensive_functions=False) -> None:
|
|
192
|
-
def add_column(col_name: str, col_expr: Any, stored: bool = True) -> None:
|
|
193
|
-
t.add_column(**{f'{col_prefix}_{col_name}': col_expr}, stored=stored)
|
|
194
|
-
|
|
195
|
-
# arithmetic_expr
|
|
196
|
-
add_column('plus', t.c2 + 6)
|
|
197
|
-
add_column('minus', t.c2 - 5)
|
|
198
|
-
add_column('times', t.c3 * 1.2)
|
|
199
|
-
add_column('div', t.c3 / 1.7)
|
|
200
|
-
add_column('mod', t.c2 % 11)
|
|
201
|
-
|
|
202
|
-
# column_property_ref
|
|
203
|
-
add_column('fileurl', t.c8.fileurl)
|
|
204
|
-
add_column('localpath', t.c8.localpath)
|
|
205
|
-
|
|
206
|
-
# comparison
|
|
207
|
-
add_column('lt', t.c2 < t.c3)
|
|
208
|
-
add_column('le', t.c2 <= t.c3)
|
|
209
|
-
add_column('gt', t.c2 > t.c3)
|
|
210
|
-
add_column('ge', t.c2 >= t.c3)
|
|
211
|
-
add_column('ne', t.c2 != t.c3)
|
|
212
|
-
add_column('eq', t.c2 == t.c3)
|
|
213
|
-
|
|
214
|
-
# compound_predicate
|
|
215
|
-
add_column('and', (t.c2 >= 5) & (t.c2 < 8))
|
|
216
|
-
add_column('or', (t.c2 > 1) | t.c4)
|
|
217
|
-
add_column('not', ~(t.c2 > 20))
|
|
218
|
-
|
|
219
|
-
# function_call
|
|
220
|
-
add_column('function_call', pxt.functions.string.format('{0} {key}', t.c1, key=t.c1)) # library function
|
|
221
|
-
add_column('test_udf', test_udf_stored(t.c2)) # stored udf
|
|
222
|
-
add_column('test_udf_batched', test_udf_stored_batched(t.c1, upper=False)) # batched stored udf
|
|
223
|
-
if include_expensive_functions:
|
|
224
|
-
# batched library function
|
|
225
|
-
add_column('batched', pxt.functions.huggingface.clip_text(t.c1, model_id='openai/clip-vit-base-patch32'))
|
|
226
|
-
|
|
227
|
-
# image_member_access
|
|
228
|
-
add_column('image_mode', t.c8.mode)
|
|
229
|
-
add_column('image_rot', t.c8.rotate(180), stored=False)
|
|
230
|
-
|
|
231
|
-
# in_predicate
|
|
232
|
-
add_column('isin_1', t.c1.isin(['test string 1', 'test string 2', 'test string 3']))
|
|
233
|
-
add_column('isin_2', t.c2.isin([1, 2, 3, 4, 5]))
|
|
234
|
-
add_column('isin_3', t.c2.isin(t.c6.f5))
|
|
235
|
-
|
|
236
|
-
# inline_array, inline_list, inline_dict
|
|
237
|
-
add_column('inline_array_1', pxt.array([[1, 2, 3], [4, 5, 6]]))
|
|
238
|
-
add_column('inline_array_2', pxt.array([['a', 'b', 'c'], ['d', 'e', 'f']]))
|
|
239
|
-
add_column('inline_array_exprs', pxt.array([[t.c2, t.c2 + 1], [t.c2 + 2, t.c2]]))
|
|
240
|
-
add_column('inline_array_mixed', pxt.array([[1, t.c2], [3, t.c2]]))
|
|
241
|
-
add_column('inline_list_1', [[1, 2, 3], [4, 5, 6]])
|
|
242
|
-
add_column('inline_list_2', [['a', 'b', 'c'], ['d', 'e', 'f']])
|
|
243
|
-
add_column('inline_list_exprs', [t.c1, [t.c1n, t.c2]])
|
|
244
|
-
add_column('inline_list_mixed', [1, 'a', t.c1, [1, 'a', t.c1n], 1, 'a'])
|
|
245
|
-
add_column('inline_dict', {'int': 22, 'dict': {'key': 'val'}, 'expr': t.c1})
|
|
246
|
-
|
|
247
|
-
# is_null
|
|
248
|
-
add_column('isnull', t.c1 == None)
|
|
249
|
-
|
|
250
|
-
# json_mapper and json_path
|
|
251
|
-
add_column('json_mapper', t.c6[3])
|
|
252
|
-
add_column('json_path', t.c6.f1)
|
|
253
|
-
add_column('json_path_nested', t.c6.f6.f7)
|
|
254
|
-
add_column('json_path_star', t.c6.f5['*'])
|
|
255
|
-
add_column('json_path_idx', t.c6.f5[3])
|
|
256
|
-
add_column('json_path_slice', t.c6.f5[1:3:2])
|
|
257
|
-
|
|
258
|
-
# literal
|
|
259
|
-
add_column('str_const', 'str')
|
|
260
|
-
add_column('int_const', 5)
|
|
261
|
-
add_column('float_const', 5.0)
|
|
262
|
-
add_column('timestamp_const_1', datetime.datetime.now())
|
|
263
|
-
add_column('timestamp_const_2', datetime.datetime.now().astimezone(ZoneInfo('America/Anchorage')))
|
|
264
|
-
|
|
265
|
-
# type_cast
|
|
266
|
-
add_column('astype', t.c2.astype(FloatType()))
|
|
267
|
-
|
|
268
|
-
# .apply
|
|
269
|
-
add_column('c2_to_string', t.c2.apply(str))
|
|
270
|
-
add_column('c6_to_string', t.c6.apply(json.dumps))
|
|
271
|
-
add_column('c6_back_to_json', t[f'{col_prefix}_c6_to_string'].apply(json.loads))
|
|
272
|
-
|
|
273
|
-
t.add_embedding_index(
|
|
274
|
-
f'{col_prefix}_function_call',
|
|
275
|
-
string_embed=pxt.functions.huggingface.clip_text.using(model_id='openai/clip-vit-base-patch32')
|
|
276
|
-
)
|
|
277
|
-
|
|
278
|
-
# query()
|
|
279
|
-
@t.query
|
|
280
|
-
def q1(i: int):
|
|
281
|
-
# this breaks; TODO: why?
|
|
282
|
-
#return t.where(t.c2 < i)
|
|
283
|
-
return t.where(t.c2 < i).select(t.c1, t.c2)
|
|
284
|
-
add_column('query_output', t.queries.q1(t.c2))
|
|
285
|
-
|
|
286
|
-
@t.query
|
|
287
|
-
def q2(s: str):
|
|
288
|
-
sim = t[f'{col_prefix}_function_call'].similarity(s)
|
|
289
|
-
return t.order_by(sim, asc=False).select(t[f'{col_prefix}_function_call']).limit(5)
|
|
290
|
-
add_column('sim_output', t.queries.q2(t.c1))
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
@pxt.udf(_force_stored=True)
|
|
294
|
-
def test_udf_stored(n: int) -> int:
|
|
295
|
-
return n + 1
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
@pxt.udf(batch_size=4, _force_stored=True)
|
|
299
|
-
def test_udf_stored_batched(strings: Batch[str], *, upper: bool = True) -> Batch[str]:
|
|
300
|
-
return [string.upper() if upper else string.lower() for string in strings]
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
def main() -> None:
|
|
304
|
-
_logger.info("Creating pixeltable test artifact.")
|
|
305
|
-
dumper = Dumper()
|
|
306
|
-
dumper.create_tables()
|
|
307
|
-
dumper.dump_db()
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if __name__ == "__main__":
|
|
311
|
-
main()
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import av # type: ignore[import-untyped]
|
|
2
|
-
import PIL.Image
|
|
3
|
-
import PIL.ImageDraw
|
|
4
|
-
import PIL.ImageFont
|
|
5
|
-
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import Optional
|
|
8
|
-
import tempfile
|
|
9
|
-
import math
|
|
10
|
-
|
|
11
|
-
def create_test_video(
|
|
12
|
-
frame_count: int,
|
|
13
|
-
frame_rate: float = 1.0,
|
|
14
|
-
frame_width: int = 224,
|
|
15
|
-
aspect_ratio: str = '16:9',
|
|
16
|
-
frame_height: Optional[int] = None,
|
|
17
|
-
output_path: Optional[Path] = None,
|
|
18
|
-
font_file: str = '/Library/Fonts/Arial Unicode.ttf',
|
|
19
|
-
) -> Path:
|
|
20
|
-
"""
|
|
21
|
-
Creates an .mp4 video file such as the ones in /tests/data/test_videos
|
|
22
|
-
The video contains a frame number in each frame (for visual sanity check).
|
|
23
|
-
|
|
24
|
-
Args:
|
|
25
|
-
frame_count: Number of frames to create
|
|
26
|
-
frame_rate: Frame rate of the video
|
|
27
|
-
frame_width (int): Width in pixels of the video frame. Note: cost of decoding increases dramatically
|
|
28
|
-
with frame width * frame height.
|
|
29
|
-
aspect_ratio: Aspect ratio (width/height) of the video frames string of form 'width:height'
|
|
30
|
-
frame_height: Height of the video frame, if given, aspect_ratio is ignored
|
|
31
|
-
output_path: Path to save the video file
|
|
32
|
-
font_file: Path to the font file used for text.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
if output_path is None:
|
|
36
|
-
output_path = Path(tempfile.NamedTemporaryFile(suffix='.mp4', delete=False).name)
|
|
37
|
-
|
|
38
|
-
parts = [int(p) for p in aspect_ratio.split(':')]
|
|
39
|
-
assert len(parts) == 2
|
|
40
|
-
aspect_ratio = parts[0] / parts[1]
|
|
41
|
-
|
|
42
|
-
if frame_height is None:
|
|
43
|
-
frame_height = math.ceil(frame_width / aspect_ratio)
|
|
44
|
-
|
|
45
|
-
frame_size = (frame_width, frame_height)
|
|
46
|
-
|
|
47
|
-
font_size = min(frame_height, frame_width) // 4
|
|
48
|
-
font = PIL.ImageFont.truetype(font=font_file, size=font_size)
|
|
49
|
-
font_fill = 0xFFFFFF # white
|
|
50
|
-
frame_color = 0xFFFFFF - font_fill # black
|
|
51
|
-
# Create a video container
|
|
52
|
-
container = av.open(str(output_path), mode='w')
|
|
53
|
-
|
|
54
|
-
# Add a video stream
|
|
55
|
-
stream = container.add_stream('h264', rate=frame_rate)
|
|
56
|
-
stream.width, stream.height = frame_size
|
|
57
|
-
stream.pix_fmt = 'yuv420p'
|
|
58
|
-
|
|
59
|
-
for frame_number in range(frame_count):
|
|
60
|
-
# Create an image with a number in it
|
|
61
|
-
image = PIL.Image.new('RGB', frame_size, color=frame_color)
|
|
62
|
-
draw = PIL.ImageDraw.Draw(image)
|
|
63
|
-
# Optionally, add a font here if you have one
|
|
64
|
-
text = str(frame_number)
|
|
65
|
-
_, _, text_width, text_height = draw.textbbox((0, 0), text, font=font)
|
|
66
|
-
text_position = ((frame_size[0] - text_width) // 2, (frame_size[1] - text_height) // 2)
|
|
67
|
-
draw.text(text_position, text, font=font, fill=font_fill)
|
|
68
|
-
|
|
69
|
-
# Convert the PIL image to an AVFrame
|
|
70
|
-
frame = av.VideoFrame.from_image(image)
|
|
71
|
-
|
|
72
|
-
# Encode and write the frame
|
|
73
|
-
for packet in stream.encode(frame):
|
|
74
|
-
container.mux(packet)
|
|
75
|
-
|
|
76
|
-
# Flush and close the stream
|
|
77
|
-
for packet in stream.encode():
|
|
78
|
-
container.mux(packet)
|
|
79
|
-
|
|
80
|
-
container.close()
|
|
81
|
-
return output_path
|