perspective-python 3.0.3__tar.gz → 3.1.1__tar.gz

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 (240) hide show
  1. {perspective_python-3.0.3 → perspective_python-3.1.1}/Cargo.lock +30 -11
  2. {perspective_python-3.0.3 → perspective_python-3.1.1}/Cargo.toml +8 -0
  3. {perspective_python-3.0.3 → perspective_python-3.1.1}/PKG-INFO +9 -3
  4. {perspective_python-3.0.3/rust/perspective-python/perspective/handlers → perspective_python-3.1.1/perspective}/__init__.py +42 -14
  5. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/handlers/aiohttp.py +2 -1
  6. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/handlers/starlette.py +2 -1
  7. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/handlers/tornado.py +7 -5
  8. perspective_python-3.0.3/perspective/templates/exported_widget.html.jinja → perspective_python-3.1.1/perspective/templates/exported_widget.html.template +11 -11
  9. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/tests/core/test_async.py +4 -1
  10. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/server/test_server.py +3 -1
  11. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/tests/table/test_table.py +9 -0
  12. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_limit.py +4 -0
  13. perspective_python-3.1.1/perspective/tests/test_dependencies.py +46 -0
  14. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/viewer/test_viewer.py +6 -5
  15. {perspective_python-3.0.3/rust/perspective-python → perspective_python-3.1.1}/perspective/tests/widget/test_widget.py +1 -1
  16. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/widget/test_widget_pandas.py +1 -1
  17. perspective_python-3.0.3/rust/perspective-python/perspective/widget/widget.py → perspective_python-3.1.1/perspective/widget/__init__.py +25 -16
  18. {perspective_python-3.0.3/rust/perspective-python/perspective → perspective_python-3.1.1/perspective/widget}/viewer/viewer.py +5 -26
  19. perspective_python-3.1.1/pyproject.toml +48 -0
  20. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/Cargo.toml +13 -4
  21. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/build.rs +13 -2
  22. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/set_loop_callback.md +2 -2
  23. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/table.md +14 -0
  24. perspective_python-3.1.1/rust/perspective-client/docs/expressions.md +141 -0
  25. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/remove_delete.md +2 -1
  26. perspective_python-3.1.1/rust/perspective-client/docs/table.md +281 -0
  27. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/column_paths.md +4 -2
  28. perspective_python-3.1.1/rust/perspective-client/docs/view/delete.md +3 -0
  29. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view.md +28 -37
  30. perspective_python-3.1.1/rust/perspective-client/package.json +18 -0
  31. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/client.rs +21 -10
  32. perspective_python-3.1.1/rust/perspective-client/src/rust/config/expressions.rs +519 -0
  33. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/filters.rs +5 -12
  34. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/mod.rs +4 -3
  35. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/view_config.rs +1 -1
  36. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/lib.rs +8 -3
  37. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/table.rs +33 -0
  38. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/utils/mod.rs +9 -1
  39. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/view.rs +2 -1
  40. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/Cargo.toml +8 -12
  41. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/docs/index.html +12 -1
  42. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/docs/lib.md +31 -43
  43. {perspective_python-3.0.3/perspective/handlers → perspective_python-3.1.1/rust/perspective-python/perspective}/__init__.py +42 -14
  44. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/handlers/aiohttp.py +2 -1
  45. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/handlers/starlette.py +2 -1
  46. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/handlers/tornado.py +7 -5
  47. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/tests/core/test_async.py +4 -1
  48. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/server/test_server.py +3 -1
  49. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/tests/table/test_table.py +9 -0
  50. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_limit.py +4 -0
  51. perspective_python-3.1.1/rust/perspective-python/perspective/tests/test_dependencies.py +46 -0
  52. perspective_python-3.1.1/rust/perspective-python/perspective/tests/viewer/__init__.py +11 -0
  53. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/viewer/test_viewer.py +6 -5
  54. perspective_python-3.1.1/rust/perspective-python/perspective/tests/widget/__init__.py +11 -0
  55. {perspective_python-3.0.3 → perspective_python-3.1.1/rust/perspective-python}/perspective/tests/widget/test_widget.py +1 -1
  56. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/widget/test_widget_pandas.py +1 -1
  57. perspective_python-3.0.3/perspective/widget/widget.py → perspective_python-3.1.1/rust/perspective-python/perspective/widget/__init__.py +25 -16
  58. {perspective_python-3.0.3/perspective → perspective_python-3.1.1/rust/perspective-python/perspective/widget}/viewer/viewer.py +5 -26
  59. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/client/client_sync.rs +38 -13
  60. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/client/mod.rs +3 -4
  61. perspective_python-3.1.1/rust/perspective-python/src/client/pandas.rs +104 -0
  62. perspective_python-3.1.1/rust/perspective-python/src/client/pyarrow.rs +64 -0
  63. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/client/python.rs +98 -163
  64. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/lib.rs +2 -1
  65. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/server/server_sync.rs +19 -2
  66. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/Cargo.toml +4 -4
  67. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/build/main.rs +43 -2
  68. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/build/psp.rs +33 -49
  69. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/src/ffi.rs +3 -0
  70. perspective_python-3.1.1/rust/perspective-server/src/lib.rs +24 -0
  71. perspective_python-3.1.1/rust/perspective-server/src/local_client.rs +112 -0
  72. perspective_python-3.1.1/rust/perspective-server/src/local_session.rs +88 -0
  73. perspective_python-3.0.3/rust/perspective-server/src/lib.rs → perspective_python-3.1.1/rust/perspective-server/src/server.rs +8 -83
  74. perspective_python-3.0.3/perspective/__init__.py +0 -85
  75. perspective_python-3.0.3/perspective/tests/core/test_threadpool.py +0 -48
  76. perspective_python-3.0.3/perspective/tests/single_threaded/test_single_threaded.py +0 -61
  77. perspective_python-3.0.3/perspective/widget/__init__.py +0 -16
  78. perspective_python-3.0.3/pyproject.toml +0 -52
  79. perspective_python-3.0.3/rust/perspective-client/docs/table.md +0 -25
  80. perspective_python-3.0.3/rust/perspective-client/docs/view/delete.md +0 -1
  81. perspective_python-3.0.3/rust/perspective-client/src/rust/config/expressions.rs +0 -104
  82. perspective_python-3.0.3/rust/perspective-python/perspective/__init__.py +0 -85
  83. perspective_python-3.0.3/rust/perspective-python/perspective/tests/core/test_threadpool.py +0 -48
  84. perspective_python-3.0.3/rust/perspective-python/perspective/tests/single_threaded/test_single_threaded.py +0 -61
  85. perspective_python-3.0.3/rust/perspective-python/perspective/widget/__init__.py +0 -16
  86. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/install.json +0 -5
  87. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/package.json +0 -80
  88. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/253.672dd140fd7665c40d72.js +0 -18
  89. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/253.672dd140fd7665c40d72.js.LICENSE.txt +0 -59
  90. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/905.bda9d13f81bc1d4190ff.js +0 -1
  91. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/remoteEntry.306cf9fefef20080ad54.js +0 -1
  92. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/style.js +0 -4
  93. perspective_python-3.0.3.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/static/third-party-licenses.json +0 -16
  94. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/extension/finos-perspective-nbextension.json +0 -0
  95. {perspective_python-3.0.3/perspective/tests → perspective_python-3.1.1/perspective/handlers}/__init__.py +0 -0
  96. {perspective_python-3.0.3/perspective/tests/core → perspective_python-3.1.1/perspective/tests}/__init__.py +0 -0
  97. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/conftest.py +0 -0
  98. {perspective_python-3.0.3/perspective/tests/server → perspective_python-3.1.1/perspective/tests/core}/__init__.py +0 -0
  99. {perspective_python-3.0.3/perspective/tests/table → perspective_python-3.1.1/perspective/tests/server}/__init__.py +0 -0
  100. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/server/test_session.py +0 -0
  101. {perspective_python-3.0.3/perspective/tests/viewer → perspective_python-3.1.1/perspective/tests/table}/__init__.py +0 -0
  102. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/date32.arrow +0 -0
  103. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/date64.arrow +0 -0
  104. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/dict.arrow +0 -0
  105. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/dict_update.arrow +0 -0
  106. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/int_float_str.arrow +0 -0
  107. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/int_float_str_file.arrow +0 -0
  108. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/arrow/int_float_str_update.arrow +0 -0
  109. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/object_sequence.py +0 -0
  110. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_delete.py +0 -0
  111. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_exception.py +0 -0
  112. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_leaks.py +0 -0
  113. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_ports.py +0 -0
  114. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_remove.py +0 -0
  115. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_arrow.py +0 -0
  116. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_datetime.py +0 -0
  117. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_infer.py +0 -0
  118. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_numpy.py +0 -0
  119. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_table_pandas.py +0 -0
  120. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_to_arrow.py +0 -0
  121. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_to_arrow_lz4.py +0 -0
  122. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_to_format.py +0 -0
  123. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_update.py +0 -0
  124. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_update_arrow.py +0 -0
  125. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_update_pandas.py +0 -0
  126. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_view.py +0 -0
  127. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/table/test_view_expression.py +0 -0
  128. {perspective_python-3.0.3/perspective/tests/widget → perspective_python-3.1.1/perspective/tests/viewer}/__init__.py +0 -0
  129. {perspective_python-3.0.3 → perspective_python-3.1.1}/perspective/tests/viewer/test_validate.py +0 -0
  130. {perspective_python-3.0.3/rust/perspective-python/bench → perspective_python-3.1.1/perspective/tests/widget}/__init__.py +0 -0
  131. {perspective_python-3.0.3/perspective → perspective_python-3.1.1/perspective/widget}/viewer/__init__.py +0 -0
  132. {perspective_python-3.0.3/perspective → perspective_python-3.1.1/perspective/widget}/viewer/validate.py +0 -0
  133. {perspective_python-3.0.3/perspective → perspective_python-3.1.1/perspective/widget}/viewer/viewer_traitlets.py +0 -0
  134. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/get_hosted_table_names.md +0 -0
  135. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/open_table.md +0 -0
  136. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/system_info.md +0 -0
  137. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client/terminate.md +0 -0
  138. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/client.md +0 -0
  139. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/index.html +0 -0
  140. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/clear.md +0 -0
  141. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/columns.md +0 -0
  142. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/delete.md +0 -0
  143. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/get_client.md +0 -0
  144. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/get_features.md +0 -0
  145. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/get_index.md +0 -0
  146. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/get_limit.md +0 -0
  147. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/get_num_views.md +0 -0
  148. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/make_port.md +0 -0
  149. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/on_delete.md +0 -0
  150. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/remove.md +0 -0
  151. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/replace.md +0 -0
  152. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/schema.md +0 -0
  153. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/size.md +0 -0
  154. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/update.md +0 -0
  155. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/validate_expressions.md +0 -0
  156. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/table/view.md +0 -0
  157. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/collapse.md +0 -0
  158. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/dimensions.md +0 -0
  159. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/expand.md +0 -0
  160. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/expression_schema.md +0 -0
  161. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/get_config.md +0 -0
  162. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/get_min_max.md +0 -0
  163. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/num_columns.md +0 -0
  164. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/num_rows.md +0 -0
  165. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/on_delete.md +0 -0
  166. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/on_update.md +0 -0
  167. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/remove_delete.md +0 -0
  168. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/remove_update.md +0 -0
  169. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/schema.md +0 -0
  170. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/set_depth.md +0 -0
  171. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_arrow.md +0 -0
  172. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_columns.md +0 -0
  173. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_columns_string.md +0 -0
  174. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_csv.md +0 -0
  175. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_json.md +0 -0
  176. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/docs/view/to_json_string.md +0 -0
  177. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/aggregates.rs +0 -0
  178. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/column_type.rs +0 -0
  179. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/plugin.rs +0 -0
  180. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/config/sort.rs +0 -0
  181. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/session.rs +0 -0
  182. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/table_data.rs +0 -0
  183. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/utils/clone.rs +0 -0
  184. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/utils/logging.rs +0 -0
  185. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/utils/tests/clone.rs +0 -0
  186. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-client/src/rust/utils/tests/mod.rs +0 -0
  187. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/README.md +0 -0
  188. {perspective_python-3.0.3/rust/perspective-python/perspective/tests → perspective_python-3.1.1/rust/perspective-python/bench}/__init__.py +0 -0
  189. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/runtime/__init__.py +0 -0
  190. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/runtime/bench.py +0 -0
  191. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/runtime/perspective_benchmark.py +0 -0
  192. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/runtime/run_perspective_benchmark.py +0 -0
  193. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/__init__.py +0 -0
  194. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/async_server.py +0 -0
  195. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/bench.py +0 -0
  196. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/distributed_mode.py +0 -0
  197. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/server/new_api.py +0 -0
  198. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/server/old_api.py +0 -0
  199. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/bench/tornado/server_mode.py +0 -0
  200. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/build.rs +0 -0
  201. {perspective_python-3.0.3/rust/perspective-python/perspective/tests/core → perspective_python-3.1.1/rust/perspective-python/perspective/handlers}/__init__.py +0 -0
  202. {perspective_python-3.0.3/rust/perspective-python/perspective/tests/server → perspective_python-3.1.1/rust/perspective-python/perspective/tests}/__init__.py +0 -0
  203. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/conftest.py +0 -0
  204. {perspective_python-3.0.3/rust/perspective-python/perspective/tests/table → perspective_python-3.1.1/rust/perspective-python/perspective/tests/core}/__init__.py +0 -0
  205. {perspective_python-3.0.3/rust/perspective-python/perspective/tests/viewer → perspective_python-3.1.1/rust/perspective-python/perspective/tests/server}/__init__.py +0 -0
  206. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/server/test_session.py +0 -0
  207. {perspective_python-3.0.3/rust/perspective-python/perspective/tests/widget → perspective_python-3.1.1/rust/perspective-python/perspective/tests/table}/__init__.py +0 -0
  208. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/object_sequence.py +0 -0
  209. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_delete.py +0 -0
  210. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_exception.py +0 -0
  211. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_leaks.py +0 -0
  212. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_ports.py +0 -0
  213. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_remove.py +0 -0
  214. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_arrow.py +0 -0
  215. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_datetime.py +0 -0
  216. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_infer.py +0 -0
  217. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_numpy.py +0 -0
  218. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_table_pandas.py +0 -0
  219. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_to_arrow.py +0 -0
  220. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_to_arrow_lz4.py +0 -0
  221. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_to_format.py +0 -0
  222. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_update.py +0 -0
  223. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_update_arrow.py +0 -0
  224. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_update_pandas.py +0 -0
  225. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_view.py +0 -0
  226. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/table/test_view_expression.py +0 -0
  227. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/perspective/tests/viewer/test_validate.py +0 -0
  228. {perspective_python-3.0.3/rust/perspective-python/perspective → perspective_python-3.1.1/rust/perspective-python/perspective/widget}/viewer/__init__.py +0 -0
  229. {perspective_python-3.0.3/rust/perspective-python/perspective → perspective_python-3.1.1/rust/perspective-python/perspective/widget}/viewer/validate.py +0 -0
  230. {perspective_python-3.0.3/rust/perspective-python/perspective → perspective_python-3.1.1/rust/perspective-python/perspective/widget}/viewer/viewer_traitlets.py +0 -0
  231. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-python/src/server/mod.rs +0 -0
  232. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.dot +0 -0
  233. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub1.dot +0 -0
  234. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub1.svg +0 -0
  235. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub2.dot +0 -0
  236. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub2.svg +0 -0
  237. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub3.dot +0 -0
  238. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.sub3.svg +0 -0
  239. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/architecture.svg +0 -0
  240. {perspective_python-3.0.3 → perspective_python-3.1.1}/rust/perspective-server/docs/lib.md +0 -0
