scitex 2.7.3__py3-none-any.whl → 2.10.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.
Files changed (563) hide show
  1. scitex/__init__.py +15 -7
  2. scitex/__version__.py +1 -2
  3. scitex/_install_guide.py +250 -0
  4. scitex/_optional_deps.py +206 -39
  5. scitex/ai/_gen_ai/_Groq.py +2 -4
  6. scitex/ai/_gen_ai/_OpenAI.py +5 -2
  7. scitex/ai/_gen_ai/_Perplexity.py +20 -6
  8. scitex/audio/__init__.py +24 -15
  9. scitex/audio/_cross_process_lock.py +139 -0
  10. scitex/audio/_mcp_handlers.py +256 -0
  11. scitex/audio/_mcp_tool_schemas.py +203 -0
  12. scitex/audio/engines/elevenlabs_engine.py +5 -2
  13. scitex/audio/mcp_server.py +98 -457
  14. scitex/bridge/__init__.py +30 -19
  15. scitex/bridge/_figrecipe.py +245 -0
  16. scitex/bridge/_helpers.py +2 -1
  17. scitex/bridge/_plt_vis.py +23 -10
  18. scitex/bridge/_stats_plt.py +18 -5
  19. scitex/bridge/_stats_vis.py +16 -2
  20. scitex/browser/__init__.py +84 -44
  21. scitex/browser/automation/__init__.py +5 -1
  22. scitex/browser/core/BrowserMixin.py +17 -4
  23. scitex/browser/core/__init__.py +11 -2
  24. scitex/browser/remote/CaptchaHandler.py +1 -1
  25. scitex/browser/remote/ZenRowsAPIClient.py +1 -1
  26. scitex/capture/grid.py +487 -0
  27. scitex/capture/mcp_handlers.py +401 -0
  28. scitex/capture/mcp_tool_defs.py +192 -0
  29. scitex/capture/mcp_tools.py +241 -0
  30. scitex/capture/mcp_utils.py +30 -0
  31. scitex/cli/convert.py +421 -0
  32. scitex/cli/main.py +6 -4
  33. scitex/datetime/__init__.py +46 -0
  34. scitex/datetime/_linspace.py +100 -0
  35. scitex/datetime/_normalize_timestamp.py +306 -0
  36. scitex/db/_delete_duplicates.py +4 -4
  37. scitex/db/_sqlite3/_delete_duplicates.py +11 -2
  38. scitex/dev/plt/__init__.py +61 -62
  39. scitex/dev/plt/demo_plotters/__init__.py +0 -0
  40. scitex/dev/plt/demo_plotters/plot_mpl_axhline.py +28 -0
  41. scitex/dev/plt/demo_plotters/plot_mpl_axhspan.py +28 -0
  42. scitex/dev/plt/demo_plotters/plot_mpl_axvline.py +28 -0
  43. scitex/dev/plt/demo_plotters/plot_mpl_axvspan.py +28 -0
  44. scitex/dev/plt/demo_plotters/plot_mpl_bar.py +29 -0
  45. scitex/dev/plt/demo_plotters/plot_mpl_barh.py +29 -0
  46. scitex/dev/plt/demo_plotters/plot_mpl_boxplot.py +28 -0
  47. scitex/dev/plt/demo_plotters/plot_mpl_contour.py +31 -0
  48. scitex/dev/plt/demo_plotters/plot_mpl_contourf.py +31 -0
  49. scitex/dev/plt/demo_plotters/plot_mpl_errorbar.py +30 -0
  50. scitex/dev/plt/demo_plotters/plot_mpl_eventplot.py +28 -0
  51. scitex/dev/plt/demo_plotters/plot_mpl_fill.py +30 -0
  52. scitex/dev/plt/demo_plotters/plot_mpl_fill_between.py +31 -0
  53. scitex/dev/plt/demo_plotters/plot_mpl_hexbin.py +28 -0
  54. scitex/dev/plt/demo_plotters/plot_mpl_hist.py +28 -0
  55. scitex/dev/plt/demo_plotters/plot_mpl_hist2d.py +28 -0
  56. scitex/dev/plt/demo_plotters/plot_mpl_imshow.py +29 -0
  57. scitex/dev/plt/demo_plotters/plot_mpl_pcolormesh.py +31 -0
  58. scitex/dev/plt/demo_plotters/plot_mpl_pie.py +29 -0
  59. scitex/dev/plt/demo_plotters/plot_mpl_plot.py +29 -0
  60. scitex/dev/plt/demo_plotters/plot_mpl_quiver.py +31 -0
  61. scitex/dev/plt/demo_plotters/plot_mpl_scatter.py +28 -0
  62. scitex/dev/plt/demo_plotters/plot_mpl_stackplot.py +31 -0
  63. scitex/dev/plt/demo_plotters/plot_mpl_stem.py +29 -0
  64. scitex/dev/plt/demo_plotters/plot_mpl_step.py +29 -0
  65. scitex/dev/plt/demo_plotters/plot_mpl_violinplot.py +28 -0
  66. scitex/dev/plt/demo_plotters/plot_sns_barplot.py +29 -0
  67. scitex/dev/plt/demo_plotters/plot_sns_boxplot.py +29 -0
  68. scitex/dev/plt/demo_plotters/plot_sns_heatmap.py +28 -0
  69. scitex/dev/plt/demo_plotters/plot_sns_histplot.py +29 -0
  70. scitex/dev/plt/demo_plotters/plot_sns_kdeplot.py +29 -0
  71. scitex/dev/plt/demo_plotters/plot_sns_lineplot.py +31 -0
  72. scitex/dev/plt/demo_plotters/plot_sns_scatterplot.py +29 -0
  73. scitex/dev/plt/demo_plotters/plot_sns_stripplot.py +29 -0
  74. scitex/dev/plt/demo_plotters/plot_sns_swarmplot.py +29 -0
  75. scitex/dev/plt/demo_plotters/plot_sns_violinplot.py +29 -0
  76. scitex/dev/plt/demo_plotters/plot_stx_bar.py +29 -0
  77. scitex/dev/plt/demo_plotters/plot_stx_barh.py +29 -0
  78. scitex/dev/plt/demo_plotters/plot_stx_box.py +28 -0
  79. scitex/dev/plt/demo_plotters/plot_stx_boxplot.py +28 -0
  80. scitex/dev/plt/demo_plotters/plot_stx_conf_mat.py +28 -0
  81. scitex/dev/plt/demo_plotters/plot_stx_contour.py +31 -0
  82. scitex/dev/plt/demo_plotters/plot_stx_ecdf.py +28 -0
  83. scitex/dev/plt/demo_plotters/plot_stx_errorbar.py +30 -0
  84. scitex/dev/plt/demo_plotters/plot_stx_fill_between.py +31 -0
  85. scitex/dev/plt/demo_plotters/plot_stx_fillv.py +28 -0
  86. scitex/dev/plt/demo_plotters/plot_stx_heatmap.py +28 -0
  87. scitex/dev/plt/demo_plotters/plot_stx_image.py +28 -0
  88. scitex/dev/plt/demo_plotters/plot_stx_imshow.py +28 -0
  89. scitex/dev/plt/demo_plotters/plot_stx_joyplot.py +28 -0
  90. scitex/dev/plt/demo_plotters/plot_stx_kde.py +28 -0
  91. scitex/dev/plt/demo_plotters/plot_stx_line.py +28 -0
  92. scitex/dev/plt/demo_plotters/plot_stx_mean_ci.py +28 -0
  93. scitex/dev/plt/demo_plotters/plot_stx_mean_std.py +28 -0
  94. scitex/dev/plt/demo_plotters/plot_stx_median_iqr.py +28 -0
  95. scitex/dev/plt/demo_plotters/plot_stx_raster.py +28 -0
  96. scitex/dev/plt/demo_plotters/plot_stx_rectangle.py +28 -0
  97. scitex/dev/plt/demo_plotters/plot_stx_scatter.py +29 -0
  98. scitex/dev/plt/demo_plotters/plot_stx_shaded_line.py +29 -0
  99. scitex/dev/plt/demo_plotters/plot_stx_violin.py +28 -0
  100. scitex/dev/plt/demo_plotters/plot_stx_violinplot.py +28 -0
  101. scitex/dev/plt/mpl/get_dir_ax.py +46 -0
  102. scitex/dev/plt/mpl/get_signatures.py +176 -0
  103. scitex/dev/plt/mpl/get_signatures_details.py +522 -0
  104. scitex/dev/plt/plot_mpl_axhline.py +0 -0
  105. scitex/dev/plt/plot_mpl_axhspan.py +0 -0
  106. scitex/dev/plt/plot_mpl_axvline.py +0 -0
  107. scitex/dev/plt/plot_mpl_axvspan.py +0 -0
  108. scitex/dev/plt/plot_mpl_bar.py +0 -0
  109. scitex/dev/plt/plot_mpl_barh.py +0 -0
  110. scitex/dev/plt/plot_mpl_boxplot.py +0 -0
  111. scitex/dev/plt/plot_mpl_contour.py +0 -0
  112. scitex/dev/plt/plot_mpl_contourf.py +0 -0
  113. scitex/dev/plt/plot_mpl_errorbar.py +0 -0
  114. scitex/dev/plt/plot_mpl_eventplot.py +0 -0
  115. scitex/dev/plt/plot_mpl_fill.py +0 -0
  116. scitex/dev/plt/plot_mpl_fill_between.py +0 -0
  117. scitex/dev/plt/plot_mpl_hexbin.py +0 -0
  118. scitex/dev/plt/plot_mpl_hist.py +0 -0
  119. scitex/dev/plt/plot_mpl_hist2d.py +0 -0
  120. scitex/dev/plt/plot_mpl_imshow.py +0 -0
  121. scitex/dev/plt/plot_mpl_pcolormesh.py +0 -0
  122. scitex/dev/plt/plot_mpl_pie.py +0 -0
  123. scitex/dev/plt/plot_mpl_plot.py +0 -0
  124. scitex/dev/plt/plot_mpl_quiver.py +0 -0
  125. scitex/dev/plt/plot_mpl_scatter.py +0 -0
  126. scitex/dev/plt/plot_mpl_stackplot.py +0 -0
  127. scitex/dev/plt/plot_mpl_stem.py +0 -0
  128. scitex/dev/plt/plot_mpl_step.py +0 -0
  129. scitex/dev/plt/plot_mpl_violinplot.py +0 -0
  130. scitex/dev/plt/plot_sns_barplot.py +0 -0
  131. scitex/dev/plt/plot_sns_boxplot.py +0 -0
  132. scitex/dev/plt/plot_sns_heatmap.py +0 -0
  133. scitex/dev/plt/plot_sns_histplot.py +0 -0
  134. scitex/dev/plt/plot_sns_kdeplot.py +0 -0
  135. scitex/dev/plt/plot_sns_lineplot.py +0 -0
  136. scitex/dev/plt/plot_sns_scatterplot.py +0 -0
  137. scitex/dev/plt/plot_sns_stripplot.py +0 -0
  138. scitex/dev/plt/plot_sns_swarmplot.py +0 -0
  139. scitex/dev/plt/plot_sns_violinplot.py +0 -0
  140. scitex/dev/plt/plot_stx_bar.py +0 -0
  141. scitex/dev/plt/plot_stx_barh.py +0 -0
  142. scitex/dev/plt/plot_stx_box.py +0 -0
  143. scitex/dev/plt/plot_stx_boxplot.py +0 -0
  144. scitex/dev/plt/plot_stx_conf_mat.py +0 -0
  145. scitex/dev/plt/plot_stx_contour.py +0 -0
  146. scitex/dev/plt/plot_stx_ecdf.py +0 -0
  147. scitex/dev/plt/plot_stx_errorbar.py +0 -0
  148. scitex/dev/plt/plot_stx_fill_between.py +0 -0
  149. scitex/dev/plt/plot_stx_fillv.py +0 -0
  150. scitex/dev/plt/plot_stx_heatmap.py +0 -0
  151. scitex/dev/plt/plot_stx_image.py +0 -0
  152. scitex/dev/plt/plot_stx_imshow.py +0 -0
  153. scitex/dev/plt/plot_stx_joyplot.py +0 -0
  154. scitex/dev/plt/plot_stx_kde.py +0 -0
  155. scitex/dev/plt/plot_stx_line.py +0 -0
  156. scitex/dev/plt/plot_stx_mean_ci.py +0 -0
  157. scitex/dev/plt/plot_stx_mean_std.py +0 -0
  158. scitex/dev/plt/plot_stx_median_iqr.py +0 -0
  159. scitex/dev/plt/plot_stx_raster.py +0 -0
  160. scitex/dev/plt/plot_stx_rectangle.py +0 -0
  161. scitex/dev/plt/plot_stx_scatter.py +0 -0
  162. scitex/dev/plt/plot_stx_shaded_line.py +0 -0
  163. scitex/dev/plt/plot_stx_violin.py +0 -0
  164. scitex/dev/plt/plot_stx_violinplot.py +0 -0
  165. scitex/diagram/README.md +197 -0
  166. scitex/diagram/__init__.py +48 -0
  167. scitex/diagram/_compile.py +312 -0
  168. scitex/diagram/_diagram.py +355 -0
  169. scitex/diagram/_presets.py +173 -0
  170. scitex/diagram/_schema.py +182 -0
  171. scitex/diagram/_split.py +278 -0
  172. scitex/dict/_pop_keys.py +1 -7
  173. scitex/dsp/__init__.py +15 -10
  174. scitex/dsp/add_noise.py +5 -2
  175. scitex/dsp/example.py +35 -22
  176. scitex/dsp/filt.py +8 -3
  177. scitex/dsp/reference.py +3 -2
  178. scitex/dsp/utils/__init__.py +2 -1
  179. scitex/dsp/utils/_differential_bandpass_filters.py +14 -4
  180. scitex/dt/__init__.py +39 -2
  181. scitex/errors.py +82 -521
  182. scitex/fig/__init__.py +4 -4
  183. scitex/fig/editor/__init__.py +5 -2
  184. scitex/fig/editor/_dearpygui_editor.py +1 -1
  185. scitex/fig/editor/_mpl_editor.py +1 -1
  186. scitex/fig/editor/_qt_editor.py +1 -1
  187. scitex/fig/editor/_tkinter_editor.py +1 -1
  188. scitex/fig/editor/edit/__init__.py +50 -0
  189. scitex/fig/editor/edit/backend_detector.py +109 -0
  190. scitex/fig/editor/edit/bundle_resolver.py +240 -0
  191. scitex/fig/editor/edit/editor_launcher.py +239 -0
  192. scitex/fig/editor/edit/manual_handler.py +53 -0
  193. scitex/fig/editor/edit/panel_loader.py +232 -0
  194. scitex/fig/editor/edit/path_resolver.py +67 -0
  195. scitex/fig/editor/flask_editor/_bbox.py +23 -0
  196. scitex/fig/editor/flask_editor/_core.py +908 -103
  197. scitex/fig/editor/flask_editor/_renderer.py +74 -0
  198. scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
  199. scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
  200. scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
  201. scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
  202. scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
  203. scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
  204. scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
  205. scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
  206. scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
  207. scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
  208. scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
  209. scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
  210. scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
  211. scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
  212. scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
  213. scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
  214. scitex/fig/editor/flask_editor/static/css/index.css +31 -0
  215. scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
  216. scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
  217. scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
  218. scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
  219. scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
  220. scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
  221. scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
  222. scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
  223. scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
  224. scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
  225. scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
  226. scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
  227. scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
  228. scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
  229. scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
  230. scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
  231. scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
  232. scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
  233. scitex/fig/editor/flask_editor/static/js/main.js +426 -0
  234. scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
  235. scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
  236. scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
  237. scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
  238. scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
  239. scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
  240. scitex/fig/editor/flask_editor/templates/__init__.py +95 -5
  241. scitex/fig/editor/flask_editor/templates/_html.py +27 -9
  242. scitex/fig/editor/flask_editor/templates/_scripts.py +1928 -131
  243. scitex/fig/editor/flask_editor/templates/_styles.py +363 -51
  244. scitex/fig/io/_bundle.py +104 -19
  245. scitex/fts/README.md +262 -0
  246. scitex/fts/TODO.md +66 -0
  247. scitex/fts/__init__.py +90 -0
  248. scitex/fts/_bundle/README_IN_BUNDLE.md +102 -0
  249. scitex/fts/_bundle/_FTS.py +657 -0
  250. scitex/fts/_bundle/__init__.py +38 -0
  251. scitex/fts/_bundle/_children.py +216 -0
  252. scitex/fts/_bundle/_conversion/__init__.py +15 -0
  253. scitex/fts/_bundle/_conversion/_bundle2dict.py +44 -0
  254. scitex/fts/_bundle/_conversion/_dict2bundle.py +50 -0
  255. scitex/fts/_bundle/_dataclasses/_Axes.py +57 -0
  256. scitex/fts/_bundle/_dataclasses/_BBox.py +54 -0
  257. scitex/fts/_bundle/_dataclasses/_ColumnDef.py +72 -0
  258. scitex/fts/_bundle/_dataclasses/_DataFormat.py +40 -0
  259. scitex/fts/_bundle/_dataclasses/_DataInfo.py +135 -0
  260. scitex/fts/_bundle/_dataclasses/_DataSource.py +44 -0
  261. scitex/fts/_bundle/_dataclasses/_Node.py +319 -0
  262. scitex/fts/_bundle/_dataclasses/_NodeRefs.py +45 -0
  263. scitex/fts/_bundle/_dataclasses/_SizeMM.py +38 -0
  264. scitex/fts/_bundle/_dataclasses/__init__.py +35 -0
  265. scitex/fts/_bundle/_extractors/__init__.py +32 -0
  266. scitex/fts/_bundle/_extractors/_extract_bar.py +131 -0
  267. scitex/fts/_bundle/_extractors/_extract_line.py +71 -0
  268. scitex/fts/_bundle/_extractors/_extract_scatter.py +79 -0
  269. scitex/fts/_bundle/_loader.py +134 -0
  270. scitex/fts/_bundle/_mpl_helpers.py +389 -0
  271. scitex/fts/_bundle/_saver.py +269 -0
  272. scitex/fts/_bundle/_storage.py +200 -0
  273. scitex/fts/_bundle/_utils/__init__.py +55 -0
  274. scitex/fts/_bundle/_utils/_const.py +26 -0
  275. scitex/fts/_bundle/_utils/_errors.py +73 -0
  276. scitex/fts/_bundle/_utils/_generate.py +21 -0
  277. scitex/fts/_bundle/_utils/_types.py +76 -0
  278. scitex/fts/_bundle/_validation.py +434 -0
  279. scitex/fts/_bundle/_zipbundle.py +165 -0
  280. scitex/fts/_fig/__init__.py +22 -0
  281. scitex/fts/_fig/_backend/__init__.py +53 -0
  282. scitex/fts/_fig/_backend/_export.py +165 -0
  283. scitex/fts/_fig/_backend/_parser.py +188 -0
  284. scitex/fts/_fig/_backend/_render.py +538 -0
  285. scitex/fts/_fig/_composite.py +345 -0
  286. scitex/fts/_fig/_dataclasses/_ChannelEncoding.py +46 -0
  287. scitex/fts/_fig/_dataclasses/_Encoding.py +82 -0
  288. scitex/fts/_fig/_dataclasses/_Theme.py +441 -0
  289. scitex/fts/_fig/_dataclasses/_TraceEncoding.py +52 -0
  290. scitex/fts/_fig/_dataclasses/__init__.py +47 -0
  291. scitex/fts/_fig/_editor/__init__.py +14 -0
  292. scitex/fts/_fig/_editor/_cui/__init__.py +33 -0
  293. scitex/fts/_fig/_editor/_cui/_backend_detector.py +39 -0
  294. scitex/fts/_fig/_editor/_cui/_bundle_resolver.py +366 -0
  295. scitex/fts/_fig/_editor/_cui/_editor_launcher.py +175 -0
  296. scitex/fts/_fig/_editor/_cui/_manual_handler.py +52 -0
  297. scitex/fts/_fig/_editor/_cui/_panel_loader.py +246 -0
  298. scitex/fts/_fig/_editor/_cui/_path_resolver.py +66 -0
  299. scitex/fts/_fig/_editor/_defaults.py +300 -0
  300. scitex/fts/_fig/_editor/_gui/__init__.py +11 -0
  301. scitex/fts/_fig/_editor/_gui/_flask_editor/__init__.py +20 -0
  302. scitex/fts/_fig/_editor/_gui/_flask_editor/_bbox.py +1339 -0
  303. scitex/fts/_fig/_editor/_gui/_flask_editor/_core.py +1688 -0
  304. scitex/fts/_fig/_editor/_gui/_flask_editor/_plotter.py +664 -0
  305. scitex/fts/_fig/_editor/_gui/_flask_editor/_renderer.py +853 -0
  306. scitex/fts/_fig/_editor/_gui/_flask_editor/_utils.py +79 -0
  307. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/reset.css +41 -0
  308. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/typography.css +16 -0
  309. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/variables.css +85 -0
  310. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/buttons.css +217 -0
  311. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/context-menu.css +93 -0
  312. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/dropdown.css +57 -0
  313. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/forms.css +112 -0
  314. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/modal.css +59 -0
  315. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/sections.css +212 -0
  316. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/canvas.css +176 -0
  317. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/element-inspector.css +190 -0
  318. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/loading.css +59 -0
  319. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/overlay.css +45 -0
  320. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/panel-grid.css +95 -0
  321. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/selection.css +101 -0
  322. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/statistics.css +138 -0
  323. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/index.css +31 -0
  324. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/container.css +7 -0
  325. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/controls.css +56 -0
  326. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/preview.css +78 -0
  327. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/axis.js +314 -0
  328. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/basic.js +107 -0
  329. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/distribute.js +54 -0
  330. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/canvas.js +172 -0
  331. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/dragging.js +258 -0
  332. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/resize.js +48 -0
  333. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/selection.js +71 -0
  334. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/api.js +288 -0
  335. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/state.js +143 -0
  336. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/utils.js +245 -0
  337. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/dev/element-inspector.js +992 -0
  338. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/bbox.js +339 -0
  339. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/element-drag.js +286 -0
  340. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/overlay.js +371 -0
  341. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/preview.js +293 -0
  342. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/main.js +426 -0
  343. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/context-menu.js +152 -0
  344. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/keyboard.js +265 -0
  345. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/controls.js +184 -0
  346. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/download.js +57 -0
  347. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/help.js +100 -0
  348. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/theme.js +34 -0
  349. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/__init__.py +124 -0
  350. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_html.py +851 -0
  351. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_scripts.py +4932 -0
  352. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_styles.py +1657 -0
  353. scitex/fts/_fig/_editor/_gui/_flask_editor.py +36 -0
  354. scitex/fts/_fig/_models/_Annotations.py +115 -0
  355. scitex/fts/_fig/_models/_Axes.py +152 -0
  356. scitex/fts/_fig/_models/_Figure.py +138 -0
  357. scitex/fts/_fig/_models/_Guides.py +104 -0
  358. scitex/fts/_fig/_models/_Plot.py +123 -0
  359. scitex/fts/_fig/_models/_Styles.py +245 -0
  360. scitex/fts/_fig/_models/__init__.py +80 -0
  361. scitex/fts/_fig/_models/_plot_types/__init__.py +156 -0
  362. scitex/fts/_fig/_models/_plot_types/_bar.py +43 -0
  363. scitex/fts/_fig/_models/_plot_types/_box.py +38 -0
  364. scitex/fts/_fig/_models/_plot_types/_distribution.py +36 -0
  365. scitex/fts/_fig/_models/_plot_types/_errorbar.py +60 -0
  366. scitex/fts/_fig/_models/_plot_types/_histogram.py +30 -0
  367. scitex/fts/_fig/_models/_plot_types/_image.py +61 -0
  368. scitex/fts/_fig/_models/_plot_types/_line.py +57 -0
  369. scitex/fts/_fig/_models/_plot_types/_scatter.py +30 -0
  370. scitex/fts/_fig/_models/_plot_types/_seaborn.py +121 -0
  371. scitex/fts/_fig/_models/_plot_types/_violin.py +36 -0
  372. scitex/fts/_fig/_utils/__init__.py +129 -0
  373. scitex/fts/_fig/_utils/_auto_layout.py +127 -0
  374. scitex/fts/_fig/_utils/_calc_bounds.py +111 -0
  375. scitex/fts/_fig/_utils/_const_sizes.py +48 -0
  376. scitex/fts/_fig/_utils/_convert_coords.py +77 -0
  377. scitex/fts/_fig/_utils/_get_template.py +178 -0
  378. scitex/fts/_fig/_utils/_normalize.py +73 -0
  379. scitex/fts/_fig/_utils/_plot_layout.py +397 -0
  380. scitex/fts/_fig/_utils/_validate.py +197 -0
  381. scitex/fts/_kinds/__init__.py +45 -0
  382. scitex/fts/_kinds/_figure/__init__.py +19 -0
  383. scitex/fts/_kinds/_figure/_composite.py +345 -0
  384. scitex/fts/_kinds/_plot/__init__.py +25 -0
  385. scitex/fts/_kinds/_plot/_backend/__init__.py +53 -0
  386. scitex/fts/_kinds/_plot/_backend/_export.py +165 -0
  387. scitex/fts/_kinds/_plot/_backend/_parser.py +188 -0
  388. scitex/fts/_kinds/_plot/_backend/_render.py +538 -0
  389. scitex/fts/_kinds/_plot/_dataclasses/_ChannelEncoding.py +46 -0
  390. scitex/fts/_kinds/_plot/_dataclasses/_Encoding.py +82 -0
  391. scitex/fts/_kinds/_plot/_dataclasses/_Theme.py +441 -0
  392. scitex/fts/_kinds/_plot/_dataclasses/_TraceEncoding.py +52 -0
  393. scitex/fts/_kinds/_plot/_dataclasses/__init__.py +47 -0
  394. scitex/fts/_kinds/_plot/_models/_Annotations.py +115 -0
  395. scitex/fts/_kinds/_plot/_models/_Axes.py +152 -0
  396. scitex/fts/_kinds/_plot/_models/_Figure.py +138 -0
  397. scitex/fts/_kinds/_plot/_models/_Guides.py +104 -0
  398. scitex/fts/_kinds/_plot/_models/_Plot.py +123 -0
  399. scitex/fts/_kinds/_plot/_models/_Styles.py +245 -0
  400. scitex/fts/_kinds/_plot/_models/__init__.py +80 -0
  401. scitex/fts/_kinds/_plot/_models/_plot_types/__init__.py +156 -0
  402. scitex/fts/_kinds/_plot/_models/_plot_types/_bar.py +43 -0
  403. scitex/fts/_kinds/_plot/_models/_plot_types/_box.py +38 -0
  404. scitex/fts/_kinds/_plot/_models/_plot_types/_distribution.py +36 -0
  405. scitex/fts/_kinds/_plot/_models/_plot_types/_errorbar.py +60 -0
  406. scitex/fts/_kinds/_plot/_models/_plot_types/_histogram.py +30 -0
  407. scitex/fts/_kinds/_plot/_models/_plot_types/_image.py +61 -0
  408. scitex/fts/_kinds/_plot/_models/_plot_types/_line.py +57 -0
  409. scitex/fts/_kinds/_plot/_models/_plot_types/_scatter.py +30 -0
  410. scitex/fts/_kinds/_plot/_models/_plot_types/_seaborn.py +121 -0
  411. scitex/fts/_kinds/_plot/_models/_plot_types/_violin.py +36 -0
  412. scitex/fts/_kinds/_plot/_utils/__init__.py +129 -0
  413. scitex/fts/_kinds/_plot/_utils/_auto_layout.py +127 -0
  414. scitex/fts/_kinds/_plot/_utils/_calc_bounds.py +111 -0
  415. scitex/fts/_kinds/_plot/_utils/_const_sizes.py +48 -0
  416. scitex/fts/_kinds/_plot/_utils/_convert_coords.py +77 -0
  417. scitex/fts/_kinds/_plot/_utils/_get_template.py +178 -0
  418. scitex/fts/_kinds/_plot/_utils/_normalize.py +73 -0
  419. scitex/fts/_kinds/_plot/_utils/_plot_layout.py +397 -0
  420. scitex/fts/_kinds/_plot/_utils/_validate.py +197 -0
  421. scitex/fts/_kinds/_shape/__init__.py +141 -0
  422. scitex/fts/_kinds/_stats/__init__.py +56 -0
  423. scitex/fts/_kinds/_stats/_dataclasses/_Stats.py +423 -0
  424. scitex/fts/_kinds/_stats/_dataclasses/__init__.py +48 -0
  425. scitex/fts/_kinds/_table/__init__.py +72 -0
  426. scitex/fts/_kinds/_table/_latex/__init__.py +93 -0
  427. scitex/fts/_kinds/_table/_latex/_editor/__init__.py +11 -0
  428. scitex/fts/_kinds/_table/_latex/_editor/_app.py +725 -0
  429. scitex/fts/_kinds/_table/_latex/_export.py +279 -0
  430. scitex/fts/_kinds/_table/_latex/_figure_exporter.py +153 -0
  431. scitex/fts/_kinds/_table/_latex/_stats_formatter.py +274 -0
  432. scitex/fts/_kinds/_table/_latex/_table_exporter.py +362 -0
  433. scitex/fts/_kinds/_table/_latex/_utils.py +369 -0
  434. scitex/fts/_kinds/_table/_latex/_validator.py +445 -0
  435. scitex/fts/_kinds/_text/__init__.py +77 -0
  436. scitex/fts/_schemas/data_info.schema.json +75 -0
  437. scitex/fts/_schemas/encoding.schema.json +90 -0
  438. scitex/fts/_schemas/node.schema.json +145 -0
  439. scitex/fts/_schemas/render_manifest.schema.json +62 -0
  440. scitex/fts/_schemas/stats.schema.json +132 -0
  441. scitex/fts/_schemas/theme.schema.json +141 -0
  442. scitex/fts/_stats/__init__.py +48 -0
  443. scitex/fts/_stats/_dataclasses/_Stats.py +423 -0
  444. scitex/fts/_stats/_dataclasses/__init__.py +48 -0
  445. scitex/fts/_tables/__init__.py +65 -0
  446. scitex/fts/_tables/_latex/__init__.py +93 -0
  447. scitex/fts/_tables/_latex/_editor/__init__.py +11 -0
  448. scitex/fts/_tables/_latex/_editor/_app.py +725 -0
  449. scitex/fts/_tables/_latex/_export.py +279 -0
  450. scitex/fts/_tables/_latex/_figure_exporter.py +153 -0
  451. scitex/fts/_tables/_latex/_stats_formatter.py +274 -0
  452. scitex/fts/_tables/_latex/_table_exporter.py +362 -0
  453. scitex/fts/_tables/_latex/_utils.py +369 -0
  454. scitex/fts/_tables/_latex/_validator.py +445 -0
  455. scitex/gen/__init__.py +66 -25
  456. scitex/gen/misc.py +28 -0
  457. scitex/io/__init__.py +47 -20
  458. scitex/io/_load.py +87 -36
  459. scitex/io/_load_modules/__init__.py +10 -7
  460. scitex/io/_load_modules/_pandas.py +6 -1
  461. scitex/io/_save.py +299 -1556
  462. scitex/io/_save_modules/__init__.py +76 -19
  463. scitex/io/_save_modules/_figure_utils.py +90 -0
  464. scitex/io/_save_modules/_image_csv.py +497 -0
  465. scitex/io/_save_modules/_legends.py +91 -0
  466. scitex/io/_save_modules/_pltz_bundle.py +356 -0
  467. scitex/io/_save_modules/_pltz_stx.py +536 -0
  468. scitex/io/_save_modules/_stx_bundle.py +104 -0
  469. scitex/io/_save_modules/_symlink.py +96 -0
  470. scitex/io/_save_modules/_yaml.py +1 -1
  471. scitex/io/_save_modules/_zarr.py +64 -18
  472. scitex/io/bundle/README.md +212 -0
  473. scitex/io/bundle/__init__.py +110 -0
  474. scitex/io/{_bundle.py → bundle/_core.py} +219 -89
  475. scitex/io/bundle/_nested.py +713 -0
  476. scitex/io/bundle/_types.py +74 -0
  477. scitex/io/bundle/_zip.py +487 -0
  478. scitex/io/utils/h5_to_zarr.py +1 -1
  479. scitex/logging/__init__.py +108 -13
  480. scitex/logging/_errors.py +508 -0
  481. scitex/logging/_formatters.py +30 -6
  482. scitex/logging/_warnings.py +261 -0
  483. scitex/plt/__init__.py +4 -1
  484. scitex/plt/_figrecipe.py +236 -0
  485. scitex/plt/_subplots/_AxisWrapper.py +6 -0
  486. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +0 -0
  487. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +0 -0
  488. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +0 -0
  489. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +0 -0
  490. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +0 -0
  491. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +0 -0
  492. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +0 -0
  493. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +0 -0
  494. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +0 -0
  495. scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +0 -0
  496. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +0 -0
  497. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +0 -0
  498. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +0 -0
  499. scitex/plt/_subplots/_AxisWrapperMixins/_UnitAwareMixin.py +112 -1
  500. scitex/plt/_subplots/_FigWrapper.py +15 -0
  501. scitex/plt/_subplots/_SubplotsWrapper.py +125 -489
  502. scitex/plt/_subplots/_export_as_csv.py +11 -0
  503. scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +2 -0
  504. scitex/plt/_subplots/_export_as_csv_formatters/_format_pcolormesh.py +66 -0
  505. scitex/plt/_subplots/_export_as_csv_formatters/_format_stackplot.py +62 -0
  506. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +0 -0
  507. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +0 -0
  508. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +0 -0
  509. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +0 -0
  510. scitex/plt/_subplots/_export_as_csv_formatters/test_formatters.py +208 -0
  511. scitex/plt/_subplots/_fonts.py +71 -0
  512. scitex/plt/_subplots/_mm_layout.py +282 -0
  513. scitex/plt/gallery/__init__.py +99 -2
  514. scitex/plt/io/_layered_bundle.py +0 -0
  515. scitex/plt/styles/_plot_postprocess.py +3 -1
  516. scitex/plt/utils/_configure_mpl.py +16 -19
  517. scitex/repro/_RandomStateManager.py +13 -8
  518. scitex/resource/__init__.py +19 -1
  519. scitex/resource/_utils/_get_env_info.py +13 -25
  520. scitex/schema/__init__.py +149 -160
  521. scitex/schema/_encoding.py +273 -0
  522. scitex/schema/_figure_elements.py +406 -0
  523. scitex/schema/_plot.py +0 -0
  524. scitex/schema/_theme.py +360 -0
  525. scitex/schema/_validation.py +0 -98
  526. scitex/scholar/__init__.py +56 -14
  527. scitex/scholar/auth/ScholarAuthManager.py +1 -1
  528. scitex/scholar/auth/__init__.py +11 -2
  529. scitex/scholar/auth/providers/BaseAuthenticator.py +1 -1
  530. scitex/scholar/auth/providers/EZProxyAuthenticator.py +1 -1
  531. scitex/scholar/auth/providers/OpenAthensAuthenticator.py +1 -1
  532. scitex/scholar/auth/providers/ShibbolethAuthenticator.py +1 -1
  533. scitex/scholar/config/ScholarConfig.py +1 -1
  534. scitex/scholar/core/Scholar.py +1 -1
  535. scitex/session/_decorator.py +18 -16
  536. scitex/session/_lifecycle.py +9 -11
  537. scitex/session/template.py +9 -8
  538. scitex/sh/test_sh.py +72 -0
  539. scitex/sh/test_sh_simple.py +61 -0
  540. scitex/stats/__init__.py +221 -97
  541. scitex/stats/_schema.py +21 -22
  542. scitex/stats/descriptive/_circular.py +212 -351
  543. scitex/stats/descriptive/_describe.py +81 -132
  544. scitex/stats/descriptive/_nan.py +205 -433
  545. scitex/stats/descriptive/_real.py +127 -141
  546. scitex/str/_format_plot_text.py +5 -5
  547. scitex/str/_latex.py +26 -84
  548. scitex/str/_latex_fallback.py +53 -47
  549. scitex/web/_search_pubmed.py +5 -4
  550. scitex/writer/tests/test_diff_between.py +451 -0
  551. scitex/writer/tests/test_document_section.py +311 -0
  552. scitex/writer/tests/test_document_workflow.py +393 -0
  553. scitex/writer/tests/test_writer.py +361 -0
  554. scitex/writer/tests/test_writer_integration.py +303 -0
  555. {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/METADATA +364 -181
  556. {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/RECORD +479 -108
  557. scitex/fig/editor/_edit.py +0 -751
  558. scitex/scholar/docs/to_claude/guidelines/examples/mgmt/ARCHITECTURE_EXAMPLE.md +0 -905
  559. scitex/scholar/docs/to_claude/guidelines/examples/mgmt/BULLETIN_BOARD_EXAMPLE.md +0 -99
  560. scitex/scholar/docs/to_claude/guidelines/examples/mgmt/PROJECT_DESCRIPTION_EXAMPLE.md +0 -96
  561. {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/WHEEL +0 -0
  562. {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/entry_points.txt +0 -0
  563. {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/licenses/LICENSE +0 -0
scitex/__init__.py CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Timestamp: "2025-07-14 15:28:49 (ywatanabe)"
4
3
  # File: /ssh:ywatanabe@sp:/home/ywatanabe/proj/SciTeX-Code/src/scitex/__init__.py
5
4
  # ----------------------------------------
@@ -16,14 +15,15 @@ Modules are imported on-demand to avoid circular dependencies.
16
15
 
17
16
  import warnings
18
17
 
19
- # Always show our own deprecation warnings first
20
- warnings.filterwarnings("always", category=DeprecationWarning, module="scitex.*")
21
- # Then ignore others
22
- warnings.filterwarnings("ignore", category=DeprecationWarning)
18
+ # Show deprecation warnings from scitex modules (educational for migration)
19
+ warnings.filterwarnings("default", category=DeprecationWarning, module="scitex.*")
23
20
 
24
21
  # Version
25
22
  from .__version__ import __version__
26
23
 
24
+ # Installation guide - show users what modules are available
25
+ from ._install_guide import show_install_guide
26
+
27
27
 
28
28
  # Sentinel object for decorator-injected parameters
29
29
  class _InjectedSentinel:
@@ -145,7 +145,8 @@ resource = _LazyModule("resource")
145
145
  tex = _LazyModule("tex")
146
146
  linalg = _LazyModule("linalg")
147
147
  parallel = _LazyModule("parallel")
148
- dt = _LazyModule("dt")
148
+ datetime = _LazyModule("datetime")
149
+ dt = _LazyModule("dt") # Alias for datetime (shorter name)
149
150
  types = _LazyModule("types")
150
151
  utils = _LazyModule("utils")
151
152
  etc = _LazyModule("etc")
@@ -163,6 +164,10 @@ cloud = _LazyModule("cloud")
163
164
  config = _LazyModule("config")
164
165
  audio = _LazyModule("audio")
165
166
  msword = _LazyModule("msword")
167
+ fts = _LazyModule(
168
+ "fts"
169
+ ) # Figure-Table-Statistics - single source of truth for bundle schemas
170
+ fsb = fts # Legacy alias (FSB -> FTS)
166
171
 
167
172
  # Centralized path configuration - eager loaded for convenience
168
173
  # Usage: scitex.PATHS.logs, scitex.PATHS.cache, etc.
@@ -214,7 +219,8 @@ __all__ = [
214
219
  "tex",
215
220
  "linalg",
216
221
  "parallel",
217
- "dt",
222
+ "datetime",
223
+ "dt", # Alias for datetime (shorter name)
218
224
  "types",
219
225
  "utils",
220
226
  "etc",
@@ -225,6 +231,8 @@ __all__ = [
225
231
  "config",
226
232
  "audio",
227
233
  "msword",
234
+ "fts",
235
+ "fsb", # Legacy alias
228
236
  "PATHS",
229
237
  "INJECTED",
230
238
  ]
scitex/__version__.py CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Timestamp: "2025-05-31 00:20:14 (ywatanabe)"
4
3
  # File: /ssh:ywatanabe@sp:/home/ywatanabe/proj/.claude-worktree/scitex_repo/src/scitex/__version__.py
5
4
  # ----------------------------------------
@@ -9,6 +8,6 @@ __FILE__ = "./src/scitex/__version__.py"
9
8
  __DIR__ = os.path.dirname(__FILE__)
10
9
  # ----------------------------------------
11
10
 
12
- __version__ = "2.7.3"
11
+ __version__ = "2.10.0"
13
12
 
14
13
  # EOF
@@ -0,0 +1,250 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Installation guide and module dependency checking for SciTeX.
4
+
5
+ This module provides helpers to check module dependencies and show
6
+ helpful installation guides when dependencies are missing.
7
+ """
8
+
9
+ import functools
10
+ import importlib
11
+ import warnings
12
+ from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
13
+
14
+ from ._optional_deps import PACKAGE_TO_EXTRA, check_optional_deps
15
+
16
+ F = TypeVar("F", bound=Callable[..., Any])
17
+
18
+ # Module name -> (required_packages, extra_name, description)
19
+ MODULE_REQUIREMENTS: Dict[str, Tuple[List[str], str, str]] = {
20
+ "ai": (["openai", "anthropic"], "ai", "LLM APIs"),
21
+ "audio": (["pyttsx3", "gtts"], "audio", "Text-to-Speech"),
22
+ "benchmark": (["psutil"], "benchmark", "Performance Monitoring"),
23
+ "browser": (["playwright"], "browser", "Web Automation"),
24
+ "capture": (["mss", "PIL"], "capture", "Screenshot Capture"),
25
+ "cli": (["click"], "cli", "Command Line Interface"),
26
+ "db": (["sqlalchemy"], "db", "Database"),
27
+ "decorators": (["joblib"], "decorators", "Caching Utilities"),
28
+ "dsp": (["scipy", "sounddevice"], "dsp", "Signal Processing"),
29
+ "fts": (["matplotlib", "PIL", "flask"], "fts", "Figures/Tables/Stats"),
30
+ "gen": (["IPython", "h5py"], "gen", "General Utilities"),
31
+ "git": (["git"], "git", "Git Operations"),
32
+ "io": (["h5py", "openpyxl"], "io", "File I/O"),
33
+ "linalg": (["scipy", "sympy"], "linalg", "Linear Algebra"),
34
+ "msword": (["docx"], "msword", "MS Word"),
35
+ "neuro": (["mne"], "neuro", "Neuroscience"),
36
+ "nn": (["torch"], "nn", "Neural Networks"),
37
+ "path": (["git"], "path", "Path Utilities"),
38
+ "plt": (["matplotlib", "seaborn"], "plt", "Plotting"),
39
+ "repro": (["torch"], "repro", "Reproducibility"),
40
+ "resource": (["psutil"], "resource", "Resource Monitoring"),
41
+ "scholar": (["selenium", "bs4", "playwright"], "scholar", "Paper Management"),
42
+ "stats": (["scipy", "statsmodels"], "stats", "Statistical Analysis"),
43
+ "str": (["natsort"], "str", "String Utilities"),
44
+ "torch": (["torch"], "torch", "PyTorch Support"),
45
+ "types": (["xarray"], "types", "Type Utilities"),
46
+ "web": (["aiohttp", "bs4"], "web", "Web Utilities"),
47
+ "writer": (["yq"], "writer", "Academic Writing"),
48
+ }
49
+
50
+
51
+ def check_module_deps(module_name: str) -> Dict[str, Any]:
52
+ """
53
+ Check if a module's dependencies are installed.
54
+
55
+ Args:
56
+ module_name: Name of the scitex module (e.g., 'audio', 'scholar')
57
+
58
+ Returns:
59
+ Dict with keys:
60
+ - available: bool - whether all required deps are installed
61
+ - missing: list - list of missing packages
62
+ - install_cmd: str - command to install missing deps
63
+ - extra: str - the installation extra name
64
+ """
65
+ if module_name not in MODULE_REQUIREMENTS:
66
+ return {"available": True, "missing": [], "install_cmd": "", "extra": ""}
67
+
68
+ required, extra, _desc = MODULE_REQUIREMENTS[module_name]
69
+ available = check_optional_deps(*required)
70
+ missing = [pkg for pkg, is_available in available.items() if not is_available]
71
+
72
+ return {
73
+ "available": len(missing) == 0,
74
+ "missing": missing,
75
+ "install_cmd": f"pip install scitex[{extra}]",
76
+ "extra": extra,
77
+ }
78
+
79
+
80
+ def require_module(module_name: str) -> None:
81
+ """
82
+ Check module dependencies and raise helpful error if missing.
83
+
84
+ Call this at the top of a module's __init__.py to provide
85
+ clear guidance when dependencies aren't installed.
86
+
87
+ Args:
88
+ module_name: Name of the scitex module
89
+
90
+ Raises:
91
+ ImportError: With helpful installation instructions
92
+
93
+ Example:
94
+ # In scitex/audio/__init__.py:
95
+ from scitex._install_guide import require_module
96
+ require_module("audio") # Raises helpful error if deps missing
97
+ """
98
+ result = check_module_deps(module_name)
99
+
100
+ if not result["available"]:
101
+ if module_name in MODULE_REQUIREMENTS:
102
+ _, extra, desc = MODULE_REQUIREMENTS[module_name]
103
+ else:
104
+ extra, desc = "all", module_name
105
+
106
+ missing_str = ", ".join(result["missing"])
107
+ raise ImportError(
108
+ f"\n"
109
+ f"{'=' * 70}\n"
110
+ f"scitex.{module_name} - {desc}\n"
111
+ f"{'=' * 70}\n"
112
+ f"\n"
113
+ f"This module requires dependencies that are not installed:\n"
114
+ f" Missing: {missing_str}\n"
115
+ f"\n"
116
+ f"To use this module, install with:\n"
117
+ f"\n"
118
+ f" {result['install_cmd']}\n"
119
+ f"\n"
120
+ f"Or install all optional dependencies:\n"
121
+ f"\n"
122
+ f" pip install scitex[all]\n"
123
+ f"\n"
124
+ f"{'=' * 70}\n"
125
+ )
126
+
127
+
128
+ def warn_module_deps(module_name: str) -> List[str]:
129
+ """
130
+ Check module dependencies and print warning if missing (non-blocking).
131
+
132
+ Unlike require_module(), this doesn't raise an error, just warns.
133
+
134
+ Args:
135
+ module_name: Name of the scitex module
136
+
137
+ Returns:
138
+ List of missing package names
139
+ """
140
+ result = check_module_deps(module_name)
141
+
142
+ if not result["available"]:
143
+ if module_name in MODULE_REQUIREMENTS:
144
+ _, extra, desc = MODULE_REQUIREMENTS[module_name]
145
+ else:
146
+ extra, desc = "all", module_name
147
+
148
+ missing_str = ", ".join(result["missing"])
149
+ warnings.warn(
150
+ f"\nscitex.{module_name} ({desc}): Some features unavailable.\n"
151
+ f"Missing: {missing_str}\n"
152
+ f"Install with: {result['install_cmd']}\n",
153
+ ImportWarning,
154
+ stacklevel=2,
155
+ )
156
+
157
+ return result["missing"]
158
+
159
+
160
+ def requires(*packages: str, extra: Optional[str] = None):
161
+ """
162
+ Decorator that checks dependencies before function execution.
163
+
164
+ Args:
165
+ *packages: Required package names
166
+ extra: Installation extra name (auto-detected if not provided)
167
+
168
+ Example:
169
+ @requires("torch", "torchvision", extra="dl")
170
+ def train_model(data):
171
+ import torch
172
+ ...
173
+ """
174
+
175
+ def decorator(func: F) -> F:
176
+ @functools.wraps(func)
177
+ def wrapper(*args, **kwargs):
178
+ missing = []
179
+ for pkg in packages:
180
+ try:
181
+ importlib.import_module(pkg)
182
+ except ImportError:
183
+ missing.append(pkg)
184
+
185
+ if missing:
186
+ install_extra = extra
187
+ if install_extra is None:
188
+ pkg_info = PACKAGE_TO_EXTRA.get(missing[0])
189
+ install_extra = pkg_info[1] if pkg_info else "all"
190
+
191
+ missing_str = ", ".join(missing)
192
+ raise ImportError(
193
+ f"\n"
194
+ f"Function '{func.__name__}' requires: {missing_str}\n"
195
+ f"Install with: pip install scitex[{install_extra}]\n"
196
+ )
197
+
198
+ return func(*args, **kwargs)
199
+
200
+ return wrapper # type: ignore
201
+
202
+ return decorator
203
+
204
+
205
+ def show_install_guide(module_name: Optional[str] = None) -> None:
206
+ """
207
+ Print installation guide for scitex modules.
208
+
209
+ Args:
210
+ module_name: Specific module to show guide for, or None for all
211
+
212
+ Example:
213
+ >>> from scitex._install_guide import show_install_guide
214
+ >>> show_install_guide("audio")
215
+ >>> show_install_guide() # Shows all modules
216
+ """
217
+ print("\n" + "=" * 70)
218
+ print("SciTeX Installation Guide")
219
+ print("=" * 70)
220
+
221
+ if module_name:
222
+ if module_name in MODULE_REQUIREMENTS:
223
+ required, extra, desc = MODULE_REQUIREMENTS[module_name]
224
+ result = check_module_deps(module_name)
225
+ status = "Installed" if result["available"] else "Not installed"
226
+
227
+ print(f"\n{module_name} - {desc}")
228
+ print(f" Status: {status}")
229
+ print(f" Install: pip install scitex[{extra}]")
230
+ if not result["available"]:
231
+ print(f" Missing: {', '.join(result['missing'])}")
232
+ else:
233
+ print(f"\nModule '{module_name}' not found.")
234
+ else:
235
+ print("\nModule-oriented installation (install only what you need):\n")
236
+
237
+ for mod_name, (required, extra, desc) in sorted(MODULE_REQUIREMENTS.items()):
238
+ result = check_module_deps(mod_name)
239
+ status = "[ok]" if result["available"] else "[--]"
240
+ print(f" {status} {mod_name:12} pip install scitex[{extra}]")
241
+
242
+ print("\nConvenience groups:\n")
243
+ print(" pip install scitex[science] # scipy, matplotlib, scikit-learn")
244
+ print(" pip install scitex[dl] # PyTorch, transformers")
245
+ print(" pip install scitex[all] # Everything")
246
+
247
+ print("\n" + "=" * 70 + "\n")
248
+
249
+
250
+ # EOF
scitex/_optional_deps.py CHANGED
@@ -1,46 +1,150 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  """
4
3
  Utility for handling optional dependencies with helpful error messages.
4
+
5
+ SciTeX uses module-oriented optional dependencies. Install what you need:
6
+ pip install scitex[audio] # Audio/TTS module
7
+ pip install scitex[scholar] # Paper management
8
+ pip install scitex[stats] # Statistical analysis
9
+ pip install scitex[io] # File I/O operations
10
+ pip install scitex[all] # Everything
11
+
12
+ Multiple modules:
13
+ pip install scitex[audio,scholar,stats]
5
14
  """
6
15
 
7
- from typing import Optional, Dict, Any
8
16
  import importlib
17
+ from typing import Any, Callable, Dict, List, Optional, TypeVar
9
18
 
19
+ F = TypeVar("F", bound=Callable[..., Any])
20
+
21
+ # Mapping of package imports to their installation extras
22
+ # Format: import_name -> (pip_package, install_extra)
23
+ PACKAGE_TO_EXTRA: Dict[str, tuple] = {
24
+ # AI Module
25
+ "openai": ("openai", "ai"),
26
+ "anthropic": ("anthropic", "ai"),
27
+ "google.generativeai": ("google-genai", "ai"),
28
+ "groq": ("groq", "ai"),
29
+ # Audio Module
30
+ "pyttsx3": ("pyttsx3", "audio"),
31
+ "gtts": ("gTTS", "audio"),
32
+ "pydub": ("pydub", "audio"),
33
+ "elevenlabs": ("elevenlabs", "audio"),
34
+ # Benchmark/Resource Module
35
+ "psutil": ("psutil", "benchmark"),
36
+ # Browser/Capture Module
37
+ "playwright": ("playwright", "browser"),
38
+ "mss": ("mss", "capture"),
39
+ # CLI Module
40
+ "click": ("click", "cli"),
41
+ # DB Module
42
+ "sqlalchemy": ("sqlalchemy", "db"),
43
+ "psycopg2": ("psycopg2-binary", "db"),
44
+ # DSP Module
45
+ "sounddevice": ("sounddevice", "dsp"),
46
+ # Gen Module
47
+ "IPython": ("ipython", "gen"),
48
+ "pyperclip": ("pyperclip", "gen"),
49
+ "readchar": ("readchar", "gen"),
50
+ # Git Module
51
+ "git": ("GitPython", "git"),
52
+ # IO Module
53
+ "h5py": ("h5py", "io"),
54
+ "openpyxl": ("openpyxl", "io"),
55
+ "xlrd": ("xlrd", "io"),
56
+ "ruamel": ("ruamel.yaml", "io"),
57
+ "xarray": ("xarray", "io"),
58
+ "zarr": ("zarr", "io"),
59
+ "PIL": ("Pillow", "io"),
60
+ "piexif": ("piexif", "io"),
61
+ "pypdf": ("pypdf", "io"),
62
+ "qrcode": ("qrcode[pil]", "io"),
63
+ "PyPDF2": ("PyPDF2", "io"),
64
+ "fitz": ("PyMuPDF", "io"),
65
+ "pdfplumber": ("pdfplumber", "io"),
66
+ "docx": ("python-docx", "io"),
67
+ "html2text": ("html2text", "io"),
68
+ "plotly": ("plotly", "io"),
69
+ "pymatreader": ("pymatreader", "io"),
70
+ # Linalg Module
71
+ "sympy": ("sympy", "linalg"),
72
+ "geom_median": ("geom_median", "linalg"),
73
+ # MSWord Module
74
+ "pypandoc": ("pypandoc", "msword"),
75
+ # NN Module
76
+ "torch": ("torch", "nn"),
77
+ "torchaudio": ("torchaudio", "nn"),
78
+ "torchsummary": ("torchsummary", "nn"),
79
+ "julius": ("julius", "nn"),
80
+ # PLT Module
81
+ "matplotlib": ("matplotlib", "plt"),
82
+ "seaborn": ("seaborn", "plt"),
83
+ "termplotlib": ("termplotlib", "plt"),
84
+ # Scholar Module
85
+ "selenium": ("selenium", "scholar"),
86
+ "bs4": ("beautifulsoup4", "scholar"),
87
+ "crawl4ai": ("crawl4ai", "scholar"),
88
+ "scholarly": ("scholarly", "scholar"),
89
+ "pymed": ("pymed", "scholar"),
90
+ "pytesseract": ("pytesseract", "scholar"),
91
+ "bibtexparser": ("bibtexparser", "scholar"),
92
+ "feedparser": ("feedparser", "scholar"),
93
+ "httpx": ("httpx", "scholar"),
94
+ "tenacity": ("tenacity", "scholar"),
95
+ "pydantic": ("pydantic", "scholar"),
96
+ "watchdog": ("watchdog", "scholar"),
97
+ # Stats Module
98
+ "scipy": ("scipy", "stats"),
99
+ "statsmodels": ("statsmodels", "stats"),
100
+ # Web Module
101
+ "aiohttp": ("aiohttp", "web"),
102
+ "requests": ("requests", "web"),
103
+ "readability": ("readability-lxml", "web"),
104
+ # Writer Module
105
+ "yq": ("yq", "writer"),
106
+ # DL Module (convenience group)
107
+ "torchvision": ("torchvision", "dl"),
108
+ "transformers": ("transformers", "dl"),
109
+ "accelerate": ("accelerate", "dl"),
110
+ "bitsandbytes": ("bitsandbytes", "dl"),
111
+ "fairscale": ("fairscale", "dl"),
112
+ "einops": ("einops", "dl"),
113
+ # ML Module (convenience group)
114
+ "sklearn": ("scikit-learn", "ml"),
115
+ "skimage": ("scikit-image", "ml"),
116
+ "imblearn": ("imbalanced-learn", "ml"),
117
+ "umap": ("umap-learn", "ml"),
118
+ "sktime": ("sktime", "ml"),
119
+ "catboost": ("catboost", "ml"),
120
+ "optuna": ("optuna", "ml"),
121
+ "cv2": ("opencv-python", "ml"),
122
+ # Jupyter Module
123
+ "jupyterlab": ("jupyterlab", "jupyter"),
124
+ "ipykernel": ("ipykernel", "jupyter"),
125
+ "ipdb": ("ipdb", "jupyter"),
126
+ "papermill": ("papermill", "jupyter"),
127
+ "jupytext": ("jupytext", "jupyter"),
128
+ # Neuro Module
129
+ "mne": ("mne", "neuro"),
130
+ "obspy": ("obspy", "neuro"),
131
+ "pyedflib": ("pyedflib", "neuro"),
132
+ "pybids": ("pybids", "neuro"),
133
+ "tensorpac": ("tensorpac", "neuro"),
134
+ "ripple_detection": ("ripple_detection", "neuro"),
135
+ # Webdev Module
136
+ "fastapi": ("fastapi", "webdev"),
137
+ "flask": ("flask", "webdev"),
138
+ "streamlit": ("streamlit", "webdev"),
139
+ "celery": ("celery", "webdev"),
140
+ # GUI Module
141
+ "dearpygui": ("dearpygui", "gui"),
142
+ "PyQt6": ("PyQt6", "gui"),
143
+ }
10
144
 
11
- # Mapping of modules to their installation extras
145
+ # Backwards compatibility: simple mapping
12
146
  DEPENDENCY_GROUPS: Dict[str, str] = {
13
- # Deep Learning
14
- "torch": "dl",
15
- "torchvision": "dl",
16
- "torchaudio": "dl",
17
- "transformers": "dl",
18
- "accelerate": "dl",
19
- "bitsandbytes": "dl",
20
- "fairscale": "dl",
21
- # AI APIs
22
- "openai": "ai-apis",
23
- "anthropic": "ai-apis",
24
- "google.generativeai": "ai-apis",
25
- "groq": "ai-apis",
26
- # Scholar
27
- "selenium": "scholar",
28
- "playwright": "scholar",
29
- "crawl4ai": "scholar",
30
- "bs4": "scholar",
31
- # Neuroscience
32
- "mne": "neuro",
33
- "obspy": "neuro",
34
- "pyedflib": "neuro",
35
- "tensorpac": "neuro",
36
- # Web
37
- "fastapi": "web",
38
- "flask": "web",
39
- "streamlit": "web",
40
- # Jupyter
41
- "jupyterlab": "jupyter",
42
- "IPython": "jupyter",
43
- "ipykernel": "jupyter",
147
+ module: info[1] for module, info in PACKAGE_TO_EXTRA.items()
44
148
  }
45
149
 
46
150
 
@@ -68,14 +172,18 @@ def optional_import(
68
172
  if not raise_error:
69
173
  return None
70
174
 
71
- pkg_name = package_name or module_name
72
- extra_group = DEPENDENCY_GROUPS.get(module_name, "all")
175
+ pkg_info = PACKAGE_TO_EXTRA.get(module_name)
176
+ if pkg_info:
177
+ pip_pkg, extra = pkg_info
178
+ else:
179
+ pip_pkg = package_name or module_name
180
+ extra = "all"
73
181
 
74
182
  error_msg = (
75
183
  f"\n{'=' * 70}\n"
76
- f"Optional dependency '{pkg_name}' is not installed.\n\n"
184
+ f"Optional dependency '{pip_pkg}' is not installed.\n\n"
77
185
  f"To use this feature, install it with:\n"
78
- f" pip install scitex[{extra_group}]\n\n"
186
+ f" pip install scitex[{extra}]\n\n"
79
187
  f"Or install all optional dependencies:\n"
80
188
  f" pip install scitex[all]\n"
81
189
  f"{'=' * 70}\n"
@@ -108,7 +216,42 @@ def check_optional_deps(*module_names: str) -> Dict[str, bool]:
108
216
  return result
109
217
 
110
218
 
111
- # Convenience: Check common dependency groups
219
+ def get_install_command(module_name: str) -> str:
220
+ """
221
+ Get the pip install command for a module.
222
+
223
+ Args:
224
+ module_name: Name of the module
225
+
226
+ Returns:
227
+ pip install command string
228
+
229
+ Example:
230
+ >>> get_install_command('torch')
231
+ 'pip install scitex[nn]'
232
+ """
233
+ pkg_info = PACKAGE_TO_EXTRA.get(module_name)
234
+ if pkg_info:
235
+ return f"pip install scitex[{pkg_info[1]}]"
236
+ return "pip install scitex[all]"
237
+
238
+
239
+ def list_available_extras() -> List[str]:
240
+ """
241
+ List all available installation extras.
242
+
243
+ Returns:
244
+ List of extra names (e.g., ['audio', 'scholar', 'stats', ...])
245
+ """
246
+ extras = set(info[1] for info in PACKAGE_TO_EXTRA.values())
247
+ # Add convenience groups
248
+ extras.update(
249
+ ["science", "dl", "ml", "jupyter", "neuro", "webdev", "gui", "dev", "all"]
250
+ )
251
+ return sorted(extras)
252
+
253
+
254
+ # Convenience functions for common checks
112
255
  def has_deep_learning() -> bool:
113
256
  """Check if deep learning dependencies are available."""
114
257
  return check_optional_deps("torch")["torch"]
@@ -130,4 +273,28 @@ def has_jupyter() -> bool:
130
273
  return check_optional_deps("IPython")["IPython"]
131
274
 
132
275
 
276
+ def has_audio() -> bool:
277
+ """Check if audio/TTS dependencies are available."""
278
+ deps = check_optional_deps("pyttsx3", "gtts")
279
+ return any(deps.values())
280
+
281
+
282
+ def has_stats() -> bool:
283
+ """Check if stats dependencies are available."""
284
+ return check_optional_deps("scipy", "statsmodels") == {
285
+ "scipy": True,
286
+ "statsmodels": True,
287
+ }
288
+
289
+
290
+ def has_io() -> bool:
291
+ """Check if IO dependencies are available."""
292
+ return check_optional_deps("h5py")["h5py"]
293
+
294
+
295
+ def has_plotting() -> bool:
296
+ """Check if plotting dependencies are available."""
297
+ return check_optional_deps("matplotlib")["matplotlib"]
298
+
299
+
133
300
  # EOF
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-28 02:47:54 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/ai/_gen_ai/_Groq.py
5
4
 
@@ -22,11 +21,9 @@ Prerequisites:
22
21
 
23
22
  """Imports"""
24
23
  import os
25
- import sys
26
- from typing import Any, Dict, Generator, List, Optional, Union
24
+ from typing import Any, Dict, Generator, List, Optional
27
25
 
28
26
  from groq import Groq as _Groq
29
- import matplotlib.pyplot as plt
30
27
 
31
28
  from ._BaseGenAI import BaseGenAI
32
29
 
@@ -55,6 +52,7 @@ class Groq(BaseGenAI):
55
52
  model=model,
56
53
  api_key=api_key,
57
54
  stream=stream,
55
+ seed=seed,
58
56
  n_keep=n_keep,
59
57
  temperature=temperature,
60
58
  provider="Groq",
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Timestamp: "2025-01-22 01:21:11 (ywatanabe)"
4
3
  # File: _OpenAI.py
5
4
 
@@ -8,7 +7,9 @@ THIS_FILE = "/home/ywatanabe/proj/scitex_repo/src/scitex/ai/_gen_ai/_OpenAI.py"
8
7
 
9
8
  """Imports"""
10
9
  import os
10
+
11
11
  from openai import OpenAI as _OpenAI
12
+
12
13
  from ._BaseGenAI import BaseGenAI
13
14
 
14
15
  """Functions & Classes"""
@@ -55,6 +56,7 @@ class OpenAI(BaseGenAI):
55
56
  model=model,
56
57
  api_key=api_key,
57
58
  stream=stream,
59
+ seed=seed,
58
60
  n_keep=n_keep,
59
61
  temperature=temperature,
60
62
  provider="OpenAI",
@@ -148,7 +150,7 @@ class OpenAI(BaseGenAI):
148
150
  if any(char in ".!?\n " for char in current_text):
149
151
  yield buffer
150
152
  buffer = ""
151
- except Exception as e:
153
+ except Exception:
152
154
  pass
153
155
 
154
156
  # Yield any remaining text
@@ -216,6 +218,7 @@ if __name__ == "__main__":
216
218
  import sys
217
219
 
218
220
  import matplotlib.pyplot as plt
221
+
219
222
  import scitex
220
223
 
221
224
  CONFIG, sys.stdout, sys.stderr, plt, CC = scitex.session.start(