@@ -1783,7 +1783,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
1783
1783
 
1784
1784
  [[package]]
1785
1785
  name = "perspective"
1786
- version = "3.0.3"
1786
+ version = "3.1.1"
1787
1787
  dependencies = [
1788
1788
  "async-lock",
1789
1789
  "axum",
@@ -1823,7 +1823,7 @@ dependencies = [
1823
1823
 
1824
1824
  [[package]]
1825
1825
  name = "perspective-client"
1826
- version = "3.0.3"
1826
+ version = "3.1.1"
1827
1827
  dependencies = [
1828
1828
  "async-lock",
1829
1829
  "futures",
@@ -1845,7 +1845,7 @@ dependencies = [
1845
1845
 
1846
1846
  [[package]]
1847
1847
  name = "perspective-js"
1848
- version = "3.0.3"
1848
+ version = "3.1.1"
1849
1849
  dependencies = [
1850
1850
  "anyhow",
1851
1851
  "base64 0.13.1",
@@ -1874,15 +1874,26 @@ dependencies = [
1874
1874
 
1875
1875
  [[package]]
1876
1876
  name = "perspective-lint"
1877
- version = "3.0.3"
1877
+ version = "3.1.1"
1878
1878
  dependencies = [
1879
1879
  "glob",
1880
1880
  "yew-fmt",
1881
1881
  ]
1882
1882
 
1883
+ [[package]]
1884
+ name = "perspective-metadata"
1885
+ version = "0.0.0"
1886
+ dependencies = [
1887
+ "perspective-client",
1888
+ "perspective-js",
1889
+ "perspective-server",
1890
+ "perspective-viewer",
1891
+ "ts-rs",
1892
+ ]
1893
+
1883
1894
  [[package]]
1884
1895
  name = "perspective-python"
1885
- version = "3.0.3"
1896
+ version = "3.1.1"
1886
1897
  dependencies = [
1887
1898
  "async-lock",
1888
1899
  "cmake",
@@ -1902,7 +1913,7 @@ dependencies = [
1902
1913
 
1903
1914
  [[package]]
1904
1915
  name = "perspective-server"
1905
- version = "3.0.3"
1916
+ version = "3.1.1"
1906
1917
  dependencies = [
1907
1918
  "async-lock",
1908
1919
  "base64 0.22.1",
@@ -1912,12 +1923,13 @@ dependencies = [
1912
1923
  "num_cpus",
1913
1924
  "perspective-client",
1914
1925
  "regex",
1926
+ "shlex",
1915
1927
  "tracing",
1916
1928
  ]
1917
1929
 
1918
1930
  [[package]]
1919
1931
  name = "perspective-viewer"
1920
- version = "3.0.3"
1932
+ version = "3.1.1"
1921
1933
  dependencies = [
1922
1934
  "anyhow",
1923
1935
  "async-lock",
@@ -2666,6 +2678,12 @@ dependencies = [
2666
2678
  "lazy_static",
2667
2679
  ]
2668
2680
 
2681
+ [[package]]
2682
+ name = "shlex"
2683
+ version = "1.3.0"
2684
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2685
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
2686
+
2669
2687
  [[package]]
2670
2688
  name = "signal-hook-registry"
2671
2689
  version = "1.4.2"
@@ -3125,10 +3143,11 @@ dependencies = [
3125
3143
 
3126
3144
  [[package]]
3127
3145
  name = "ts-rs"
3128
- version = "9.0.1"
3146
+ version = "10.0.0"
3129
3147
  source = "registry+https://github.com/rust-lang/crates.io-index"
3130
- checksum = "b44017f9f875786e543595076374b9ef7d13465a518dd93d6ccdbf5b432dde8c"
3148
+ checksum = "3a2f31991cee3dce1ca4f929a8a04fdd11fd8801aac0f2030b0fa8a0a3fef6b9"
3131
3149
  dependencies = [
3150
+ "lazy_static",
3132
3151
  "serde_json",
3133
3152
  "thiserror",
3134
3153
  "ts-rs-macros",
@@ -3136,9 +3155,9 @@ dependencies = [
3136
3155
 
3137
3156
  [[package]]
3138
3157
  name = "ts-rs-macros"
3139
- version = "9.0.1"
3158
+ version = "10.0.0"
3140
3159
  source = "registry+https://github.com/rust-lang/crates.io-index"
3141
- checksum = "c88cc88fd23b5a04528f3a8436024f20010a16ec18eb23c164b1242f65860130"
3160
+ checksum = "0ea0b99e8ec44abd6f94a18f28f7934437809dd062820797c52401298116f70e"
3142
3161
  dependencies = [
3143
3162
  "proc-macro2 1.0.83",
3144
3163
  "quote 1.0.36",
@@ -12,6 +12,14 @@
12
12
 
13
13
  [workspace]
14
14
  resolver = "2"
15
+ default-members = [
16
+ "rust/perspective",
17
+ "rust/perspective-client",
18
+ "rust/perspective-js",
19
+ "rust/perspective-python",
20
+ "rust/perspective-server",
21
+ "rust/perspective-viewer",
22
+ ]
15
23
  members = ["rust/perspective-python"]
16
24
 
17
25
  [profile.dev]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: perspective-python
3
- Version: 3.0.3
3
+ Version: 3.1.1
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
@@ -13,8 +13,14 @@ Classifier: Framework :: Jupyter :: JupyterLab
13
13
  Classifier: Framework :: Jupyter :: JupyterLab :: 3
14
14
  Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
15
15
  Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
16
- Requires-Dist: jinja2 >=2.0, <4
17
- Requires-Dist: ipywidgets >=7.5.1, <9
16
+ Requires-Dist: ipywidgets >=7.5.1, <9 ; extra == 'jupyter'
17
+ Requires-Dist: tornado >=5, <7 ; extra == 'tornado'
18
+ Requires-Dist: aiohttp >=2, <4 ; extra == 'aiohttp'
19
+ Requires-Dist: starlette <1 ; extra == 'starlette'
20
+ Provides-Extra: jupyter
21
+ Provides-Extra: tornado
22
+ Provides-Extra: aiohttp
23
+ Provides-Extra: starlette
18
24
  Summary: A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
19
25
  Home-Page: https://perspective.finos.org
20
26
  Author: Andrew Stein <steinlink@gmail.com>
@@ -10,17 +10,45 @@
10
10
  # ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11
11
  # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
 
13
- try:
14
- from .aiohttp import PerspectiveAIOHTTPHandler # noqa: F401
15
- except ImportError:
16
- ...
17
-
18
- try:
19
- from .starlette import PerspectiveStarletteHandler # noqa: F401
20
- except ImportError:
21
- ...
22
-
23
- try:
24
- from .tornado import PerspectiveTornadoHandler # noqa: F401
25
- except ImportError:
26
- ...
13
+ __version__ = "3.1.1"
14
+ __all__ = [
15
+ "_jupyter_labextension_paths",
16
+ "Server",
17
+ "Client",
18
+ "PerspectiveError",
19
+ "PerspectiveWidget",
20
+ "ProxySession",
21
+ ]
22
+
23
+ import functools
24
+
25
+ from .perspective import (
26
+ Client,
27
+ PerspectiveError,
28
+ ProxySession,
29
+ PySyncServer as Server,
30
+ )
31
+
32
+
33
+ GLOBAL_SERVER = Server()
34
+ GLOBAL_CLIENT = GLOBAL_SERVER.new_local_client()
35
+
36
+
37
+ @functools.wraps(Client.table)
38
+ def table(*args, **kwargs):
39
+ return GLOBAL_CLIENT.table(*args, **kwargs)
40
+
41
+
42
+ @functools.wraps(Client.open_table)
43
+ def open_table(*args, **kwargs):
44
+ return GLOBAL_CLIENT.table(*args, **kwargs)
45
+
46
+
47
+ @functools.wraps(Client.get_hosted_table_names)
48
+ def get_hosted_table_names(*args, **kwargs):
49
+ return GLOBAL_CLIENT.get_hosted_table_names(*args, **kwargs)
50
+
51
+
52
+ # Read by `jupyter labextension develop`
53
+ def _jupyter_labextension_paths():
54
+ return [{"src": "labextension", "dest": "@finos/perspective-jupyterlab"}]
@@ -11,6 +11,7 @@
11
11
  # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
 
13
13
  from aiohttp import web, WSMsgType
14
+ import perspective
14
15
  import asyncio
15
16
 
16
17
 
@@ -34,7 +35,7 @@ class PerspectiveAIOHTTPHandler(object):
34
35
  """
35
36
 
36
37
  def __init__(self, **kwargs):
37
- self.server = kwargs.pop("perspective_server")
38
+ self.server = kwargs.pop("perspective_server", perspective.GLOBAL_SERVER)
38
39
  self._request = kwargs.pop("request")
39
40
  super().__init__(**kwargs)
40
41
 
@@ -11,6 +11,7 @@
11
11
  # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
 
13
13
  import asyncio
14
+ import perspective
14
15
 
15
16
 
16
17
  class PerspectiveStarletteHandler(object):
@@ -31,7 +32,7 @@ class PerspectiveStarletteHandler(object):
31
32
  """
32
33
 
33
34
  def __init__(self, **kwargs):
34
- self._server = kwargs.pop("perspective_server")
35
+ self._server = kwargs.pop("perspective_server", perspective.GLOBAL_SERVER)
35
36
  self._websocket = kwargs.pop("websocket")
36
37
  super().__init__(**kwargs)
37
38
 
@@ -11,10 +11,14 @@
11
11
  # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
 
13
13
  from tornado.websocket import WebSocketHandler
14
+ from tornado.ioloop import IOLoop
15
+
16
+ import perspective
14
17
 
15
18
 
16
19
  class PerspectiveTornadoHandler(WebSocketHandler):
17
- """PerspectiveTornadoHandler is a drop-in implementation of Perspective.
20
+ """`PerspectiveTornadoHandler` is a drop-in implementation of Perspective as
21
+ a `tornado` handler.
18
22
 
19
23
  Use it inside Tornado routing to create a server-side Perspective that is
20
24
  ready to receive websocket messages from the front-end `perspective-viewer`.
@@ -38,7 +42,7 @@ class PerspectiveTornadoHandler(WebSocketHandler):
38
42
  ... ])
39
43
  """
40
44
 
41
- def initialize(self, perspective_server):
45
+ def initialize(self, perspective_server=perspective.GLOBAL_SERVER):
42
46
  self.server = perspective_server
43
47
 
44
48
  def open(self):
@@ -56,6 +60,4 @@ class PerspectiveTornadoHandler(WebSocketHandler):
56
60
  return
57
61
 
58
62
  self.session.handle_request(msg)
59
-
60
- # TODO schedule me
61
- self.session.poll()
63
+ IOLoop.current().call_later(0, self.session.poll)
@@ -1,12 +1,12 @@
1
- <script type="module" src="{{ psp_cdn('perspective') }}"></script>
2
- <script type="module" src="{{ psp_cdn('perspective-viewer') }}"></script>
3
- <script type="module" src="{{ psp_cdn('perspective-viewer-datagrid') }}"></script>
4
- <script type="module" src="{{ psp_cdn('perspective-viewer-d3fc') }}"></script>
5
- <link rel="stylesheet" crossorigin="anonymous" href="{{ psp_cdn('perspective-viewer', 'css/pro.css') }}" />
1
+ <script type="module" src="$psp_cdn_perspective"></script>
2
+ <script type="module" src="$psp_cdn_perspective_viewer"></script>
3
+ <script type="module" src="$psp_cdn_perspective_viewer_datagrid"></script>
4
+ <script type="module" src="$psp_cdn_perspective_viewer_d3fc"></script>
5
+ <link rel="stylesheet" crossorigin="anonymous" href="$psp_cdn_perspective_viewer_themes" />
6
6
 
7
- <div class="perspective-envelope" id="perspective-envelope-{{viewer_id}}">
7
+ <div class="perspective-envelope" id="perspective-envelope-$viewer_id">
8
8
  <script type="application/vnd.apache.arrow.file">
9
- {{ b64_data }}
9
+ $b64_data
10
10
  </script>
11
11
  <perspective-viewer style="height: 690px;"></perspective-viewer>
12
12
  <script type="module">
@@ -16,15 +16,15 @@
16
16
  return Uint8Array.from(binString, (m) => m.codePointAt(0));
17
17
  }
18
18
 
19
- import * as perspective from "{{ psp_cdn('perspective') }}";
20
- const viewerId = {{ viewer_id | tojson }};
19
+ import * as perspective from "$psp_cdn_perspective";
20
+ const viewerId = $viewer_id;
21
21
  const currentScript = document.scripts[document.scripts.length - 1];
22
- const envelope = document.getElementById(`perspective-envelope-${viewerId}`);
22
+ const envelope = document.getElementById(`perspective-envelope-$${viewerId}`);
23
23
  const dataScript = envelope.querySelector('script[type="application/vnd.apache.arrow.file"]');;
24
24
  if (!dataScript)
25
25
  throw new Error('data script missing for viewer', viewerId);
26
26
  const data = base64ToBytes(dataScript.textContent);
27
- const viewerAttrs = {{ viewer_attrs | tojson }};
27
+ const viewerAttrs = $viewer_attrs;
28
28
 
29
29
  // Create a new worker, then a new table promise on that worker.
30
30
  const table = await perspective.worker().table(data.buffer);
@@ -47,7 +47,10 @@ data = [{"a": i, "b": i * 0.5, "c": str(i)} for i in range(10)]
47
47
  class TestAsync(object):
48
48
  @classmethod
49
49
  def setup_class(cls):
50
- cls.loop = tornado.ioloop.IOLoop()
50
+ import asyncio
51
+
52
+ asyncio.set_event_loop(asyncio.new_event_loop())
53
+ cls.loop = tornado.ioloop.IOLoop.current()
51
54
  cls.thread = threading.Thread(target=cls.loop.start)
52
55
  cls.thread.daemon = True
53
56
  cls.thread.start()
@@ -1007,11 +1007,13 @@ class TestServer(object):
1007
1007
  server = Server()
1008
1008
  client = Client.from_server(server, loop_callback=fake_queue_process)
1009
1009
  table = client.table({"a": [1, 2, 3]}, name="tbl")
1010
+ view = table.view()
1011
+ view.on_update(lambda *args: print(args))
1010
1012
  table.update({"a": [4, 5, 6]})
1011
1013
  assert table.view().to_columns() == {"a": [1, 2, 3, 4, 5, 6]}
1012
1014
 
1013
1015
  table.update({"a": [7, 8, 9]})
1014
- assert s.get() == 5
1016
+ assert s.get() == 2
1015
1017
 
1016
1018
  @mark.skip(
1017
1019
  reason="This method no longer dispatches to the loop_cb because it is sync without an on_update callback"
@@ -82,6 +82,15 @@ class TestTable:
82
82
  "float": [None, 2.5, None],
83
83
  }
84
84
 
85
+ def test_table_records_from_string_with_format_override(self):
86
+ data = '{"x": [1,2,3], "y": [4,5,6]}'
87
+ tbl = Table(data, format="columns")
88
+ view = tbl.view()
89
+ assert view.to_columns() == {
90
+ "x": [1, 2, 3],
91
+ "y": [4, 5, 6],
92
+ }
93
+
85
94
  def test_table_string_column_with_nulls_update_and_filter(self):
86
95
  tbl = Table(
87
96
  [
@@ -39,3 +39,7 @@ class TestTableInfer(object):
39
39
  d2 = t2.view().to_columns()
40
40
 
41
41
  assert d1 == d2
42
+
43
+ def test_table_limit_with_json(self):
44
+ t = Table({"a": [1, 2, 3]}, limit=1)
45
+ assert t.size() == 1
@@ -0,0 +1,46 @@
1
+ # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2
+ # ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
3
+ # ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
4
+ # ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
5
+ # ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
6
+ # ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
7
+ # ┃ Copyright (c) 2017, the Perspective Authors. ┃
8
+ # ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
9
+ # ┃ This file is part of the Perspective library, distributed under the terms ┃
10
+ # ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11
+ # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
+
13
+ import pytest
14
+
15
+
16
+ # test that loading perspective and calling a common constructor code path does
17
+ # not load various "expensive" modules. "Expensive" is in quotes because this is
18
+ # utter nonsense.
19
+ @pytest.mark.skip(reason="https://github.com/pyca/bcrypt/issues/694")
20
+ def test_lazy_modules():
21
+ import sys
22
+
23
+ cache = {}
24
+ for key in list(sys.modules.keys()):
25
+ if (
26
+ key.startswith("perspective")
27
+ or key.startswith("test")
28
+ or key.startswith("pandas")
29
+ or key.startswith("pyarrow")
30
+ or key.startswith("tornado")
31
+ ):
32
+ cache[key] = sys.modules[key]
33
+ del sys.modules[key]
34
+
35
+ import perspective
36
+
37
+ t1 = perspective.table("x\n1")
38
+ t1.delete()
39
+
40
+ assert "perspective" in sys.modules
41
+ assert "pandas" not in sys.modules
42
+ assert "pyarrow" not in sys.modules
43
+ assert "tornado" not in sys.modules
44
+
45
+ for k, v in cache.items():
46
+ sys.modules[k] = v
@@ -12,15 +12,13 @@
12
12
 
13
13
  import numpy as np
14
14
  import pandas as pd
15
- from perspective import PerspectiveViewer
16
15
  import pytest
16
+ from perspective.widget.viewer import PerspectiveViewer
17
17
  import perspective as psp
18
18
 
19
19
  client = psp.Server().new_local_client()
20
20
  Table = client.table
21
21
 
22
- pytest.skip(allow_module_level=True)
23
-
24
22
 
25
23
  class TestViewer:
26
24
  def test_viewer_get_table(self):
@@ -38,9 +36,9 @@ class TestViewer:
38
36
  assert viewer.columns == ["a"]
39
37
 
40
38
  def test_viewer_load_named_table(self):
41
- table = Table({"a": [1, 2, 3]})
39
+ table = Table({"a": [1, 2, 3]}, name="data_1")
42
40
  viewer = PerspectiveViewer()
43
- viewer.load(table, name="data_1")
41
+ viewer.load(table)
44
42
  assert viewer.columns == ["a"]
45
43
  assert viewer.table_name == "data_1"
46
44
  assert viewer.table == table
@@ -86,18 +84,21 @@ class TestViewer:
86
84
  assert viewer.group_by == []
87
85
  assert viewer.theme == "Pro Dark" # should not break UI
88
86
 
87
+ @pytest.mark.skip
89
88
  def test_viewer_load_np(self):
90
89
  table = Table({"a": np.arange(1, 100)})
91
90
  viewer = PerspectiveViewer()
92
91
  viewer.load(table)
93
92
  assert viewer.columns == ["a"]
94
93
 
94
+ @pytest.mark.skip
95
95
  def test_viewer_load_np_data(self):
96
96
  viewer = PerspectiveViewer()
97
97
  viewer.load({"a": np.arange(1, 100)})
98
98
  assert viewer.columns == ["a"]
99
99
  assert viewer.table.size() == 99
100
100
 
101
+ @pytest.mark.skip
101
102
  def test_viewer_load_df(self):
102
103
  table = Table(pd.DataFrame({"a": np.arange(1, 100)}))
103
104
  viewer = PerspectiveViewer()
@@ -13,7 +13,7 @@
13
13
  from functools import partial
14
14
  from types import MethodType
15
15
  import numpy as np
16
- from perspective import PerspectiveWidget
16
+ from perspective.widget import PerspectiveWidget
17
17
  from pytest import raises
18
18
  import pytest
19
19
  import perspective as psp
@@ -13,7 +13,7 @@
13
13
  import pandas as pd
14
14
  import numpy as np
15
15
  import pytest
16
- from perspective import PerspectiveWidget
16
+ from perspective.widget import PerspectiveWidget
17
17
  import perspective as psp
18
18
 
19
19
  client = psp.Server().new_local_client()
@@ -11,15 +11,15 @@
11
11
  # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
 
13
13
  import base64
14
- import jinja2
15
14
  import logging
16
15
  import os
17
16
  import re
17
+ import importlib
18
18
 
19
+ from string import Template
19
20
  from ipywidgets import DOMWidget
20
21
  from traitlets import Unicode, observe
21
- from ..viewer import PerspectiveViewer
22
- import importlib
22
+ from .viewer import PerspectiveViewer
23
23
 
24
24
  __version__ = re.sub(
25
25
  "(rc|alpha|beta)", "-\\1.", importlib.metadata.version("perspective-python")
@@ -36,7 +36,7 @@ class PerspectiveWidget(DOMWidget, PerspectiveViewer):
36
36
  and state is maintained across page refreshes.
37
37
 
38
38
  Examples:
39
- >>> from perspective import Table, PerspectiveWidget
39
+ >>> from perspective.widget import PerspectiveWidget
40
40
  >>> data = {
41
41
  ... "a": [1, 2, 3],
42
42
  ... "b": [
@@ -45,9 +45,8 @@ class PerspectiveWidget(DOMWidget, PerspectiveViewer):
45
45
  ... "2019/07/11 9:30PM"
46
46
  ... ]
47
47
  ... }
48
- >>> tbl = Table(data, index="a")
49
48
  >>> widget = PerspectiveWidget(
50
- ... tbl,
49
+ ... data,
51
50
  ... group_by=["a"],
52
51
  ... sort=[["b", "desc"]],
53
52
  ... filter=[["a", ">", 1]]
@@ -57,7 +56,7 @@ class PerspectiveWidget(DOMWidget, PerspectiveViewer):
57
56
  >>> widget.sort.append(["a", "asc"])
58
57
  >>> widget.sort
59
58
  [["b", "desc"], ["a", "asc"]]
60
- >>> widget.update({"a": [4, 5]}) # Browser UI updates
59
+ >>> widget.table.update({"a": [4, 5]}) # Browser UI updates
61
60
  """
62
61
 
63
62
  # Required by ipywidgets for proper registration of the backend
@@ -217,8 +216,9 @@ class PerspectiveWidget(DOMWidget, PerspectiveViewer):
217
216
  else:
218
217
  logging.error("No session for client_id {}".format(client_id))
219
218
  elif content["type"] == "hangup":
220
- # XXX(tom): client won't reliably send this so shouldn't rely on it to clean up; does jupyter notify us
221
- # when the client on the websocket, i.e. the view, disconnects?
219
+ # XXX(tom): client won't reliably send this so shouldn't rely on it
220
+ # to clean up; does jupyter notify us when the client on the
221
+ # websocket, i.e. the view, disconnects?
222
222
  client_id = content["client_id"]
223
223
  logging.debug("view {} hangup", client_id)
224
224
  session = self._sessions.pop(client_id, None)
@@ -229,27 +229,36 @@ class PerspectiveWidget(DOMWidget, PerspectiveViewer):
229
229
  super_bundle = super(DOMWidget, self)._repr_mimebundle_(**kwargs)
230
230
  if not _jupyter_html_export_enabled():
231
231
  return super_bundle
232
+
232
233
  # Serialize viewer attrs + view data to be rendered in the template
233
234
  viewer_attrs = self.save()
234
235
  data = self.table.view().to_arrow()
235
236
  b64_data = base64.encodebytes(data)
236
-
237
- jinja_env = jinja2.Environment(
238
- loader=jinja2.PackageLoader("perspective"),
239
- autoescape=jinja2.select_autoescape(),
237
+ template_path = os.path.join(
238
+ os.path.dirname(__file__), "../templates/exported_widget.html.template"
240
239
  )
241
- template = jinja_env.get_template("exported_widget.html.jinja")
240
+ with open(template_path, "r") as template_data:
241
+ template = Template(template_data.read())
242
242
 
243
243
  def psp_cdn(module, path=None):
244
244
  if path is None:
245
245
  path = f"cdn/{module}.js"
246
+
246
247
  # perspective developer affordance: works with your local `pnpm run start blocks`
247
248
  # return f"http://localhost:8080/node_modules/@finos/{module}/dist/{path}"
248
249
  return f"https://cdn.jsdelivr.net/npm/@finos/{module}@{__version__}/dist/{path}"
249
250
 
250
251
  return super(DOMWidget, self)._repr_mimebundle_(**kwargs) | {
251
- "text/html": template.render(
252
- psp_cdn=psp_cdn,
252
+ "text/html": template.substitute(
253
+ psp_cdn_perspective=psp_cdn("perspective"),
254
+ psp_cdn_perspective_viewer=psp_cdn("perspective-viewer"),
255
+ psp_cdn_perspective_viewer_datagrid=psp_cdn(
256
+ "perspective-viewer-datagrid"
257
+ ),
258
+ psp_cdn_perspective_viewer_d3fc=psp_cdn("perspective-viewer-d3fc"),
259
+ psp_cdn_perspective_viewer_themes=psp_cdn(
260
+ "perspective-viewer-themes", "css/themes.css"
261
+ ),
253
262
  viewer_id=self.model_id,
254
263
  viewer_attrs=viewer_attrs,
255
264
  b64_data=b64_data.decode("utf-8"),
@@ -180,16 +180,6 @@ class PerspectiveViewer(PerspectiveTraitlets, object):
180
180
  Cannot be set at the same time as `index`. Ignored if a
181
181
  ``Table`` or ``View`` is supplied.
182
182
 
183
- Examples:
184
- >>> from perspective import Table, PerspectiveViewer
185
- >>> data = {"a": [1, 2, 3]}
186
- >>> tbl = Table(data)
187
- >>> viewer = PerspectiveViewer()
188
- >>> viewer.load(tbl)
189
- >>> viewer.load(data, index="a") # viewer state is reset
190
- >>> viewer2 = PerspectiveViewer()
191
- >>> viewer2.load(tbl.view())
192
-
193
183
  """
194
184
  name = options.pop("name", str(random()))
195
185
 
@@ -197,18 +187,17 @@ class PerspectiveViewer(PerspectiveTraitlets, object):
197
187
  if self.table is not None:
198
188
  self.reset()
199
189
 
200
- if isinstance(data, perspective.Table):
190
+ if isinstance(data, perspective.perspective.Table):
201
191
  self._table = data
202
192
  self._client = data.get_client()
203
193
  name = self._table.get_name()
204
- elif isinstance(data, perspective.View):
194
+ elif isinstance(data, perspective.perspective.View):
205
195
  raise TypeError(
206
196
  "Views cannot be loaded directly, load a table or raw data instead"
207
197
  )
208
198
  else:
209
- client = perspective.Server().new_local_client()
210
- self._table = client.table(data, name=name, **options)
211
- self._client = client
199
+ self._table = perspective.table(data, name=name, **options)
200
+ self._client = perspective.GLOBAL_CLIENT
212
201
 
213
202
  # If the user does not set columns to show, synchronize viewer state
214
203
  # with dataset.
@@ -313,19 +302,9 @@ class PerspectiveViewer(PerspectiveTraitlets, object):
313
302
  deleted. Defaults to True.
314
303
  """
315
304
  if delete_table:
316
- # XXX(tom): TODO implement delete
317
- # Delete all created views on the widget's manager instance
318
- # for view in self.manager._views.values():
319
- # view.delete()
320
-
321
- # Reset view cache
322
- # self.manager._views = {}
323
-
324
305
  # Delete table
325
- raise RuntimeError("XXX(tom): delete not implemented")
326
306
  self.table.delete()
327
- self.manager._tables.pop(self.table_name)
328
- self.table = None
329
307
  self.table_name = None
308
+ self._table = None
330
309
 
331
310
  self.reset()