scitex 2.7.0__py3-none-any.whl → 2.8.1__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 (355) hide show
  1. scitex/__init__.py +6 -2
  2. scitex/__version__.py +1 -1
  3. scitex/audio/README.md +52 -0
  4. scitex/audio/__init__.py +384 -0
  5. scitex/audio/__main__.py +129 -0
  6. scitex/audio/_tts.py +334 -0
  7. scitex/audio/engines/__init__.py +44 -0
  8. scitex/audio/engines/base.py +275 -0
  9. scitex/audio/engines/elevenlabs_engine.py +143 -0
  10. scitex/audio/engines/gtts_engine.py +162 -0
  11. scitex/audio/engines/pyttsx3_engine.py +131 -0
  12. scitex/audio/mcp_server.py +757 -0
  13. scitex/bridge/_helpers.py +1 -1
  14. scitex/bridge/_plt_vis.py +1 -1
  15. scitex/bridge/_stats_vis.py +1 -1
  16. scitex/dev/plt/__init__.py +272 -0
  17. scitex/dev/plt/plot_mpl_axhline.py +28 -0
  18. scitex/dev/plt/plot_mpl_axhspan.py +28 -0
  19. scitex/dev/plt/plot_mpl_axvline.py +28 -0
  20. scitex/dev/plt/plot_mpl_axvspan.py +28 -0
  21. scitex/dev/plt/plot_mpl_bar.py +29 -0
  22. scitex/dev/plt/plot_mpl_barh.py +29 -0
  23. scitex/dev/plt/plot_mpl_boxplot.py +28 -0
  24. scitex/dev/plt/plot_mpl_contour.py +31 -0
  25. scitex/dev/plt/plot_mpl_contourf.py +31 -0
  26. scitex/dev/plt/plot_mpl_errorbar.py +30 -0
  27. scitex/dev/plt/plot_mpl_eventplot.py +28 -0
  28. scitex/dev/plt/plot_mpl_fill.py +30 -0
  29. scitex/dev/plt/plot_mpl_fill_between.py +31 -0
  30. scitex/dev/plt/plot_mpl_hexbin.py +28 -0
  31. scitex/dev/plt/plot_mpl_hist.py +28 -0
  32. scitex/dev/plt/plot_mpl_hist2d.py +28 -0
  33. scitex/dev/plt/plot_mpl_imshow.py +29 -0
  34. scitex/dev/plt/plot_mpl_pcolormesh.py +31 -0
  35. scitex/dev/plt/plot_mpl_pie.py +29 -0
  36. scitex/dev/plt/plot_mpl_plot.py +29 -0
  37. scitex/dev/plt/plot_mpl_quiver.py +31 -0
  38. scitex/dev/plt/plot_mpl_scatter.py +28 -0
  39. scitex/dev/plt/plot_mpl_stackplot.py +31 -0
  40. scitex/dev/plt/plot_mpl_stem.py +29 -0
  41. scitex/dev/plt/plot_mpl_step.py +29 -0
  42. scitex/dev/plt/plot_mpl_violinplot.py +28 -0
  43. scitex/dev/plt/plot_sns_barplot.py +29 -0
  44. scitex/dev/plt/plot_sns_boxplot.py +29 -0
  45. scitex/dev/plt/plot_sns_heatmap.py +28 -0
  46. scitex/dev/plt/plot_sns_histplot.py +29 -0
  47. scitex/dev/plt/plot_sns_kdeplot.py +29 -0
  48. scitex/dev/plt/plot_sns_lineplot.py +31 -0
  49. scitex/dev/plt/plot_sns_scatterplot.py +29 -0
  50. scitex/dev/plt/plot_sns_stripplot.py +29 -0
  51. scitex/dev/plt/plot_sns_swarmplot.py +29 -0
  52. scitex/dev/plt/plot_sns_violinplot.py +29 -0
  53. scitex/dev/plt/plot_stx_bar.py +29 -0
  54. scitex/dev/plt/plot_stx_barh.py +29 -0
  55. scitex/dev/plt/plot_stx_box.py +28 -0
  56. scitex/dev/plt/plot_stx_boxplot.py +28 -0
  57. scitex/dev/plt/plot_stx_conf_mat.py +28 -0
  58. scitex/dev/plt/plot_stx_contour.py +31 -0
  59. scitex/dev/plt/plot_stx_ecdf.py +28 -0
  60. scitex/dev/plt/plot_stx_errorbar.py +30 -0
  61. scitex/dev/plt/plot_stx_fill_between.py +31 -0
  62. scitex/dev/plt/plot_stx_fillv.py +28 -0
  63. scitex/dev/plt/plot_stx_heatmap.py +28 -0
  64. scitex/dev/plt/plot_stx_image.py +28 -0
  65. scitex/dev/plt/plot_stx_imshow.py +28 -0
  66. scitex/dev/plt/plot_stx_joyplot.py +28 -0
  67. scitex/dev/plt/plot_stx_kde.py +28 -0
  68. scitex/dev/plt/plot_stx_line.py +28 -0
  69. scitex/dev/plt/plot_stx_mean_ci.py +28 -0
  70. scitex/dev/plt/plot_stx_mean_std.py +28 -0
  71. scitex/dev/plt/plot_stx_median_iqr.py +28 -0
  72. scitex/dev/plt/plot_stx_raster.py +28 -0
  73. scitex/dev/plt/plot_stx_rectangle.py +28 -0
  74. scitex/dev/plt/plot_stx_scatter.py +29 -0
  75. scitex/dev/plt/plot_stx_shaded_line.py +29 -0
  76. scitex/dev/plt/plot_stx_violin.py +28 -0
  77. scitex/dev/plt/plot_stx_violinplot.py +28 -0
  78. scitex/diagram/README.md +197 -0
  79. scitex/diagram/__init__.py +48 -0
  80. scitex/diagram/_compile.py +312 -0
  81. scitex/diagram/_diagram.py +355 -0
  82. scitex/diagram/_presets.py +173 -0
  83. scitex/diagram/_schema.py +182 -0
  84. scitex/diagram/_split.py +278 -0
  85. scitex/fig/__init__.py +352 -0
  86. scitex/{vis → fig}/backend/_parser.py +1 -1
  87. scitex/{vis → fig}/canvas.py +1 -1
  88. scitex/{vis → fig}/editor/__init__.py +5 -2
  89. scitex/{vis → fig}/editor/_dearpygui_editor.py +1 -1
  90. scitex/{vis → fig}/editor/_defaults.py +70 -5
  91. scitex/{vis → fig}/editor/_mpl_editor.py +1 -1
  92. scitex/{vis → fig}/editor/_qt_editor.py +182 -2
  93. scitex/{vis → fig}/editor/_tkinter_editor.py +1 -1
  94. scitex/fig/editor/edit/__init__.py +50 -0
  95. scitex/fig/editor/edit/backend_detector.py +109 -0
  96. scitex/fig/editor/edit/bundle_resolver.py +240 -0
  97. scitex/fig/editor/edit/editor_launcher.py +239 -0
  98. scitex/fig/editor/edit/manual_handler.py +53 -0
  99. scitex/fig/editor/edit/panel_loader.py +232 -0
  100. scitex/fig/editor/edit/path_resolver.py +67 -0
  101. scitex/fig/editor/flask_editor/_bbox.py +1299 -0
  102. scitex/fig/editor/flask_editor/_core.py +1429 -0
  103. scitex/{vis → fig}/editor/flask_editor/_plotter.py +38 -4
  104. scitex/fig/editor/flask_editor/_renderer.py +813 -0
  105. scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
  106. scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
  107. scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
  108. scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
  109. scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
  110. scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
  111. scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
  112. scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
  113. scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
  114. scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
  115. scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
  116. scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
  117. scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
  118. scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
  119. scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
  120. scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
  121. scitex/fig/editor/flask_editor/static/css/index.css +31 -0
  122. scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
  123. scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
  124. scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
  125. scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
  126. scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
  127. scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
  128. scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
  129. scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
  130. scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
  131. scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
  132. scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
  133. scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
  134. scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
  135. scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
  136. scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
  137. scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
  138. scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
  139. scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
  140. scitex/fig/editor/flask_editor/static/js/main.js +426 -0
  141. scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
  142. scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
  143. scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
  144. scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
  145. scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
  146. scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
  147. scitex/fig/editor/flask_editor/templates/__init__.py +123 -0
  148. scitex/fig/editor/flask_editor/templates/_html.py +852 -0
  149. scitex/fig/editor/flask_editor/templates/_scripts.py +4933 -0
  150. scitex/fig/editor/flask_editor/templates/_styles.py +1658 -0
  151. scitex/{vis → fig}/io/__init__.py +13 -1
  152. scitex/fig/io/_bundle.py +1058 -0
  153. scitex/{vis → fig}/io/_canvas.py +1 -1
  154. scitex/{vis → fig}/io/_data.py +1 -1
  155. scitex/{vis → fig}/io/_export.py +1 -1
  156. scitex/{vis → fig}/io/_load.py +1 -1
  157. scitex/{vis → fig}/io/_panel.py +1 -1
  158. scitex/{vis → fig}/io/_save.py +1 -1
  159. scitex/{vis → fig}/model/__init__.py +1 -1
  160. scitex/{vis → fig}/model/_annotations.py +1 -1
  161. scitex/{vis → fig}/model/_axes.py +1 -1
  162. scitex/{vis → fig}/model/_figure.py +1 -1
  163. scitex/{vis → fig}/model/_guides.py +1 -1
  164. scitex/{vis → fig}/model/_plot.py +1 -1
  165. scitex/{vis → fig}/model/_styles.py +1 -1
  166. scitex/{vis → fig}/utils/__init__.py +1 -1
  167. scitex/io/__init__.py +22 -26
  168. scitex/io/_bundle.py +493 -0
  169. scitex/io/_flush.py +5 -2
  170. scitex/io/_load.py +98 -0
  171. scitex/io/_load_modules/_H5Explorer.py +5 -2
  172. scitex/io/_load_modules/_canvas.py +2 -2
  173. scitex/io/_load_modules/_image.py +3 -4
  174. scitex/io/_load_modules/_txt.py +4 -2
  175. scitex/io/_metadata.py +34 -324
  176. scitex/io/_metadata_modules/__init__.py +46 -0
  177. scitex/io/_metadata_modules/_embed.py +70 -0
  178. scitex/io/_metadata_modules/_read.py +64 -0
  179. scitex/io/_metadata_modules/_utils.py +79 -0
  180. scitex/io/_metadata_modules/embed_metadata_jpeg.py +74 -0
  181. scitex/io/_metadata_modules/embed_metadata_pdf.py +53 -0
  182. scitex/io/_metadata_modules/embed_metadata_png.py +26 -0
  183. scitex/io/_metadata_modules/embed_metadata_svg.py +62 -0
  184. scitex/io/_metadata_modules/read_metadata_jpeg.py +57 -0
  185. scitex/io/_metadata_modules/read_metadata_pdf.py +51 -0
  186. scitex/io/_metadata_modules/read_metadata_png.py +39 -0
  187. scitex/io/_metadata_modules/read_metadata_svg.py +44 -0
  188. scitex/io/_qr_utils.py +5 -3
  189. scitex/io/_save.py +548 -30
  190. scitex/io/_save_modules/_canvas.py +3 -3
  191. scitex/io/_save_modules/_image.py +5 -9
  192. scitex/io/_save_modules/_tex.py +7 -4
  193. scitex/io/_zip_bundle.py +439 -0
  194. scitex/io/utils/h5_to_zarr.py +11 -9
  195. scitex/msword/__init__.py +255 -0
  196. scitex/msword/profiles.py +357 -0
  197. scitex/msword/reader.py +753 -0
  198. scitex/msword/utils.py +289 -0
  199. scitex/msword/writer.py +362 -0
  200. scitex/plt/__init__.py +5 -2
  201. scitex/plt/_subplots/_AxesWrapper.py +6 -6
  202. scitex/plt/_subplots/_AxisWrapper.py +15 -9
  203. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +36 -0
  204. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +264 -0
  205. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +213 -0
  206. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +128 -0
  207. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +59 -0
  208. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +34 -0
  209. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +593 -0
  210. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +654 -0
  211. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +527 -0
  212. scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +321 -0
  213. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +33 -0
  214. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +152 -0
  215. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +600 -0
  216. scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +79 -5
  217. scitex/plt/_subplots/_FigWrapper.py +6 -6
  218. scitex/plt/_subplots/_SubplotsWrapper.py +28 -18
  219. scitex/plt/_subplots/_export_as_csv.py +35 -5
  220. scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +8 -0
  221. scitex/plt/_subplots/_export_as_csv_formatters/_format_annotate.py +10 -21
  222. scitex/plt/_subplots/_export_as_csv_formatters/_format_eventplot.py +18 -7
  223. scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py +28 -12
  224. scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py +10 -4
  225. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_imshow.py +13 -1
  226. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_kde.py +12 -2
  227. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_scatter.py +10 -3
  228. scitex/plt/_subplots/_export_as_csv_formatters/_format_quiver.py +10 -4
  229. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_jointplot.py +18 -3
  230. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_lineplot.py +44 -36
  231. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_pairplot.py +14 -2
  232. scitex/plt/_subplots/_export_as_csv_formatters/_format_streamplot.py +11 -5
  233. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +84 -0
  234. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +85 -0
  235. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_conf_mat.py +14 -3
  236. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_contour.py +54 -0
  237. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_ecdf.py +14 -2
  238. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +120 -0
  239. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_heatmap.py +16 -6
  240. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_image.py +29 -19
  241. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_imshow.py +63 -0
  242. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_joyplot.py +22 -5
  243. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py +18 -14
  244. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py +18 -14
  245. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py +18 -14
  246. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_raster.py +10 -2
  247. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +51 -0
  248. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter_hist.py +18 -9
  249. scitex/plt/ax/_plot/_stx_ecdf.py +4 -2
  250. scitex/plt/gallery/_generate.py +421 -14
  251. scitex/plt/io/__init__.py +53 -0
  252. scitex/plt/io/_bundle.py +490 -0
  253. scitex/plt/io/_layered_bundle.py +1343 -0
  254. scitex/plt/styles/SCITEX_STYLE.yaml +26 -0
  255. scitex/plt/styles/__init__.py +14 -0
  256. scitex/plt/styles/presets.py +78 -0
  257. scitex/plt/utils/__init__.py +13 -1
  258. scitex/plt/utils/_collect_figure_metadata.py +10 -14
  259. scitex/plt/utils/_configure_mpl.py +6 -18
  260. scitex/plt/utils/_crop.py +32 -14
  261. scitex/plt/utils/_csv_column_naming.py +54 -0
  262. scitex/plt/utils/_figure_mm.py +116 -1
  263. scitex/plt/utils/_hitmap.py +1643 -0
  264. scitex/plt/utils/metadata/__init__.py +25 -0
  265. scitex/plt/utils/metadata/_core.py +9 -10
  266. scitex/plt/utils/metadata/_dimensions.py +6 -3
  267. scitex/plt/utils/metadata/_editable_export.py +405 -0
  268. scitex/plt/utils/metadata/_geometry_extraction.py +570 -0
  269. scitex/schema/__init__.py +109 -16
  270. scitex/schema/_canvas.py +1 -1
  271. scitex/schema/_plot.py +1015 -0
  272. scitex/schema/_stats.py +2 -2
  273. scitex/stats/__init__.py +117 -0
  274. scitex/stats/io/__init__.py +29 -0
  275. scitex/stats/io/_bundle.py +156 -0
  276. scitex/tex/__init__.py +4 -0
  277. scitex/tex/_export.py +890 -0
  278. {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/METADATA +11 -1
  279. {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/RECORD +294 -170
  280. scitex/io/memo.md +0 -2827
  281. scitex/plt/REQUESTS.md +0 -191
  282. scitex/plt/_subplots/TODO.md +0 -53
  283. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin.py +0 -559
  284. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py +0 -1609
  285. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin.py +0 -447
  286. scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_between.json +0 -110
  287. scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_betweenx.json +0 -88
  288. scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fill_between.json +0 -103
  289. scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fillv.json +0 -106
  290. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/bar.json +0 -92
  291. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/barh.json +0 -92
  292. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/boxplot.json +0 -92
  293. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_bar.json +0 -84
  294. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_barh.json +0 -84
  295. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_box.json +0 -83
  296. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_boxplot.json +0 -93
  297. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violin.json +0 -91
  298. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violinplot.json +0 -91
  299. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/violinplot.json +0 -91
  300. scitex/plt/templates/research-master/scitex/vis/gallery/contour/contour.json +0 -97
  301. scitex/plt/templates/research-master/scitex/vis/gallery/contour/contourf.json +0 -98
  302. scitex/plt/templates/research-master/scitex/vis/gallery/contour/stx_contour.json +0 -84
  303. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist.json +0 -101
  304. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist2d.json +0 -96
  305. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_ecdf.json +0 -95
  306. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_joyplot.json +0 -95
  307. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_kde.json +0 -93
  308. scitex/plt/templates/research-master/scitex/vis/gallery/grid/imshow.json +0 -95
  309. scitex/plt/templates/research-master/scitex/vis/gallery/grid/matshow.json +0 -95
  310. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_conf_mat.json +0 -83
  311. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_heatmap.json +0 -92
  312. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_image.json +0 -121
  313. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_imshow.json +0 -84
  314. scitex/plt/templates/research-master/scitex/vis/gallery/line/plot.json +0 -110
  315. scitex/plt/templates/research-master/scitex/vis/gallery/line/step.json +0 -92
  316. scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_line.json +0 -95
  317. scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_shaded_line.json +0 -96
  318. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/hexbin.json +0 -95
  319. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/scatter.json +0 -95
  320. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stem.json +0 -92
  321. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stx_scatter.json +0 -84
  322. scitex/plt/templates/research-master/scitex/vis/gallery/special/pie.json +0 -94
  323. scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_raster.json +0 -109
  324. scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_rectangle.json +0 -108
  325. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/errorbar.json +0 -93
  326. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_errorbar.json +0 -84
  327. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_ci.json +0 -96
  328. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_std.json +0 -96
  329. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_median_iqr.json +0 -96
  330. scitex/plt/templates/research-master/scitex/vis/gallery/vector/quiver.json +0 -99
  331. scitex/plt/templates/research-master/scitex/vis/gallery/vector/streamplot.json +0 -100
  332. scitex/vis/__init__.py +0 -177
  333. scitex/vis/editor/_edit.py +0 -390
  334. scitex/vis/editor/flask_editor/_bbox.py +0 -529
  335. scitex/vis/editor/flask_editor/_core.py +0 -168
  336. scitex/vis/editor/flask_editor/_renderer.py +0 -393
  337. scitex/vis/editor/flask_editor/templates/__init__.py +0 -33
  338. scitex/vis/editor/flask_editor/templates/_html.py +0 -513
  339. scitex/vis/editor/flask_editor/templates/_scripts.py +0 -1261
  340. scitex/vis/editor/flask_editor/templates/_styles.py +0 -739
  341. /scitex/{vis → fig}/README.md +0 -0
  342. /scitex/{vis → fig}/backend/__init__.py +0 -0
  343. /scitex/{vis → fig}/backend/_export.py +0 -0
  344. /scitex/{vis → fig}/backend/_render.py +0 -0
  345. /scitex/{vis → fig}/docs/CANVAS_ARCHITECTURE.md +0 -0
  346. /scitex/{vis → fig}/editor/_flask_editor.py +0 -0
  347. /scitex/{vis → fig}/editor/flask_editor/__init__.py +0 -0
  348. /scitex/{vis → fig}/editor/flask_editor/_utils.py +0 -0
  349. /scitex/{vis → fig}/io/_directory.py +0 -0
  350. /scitex/{vis → fig}/model/_plot_types.py +0 -0
  351. /scitex/{vis → fig}/utils/_defaults.py +0 -0
  352. /scitex/{vis → fig}/utils/_validate.py +0 -0
  353. {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/WHEEL +0 -0
  354. {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/entry_points.txt +0 -0
  355. {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/licenses/LICENSE +0 -0
@@ -12,6 +12,9 @@ __DIR__ = os.path.dirname(__FILE__)
12
12
  import numpy as np
13
13
  import pandas as pd
14
14
 
15
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
16
+ from ._format_plot import _parse_tracking_id
17
+
15
18
 
16
19
  def _format_plot_heatmap(id, tracked_dict, kwargs):
17
20
  """Format data from a stx_heatmap call.
@@ -39,12 +42,15 @@ def _format_plot_heatmap(id, tracked_dict, kwargs):
39
42
  rows, cols = data.shape
40
43
  row_indices, col_indices = np.meshgrid(range(rows), range(cols), indexing="ij")
41
44
 
42
- # Format data in xyz format (x, y, value)
45
+ # Parse the tracking ID to get axes position and trace ID
46
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
47
+
48
+ # Format data in xyz format (x, y, value) using single source of truth
43
49
  df = pd.DataFrame(
44
50
  {
45
- f"{id}_x": col_indices.flatten(), # x is column
46
- f"{id}_y": row_indices.flatten(), # y is row
47
- f"{id}_value": data.flatten(), # z is intensity/value
51
+ get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id): col_indices.flatten(), # x is column
52
+ get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id): row_indices.flatten(), # y is row
53
+ get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id): data.flatten(), # z is intensity/value
48
54
  }
49
55
  )
50
56
 
@@ -52,12 +58,16 @@ def _format_plot_heatmap(id, tracked_dict, kwargs):
52
58
  if x_labels is not None and len(x_labels) == cols:
53
59
  # Map column indices to x labels (columns are x)
54
60
  x_label_map = {i: label for i, label in enumerate(x_labels)}
55
- df[f"{id}_x_label"] = df[f"{id}_x"].map(x_label_map)
61
+ x_col_name = get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id)
62
+ x_label_col_name = get_csv_column_name("x_label", ax_row, ax_col, trace_id=trace_id)
63
+ df[x_label_col_name] = df[x_col_name].map(x_label_map)
56
64
 
57
65
  if y_labels is not None and len(y_labels) == rows:
58
66
  # Map row indices to y labels (rows are y)
59
67
  y_label_map = {i: label for i, label in enumerate(y_labels)}
60
- df[f"{id}_y_label"] = df[f"{id}_y"].map(y_label_map)
68
+ y_col_name = get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id)
69
+ y_label_col_name = get_csv_column_name("y_label", ax_row, ax_col, trace_id=trace_id)
70
+ df[y_label_col_name] = df[y_col_name].map(y_label_map)
61
71
 
62
72
  return df
63
73
 
@@ -7,6 +7,9 @@ import os
7
7
  import numpy as np
8
8
  import pandas as pd
9
9
 
10
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
11
+ from ._format_plot import _parse_tracking_id
12
+
10
13
  __FILE__ = __file__
11
14
  __DIR__ = os.path.dirname(__FILE__)
12
15
  # ----------------------------------------
@@ -30,6 +33,9 @@ def _format_plot_image(id, tracked_dict, kwargs):
30
33
  if not tracked_dict or not isinstance(tracked_dict, dict):
31
34
  return pd.DataFrame()
32
35
 
36
+ # Parse the tracking ID to get axes position and trace ID
37
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
38
+
33
39
  # Check if image_df is available and use it if present
34
40
  if "image_df" in tracked_dict:
35
41
  image_df = tracked_dict.get("image_df")
@@ -37,19 +43,20 @@ def _format_plot_image(id, tracked_dict, kwargs):
37
43
  # Add prefix if ID is provided
38
44
  if id is not None:
39
45
  image_df = image_df.copy()
40
- id_str = str(id)
41
- # Convert columns to strings first to handle integer column names
42
- image_df.columns = [str(col) for col in image_df.columns]
43
- image_df.columns = [
44
- f"{id_str}_{col}" if not col.startswith(f"{id_str}_") else col
45
- for col in image_df.columns
46
- ]
46
+ # Rename columns using single source of truth
47
+ renamed = {}
48
+ for col in image_df.columns:
49
+ # Convert to string to handle integer column names
50
+ col_str = str(col)
51
+ renamed[col] = get_csv_column_name(
52
+ col_str, ax_row, ax_col, trace_id=trace_id
53
+ )
54
+ image_df = image_df.rename(columns=renamed)
47
55
  return image_df
48
56
 
49
57
  # If we have image data
50
58
  if "image" in tracked_dict:
51
59
  img = tracked_dict["image"]
52
- id_str = str(id) if id is not None else "image"
53
60
 
54
61
  # Handle 2D grayscale images - create xyz format (x, y, value)
55
62
  if isinstance(img, np.ndarray) and img.ndim == 2:
@@ -58,12 +65,12 @@ def _format_plot_image(id, tracked_dict, kwargs):
58
65
  range(rows), range(cols), indexing="ij"
59
66
  )
60
67
 
61
- # Create xyz format
68
+ # Create xyz format using single source of truth
62
69
  df = pd.DataFrame(
63
70
  {
64
- f"{id_str}_x": col_indices.flatten(), # x is column
65
- f"{id_str}_y": row_indices.flatten(), # y is row
66
- f"{id_str}_value": img.flatten(), # z is intensity
71
+ get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id): col_indices.flatten(), # x is column
72
+ get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id): row_indices.flatten(), # y is row
73
+ get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id): img.flatten(), # z is intensity
67
74
  }
68
75
  )
69
76
  return df
@@ -71,24 +78,27 @@ def _format_plot_image(id, tracked_dict, kwargs):
71
78
  # Handle RGB/RGBA images - create xyz format with additional channel information
72
79
  elif isinstance(img, np.ndarray) and img.ndim == 3:
73
80
  rows, cols, channels = img.shape
74
- row_indices, col_indices = np.meshgrid(
75
- range(rows), range(cols), indexing="ij"
76
- )
77
81
 
78
82
  # Create a list to hold rows for a long-format DataFrame
79
83
  data_rows = []
80
84
  channel_names = ["r", "g", "b", "a"]
81
85
 
86
+ # Get column names using single source of truth
87
+ x_col = get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id)
88
+ y_col = get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id)
89
+ channel_col = get_csv_column_name("channel", ax_row, ax_col, trace_id=trace_id)
90
+ value_col = get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id)
91
+
82
92
  # Create long-format data (x, y, channel, value)
83
93
  for r in range(rows):
84
94
  for c in range(cols):
85
95
  for ch in range(min(channels, len(channel_names))):
86
96
  data_rows.append(
87
97
  {
88
- f"{id_str}_x": c, # x is column
89
- f"{id_str}_y": r, # y is row
90
- f"{id_str}_channel": channel_names[ch], # channel name
91
- f"{id_str}_value": img[r, c, ch], # channel value
98
+ x_col: c, # x is column
99
+ y_col: r, # y is row
100
+ channel_col: channel_names[ch], # channel name
101
+ value_col: img[r, c, ch], # channel value
92
102
  }
93
103
  )
94
104
 
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """CSV formatter for stx_imshow() calls."""
4
+
5
+ import numpy as np
6
+ import pandas as pd
7
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
8
+ from ._format_plot import _parse_tracking_id
9
+
10
+
11
+ def _format_stx_imshow(id, tracked_dict, kwargs):
12
+ """Format data from stx_imshow call for CSV export.
13
+
14
+ Parameters
15
+ ----------
16
+ id : str
17
+ Identifier for the plot
18
+ tracked_dict : dict
19
+ Dictionary containing tracked data with 'imshow_df'
20
+ kwargs : dict
21
+ Keyword arguments passed to stx_imshow
22
+
23
+ Returns
24
+ -------
25
+ pd.DataFrame
26
+ Formatted imshow data in row, col, value format (or row, col, R, G, B for RGB)
27
+ """
28
+ if not tracked_dict or not isinstance(tracked_dict, dict):
29
+ return pd.DataFrame()
30
+
31
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
32
+
33
+ # Get imshow_df from tracked_dict
34
+ imshow_df = tracked_dict.get("imshow_df")
35
+ if imshow_df is not None and isinstance(imshow_df, pd.DataFrame):
36
+ # Convert from 2D DataFrame format (with col_0, col_1, ... columns)
37
+ # to row, col, value format for easier analysis
38
+ n_rows, n_cols = imshow_df.shape
39
+
40
+ # Create row and column indices
41
+ row_indices = np.repeat(np.arange(n_rows), n_cols)
42
+ col_indices = np.tile(np.arange(n_cols), n_rows)
43
+
44
+ # Get column names from single source of truth
45
+ col_row = get_csv_column_name("row", ax_row, ax_col, trace_id=trace_id)
46
+ col_col = get_csv_column_name("col", ax_row, ax_col, trace_id=trace_id)
47
+ col_value = get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id)
48
+
49
+ # Flatten the DataFrame values
50
+ values = imshow_df.values.flatten()
51
+
52
+ result = pd.DataFrame({
53
+ col_row: row_indices,
54
+ col_col: col_indices,
55
+ col_value: values
56
+ })
57
+
58
+ return result
59
+
60
+ return pd.DataFrame()
61
+
62
+
63
+ # EOF
@@ -12,6 +12,8 @@ __DIR__ = os.path.dirname(__FILE__)
12
12
  import numpy as np
13
13
  import pandas as pd
14
14
  from scitex.pd import force_df
15
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
16
+ from ._format_plot import _parse_tracking_id
15
17
 
16
18
 
17
19
  def _format_plot_joyplot(id, tracked_dict, kwargs):
@@ -29,6 +31,9 @@ def _format_plot_joyplot(id, tracked_dict, kwargs):
29
31
  if not tracked_dict or not isinstance(tracked_dict, dict):
30
32
  return pd.DataFrame()
31
33
 
34
+ # Parse tracking ID to get axes position and trace ID
35
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
36
+
32
37
  # Get joyplot_data from tracked_dict
33
38
  data = tracked_dict.get("joyplot_data")
34
39
 
@@ -39,16 +44,22 @@ def _format_plot_joyplot(id, tracked_dict, kwargs):
39
44
  if isinstance(data, pd.DataFrame):
40
45
  # Make a copy to avoid modifying original
41
46
  result = data.copy()
42
- # Add prefix to column names if ID is provided
47
+ # Add prefix to column names using single source of truth
43
48
  if id is not None:
44
- result.columns = [f"{id}_joyplot_{col}" for col in result.columns]
49
+ result.columns = [
50
+ get_csv_column_name(f"joyplot-{col}", ax_row, ax_col, trace_id=trace_id)
51
+ for col in result.columns
52
+ ]
45
53
  return result
46
54
 
47
55
  elif isinstance(data, dict):
48
56
  # Convert dictionary to DataFrame
49
57
  result = pd.DataFrame()
50
58
  for group, values in data.items():
51
- result[f"{id}_joyplot_{group}"] = pd.Series(values)
59
+ col_name = get_csv_column_name(
60
+ f"joyplot-{group}", ax_row, ax_col, trace_id=trace_id
61
+ )
62
+ result[col_name] = pd.Series(values)
52
63
  return result
53
64
 
54
65
  elif isinstance(data, (list, tuple)) and all(
@@ -57,11 +68,17 @@ def _format_plot_joyplot(id, tracked_dict, kwargs):
57
68
  # Convert list of arrays to DataFrame
58
69
  result = pd.DataFrame()
59
70
  for i, values in enumerate(data):
60
- result[f"{id}_joyplot_group{i:02d}"] = pd.Series(values)
71
+ col_name = get_csv_column_name(
72
+ f"joyplot-group{i:02d}", ax_row, ax_col, trace_id=trace_id
73
+ )
74
+ result[col_name] = pd.Series(values)
61
75
  return result
62
76
 
63
77
  # Try to force to DataFrame as a last resort
64
78
  try:
65
- return force_df({f"{id}_joyplot_data": data})
79
+ col_name = get_csv_column_name(
80
+ "joyplot-data", ax_row, ax_col, trace_id=trace_id
81
+ )
82
+ return force_df({col_name: data})
66
83
  except:
67
84
  return pd.DataFrame()
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- # Timestamp: "2025-05-18 18:14:26 (ywatanabe)"
4
- # File: /data/gpfs/projects/punim2354/ywatanabe/scitex_repo/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_mean_ci.py
5
- # ----------------------------------------
6
- import os
3
+ # Timestamp: "2025-12-13 02:00:00 (ywatanabe)"
4
+ # File: ./src/scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py
7
5
 
8
- __FILE__ = __file__
9
- __DIR__ = os.path.dirname(__FILE__)
10
- # ----------------------------------------
6
+ """CSV formatter for stx_mean_ci() calls - uses standard column naming."""
11
7
 
12
8
  import pandas as pd
13
9
 
10
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
11
+
12
+ from ._format_plot import _parse_tracking_id
13
+
14
14
 
15
15
  def _format_plot_mean_ci(id, tracked_dict, kwargs):
16
16
  """Format data from a stx_mean_ci call.
17
17
 
18
- Processes mean with confidence interval band plot data for CSV export.
18
+ Processes mean with confidence interval band plot data for CSV export using
19
+ standard column naming (ax-row-{r}-col-{c}_trace-id-{id}_variable-{var}).
19
20
 
20
21
  Args:
21
22
  id (str): Identifier for the plot
@@ -23,7 +24,7 @@ def _format_plot_mean_ci(id, tracked_dict, kwargs):
23
24
  kwargs (dict): Keyword arguments passed to stx_mean_ci
24
25
 
25
26
  Returns:
26
- pd.DataFrame: Formatted mean and CI data
27
+ pd.DataFrame: Formatted mean and CI data with standard column names
27
28
  """
28
29
  # Mean-CI plot data is passed in the tracked_dict
29
30
  if not tracked_dict:
@@ -35,12 +36,15 @@ def _format_plot_mean_ci(id, tracked_dict, kwargs):
35
36
  if plot_df is None or not isinstance(plot_df, pd.DataFrame):
36
37
  return pd.DataFrame()
37
38
 
39
+ # Parse tracking ID to get axes position
40
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
41
+
38
42
  # Create a copy to avoid modifying the original
39
43
  result = plot_df.copy()
40
44
 
41
- # Add prefix to column names if ID is provided
42
- if id is not None:
43
- # Rename columns with ID prefix
44
- result.columns = [f"{id}_mean_ci_{col}" for col in result.columns]
45
+ # Rename columns using standard naming convention
46
+ renamed = {}
47
+ for col in result.columns:
48
+ renamed[col] = get_csv_column_name(col, ax_row, ax_col, trace_id=trace_id)
45
49
 
46
- return result
50
+ return result.rename(columns=renamed)
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- # Timestamp: "2025-05-18 18:14:26 (ywatanabe)"
4
- # File: /data/gpfs/projects/punim2354/ywatanabe/scitex_repo/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_mean_std.py
5
- # ----------------------------------------
6
- import os
3
+ # Timestamp: "2025-12-13 02:00:00 (ywatanabe)"
4
+ # File: ./src/scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py
7
5
 
8
- __FILE__ = __file__
9
- __DIR__ = os.path.dirname(__FILE__)
10
- # ----------------------------------------
6
+ """CSV formatter for stx_mean_std() calls - uses standard column naming."""
11
7
 
12
8
  import pandas as pd
13
9
 
10
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
11
+
12
+ from ._format_plot import _parse_tracking_id
13
+
14
14
 
15
15
  def _format_plot_mean_std(id, tracked_dict, kwargs):
16
16
  """Format data from a stx_mean_std call.
17
17
 
18
- Processes mean with standard deviation band plot data for CSV export.
18
+ Processes mean with standard deviation band plot data for CSV export using
19
+ standard column naming (ax-row-{r}-col-{c}_trace-id-{id}_variable-{var}).
19
20
 
20
21
  Args:
21
22
  id (str): Identifier for the plot
@@ -23,7 +24,7 @@ def _format_plot_mean_std(id, tracked_dict, kwargs):
23
24
  kwargs (dict): Keyword arguments passed to stx_mean_std
24
25
 
25
26
  Returns:
26
- pd.DataFrame: Formatted mean and std data
27
+ pd.DataFrame: Formatted mean and std data with standard column names
27
28
  """
28
29
  # Check if tracked_dict is empty or not a dictionary
29
30
  if not tracked_dict or not isinstance(tracked_dict, dict):
@@ -35,12 +36,15 @@ def _format_plot_mean_std(id, tracked_dict, kwargs):
35
36
  if plot_df is None or not isinstance(plot_df, pd.DataFrame):
36
37
  return pd.DataFrame()
37
38
 
39
+ # Parse tracking ID to get axes position
40
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
41
+
38
42
  # Create a copy to avoid modifying the original
39
43
  result = plot_df.copy()
40
44
 
41
- # Add prefix to column names if ID is provided
42
- if id is not None:
43
- # Rename columns with ID prefix
44
- result.columns = [f"{id}_mean_std_{col}" for col in result.columns]
45
+ # Rename columns using standard naming convention
46
+ renamed = {}
47
+ for col in result.columns:
48
+ renamed[col] = get_csv_column_name(col, ax_row, ax_col, trace_id=trace_id)
45
49
 
46
- return result
50
+ return result.rename(columns=renamed)
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- # Timestamp: "2025-05-18 18:14:26 (ywatanabe)"
4
- # File: /data/gpfs/projects/punim2354/ywatanabe/scitex_repo/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_median_iqr.py
5
- # ----------------------------------------
6
- import os
3
+ # Timestamp: "2025-12-13 02:00:00 (ywatanabe)"
4
+ # File: ./src/scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py
7
5
 
8
- __FILE__ = __file__
9
- __DIR__ = os.path.dirname(__FILE__)
10
- # ----------------------------------------
6
+ """CSV formatter for stx_median_iqr() calls - uses standard column naming."""
11
7
 
12
8
  import pandas as pd
13
9
 
10
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
11
+
12
+ from ._format_plot import _parse_tracking_id
13
+
14
14
 
15
15
  def _format_plot_median_iqr(id, tracked_dict, kwargs):
16
16
  """Format data from a stx_median_iqr call.
17
17
 
18
- Processes median with interquartile range band plot data for CSV export.
18
+ Processes median with interquartile range band plot data for CSV export using
19
+ standard column naming (ax-row-{r}-col-{c}_trace-id-{id}_variable-{var}).
19
20
 
20
21
  Args:
21
22
  id (str): Identifier for the plot
@@ -23,7 +24,7 @@ def _format_plot_median_iqr(id, tracked_dict, kwargs):
23
24
  kwargs (dict): Keyword arguments passed to stx_median_iqr
24
25
 
25
26
  Returns:
26
- pd.DataFrame: Formatted median and IQR data
27
+ pd.DataFrame: Formatted median and IQR data with standard column names
27
28
  """
28
29
  # Median-IQR plot data is passed in the tracked_dict
29
30
  if not tracked_dict:
@@ -35,12 +36,15 @@ def _format_plot_median_iqr(id, tracked_dict, kwargs):
35
36
  if plot_df is None or not isinstance(plot_df, pd.DataFrame):
36
37
  return pd.DataFrame()
37
38
 
39
+ # Parse tracking ID to get axes position
40
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
41
+
38
42
  # Create a copy to avoid modifying the original
39
43
  result = plot_df.copy()
40
44
 
41
- # Add prefix to column names if ID is provided
42
- if id is not None:
43
- # Rename columns with ID prefix
44
- result.columns = [f"{id}_median_iqr_{col}" for col in result.columns]
45
+ # Rename columns using standard naming convention
46
+ renamed = {}
47
+ for col in result.columns:
48
+ renamed[col] = get_csv_column_name(col, ax_row, ax_col, trace_id=trace_id)
45
49
 
46
- return result
50
+ return result.rename(columns=renamed)
@@ -10,6 +10,8 @@ __DIR__ = os.path.dirname(__FILE__)
10
10
  # ----------------------------------------
11
11
 
12
12
  import pandas as pd
13
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
14
+ from ._format_plot import _parse_tracking_id
13
15
 
14
16
 
15
17
  def _format_plot_raster(id, tracked_dict, kwargs):
@@ -27,6 +29,9 @@ def _format_plot_raster(id, tracked_dict, kwargs):
27
29
  if not tracked_dict or not isinstance(tracked_dict, dict):
28
30
  return pd.DataFrame()
29
31
 
32
+ # Parse tracking ID to get axes position and trace ID
33
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
34
+
30
35
  # Get the raster_digit_df from args
31
36
  raster_df = tracked_dict.get("raster_digit_df")
32
37
 
@@ -36,9 +41,12 @@ def _format_plot_raster(id, tracked_dict, kwargs):
36
41
  # Create a copy to avoid modifying the original
37
42
  result = raster_df.copy()
38
43
 
39
- # Add prefix to column names if ID is provided
44
+ # Add prefix to column names using single source of truth
40
45
  if id is not None:
41
46
  # Rename columns with ID prefix
42
- result.columns = [f"{id}_raster_{col}" for col in result.columns]
47
+ result.columns = [
48
+ get_csv_column_name(f"raster-{col}", ax_row, ax_col, trace_id=trace_id)
49
+ for col in result.columns
50
+ ]
43
51
 
44
52
  return result
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """CSV formatter for stx_scatter() calls."""
4
+
5
+ import pandas as pd
6
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
7
+ from ._format_plot import _parse_tracking_id
8
+
9
+
10
+ def _format_stx_scatter(id, tracked_dict, kwargs):
11
+ """Format data from stx_scatter call for CSV export.
12
+
13
+ Parameters
14
+ ----------
15
+ id : str
16
+ Tracking identifier
17
+ tracked_dict : dict
18
+ Dictionary containing tracked data with 'scatter_df' key
19
+ kwargs : dict
20
+ Additional keyword arguments (unused)
21
+
22
+ Returns
23
+ -------
24
+ pd.DataFrame
25
+ Formatted scatter data with standardized column names
26
+ """
27
+ if not tracked_dict or not isinstance(tracked_dict, dict):
28
+ return pd.DataFrame()
29
+
30
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
31
+
32
+ # Get scatter_df from tracked data
33
+ scatter_df = tracked_dict.get("scatter_df")
34
+ if scatter_df is not None and isinstance(scatter_df, pd.DataFrame):
35
+ result = scatter_df.copy()
36
+ renamed = {}
37
+ for col in result.columns:
38
+ renamed[col] = get_csv_column_name(col, ax_row, ax_col, trace_id=trace_id)
39
+ return result.rename(columns=renamed)
40
+
41
+ # Fallback to args if scatter_df not found
42
+ args = tracked_dict.get("args", [])
43
+ if len(args) >= 2:
44
+ col_x = get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id)
45
+ col_y = get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id)
46
+ return pd.DataFrame({col_x: args[0], col_y: args[1]})
47
+
48
+ return pd.DataFrame()
49
+
50
+
51
+ # EOF
@@ -12,6 +12,9 @@ __DIR__ = os.path.dirname(__FILE__)
12
12
  import numpy as np
13
13
  import pandas as pd
14
14
 
15
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
16
+ from ._format_plot import _parse_tracking_id
17
+
15
18
 
16
19
  def _format_plot_scatter_hist(id, tracked_dict, kwargs):
17
20
  """Format data from a stx_scatter_hist call.
@@ -28,13 +31,19 @@ def _format_plot_scatter_hist(id, tracked_dict, kwargs):
28
31
  if not tracked_dict or not isinstance(tracked_dict, dict):
29
32
  return pd.DataFrame()
30
33
 
34
+ # Parse tracking ID to extract axes position and trace ID
35
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
36
+
31
37
  # Extract data from tracked_dict
32
38
  x = tracked_dict.get("x")
33
39
  y = tracked_dict.get("y")
34
40
 
35
41
  if x is not None and y is not None:
36
42
  # Create base DataFrame with x and y values
37
- df = pd.DataFrame({f"{id}_scatter_hist_x": x, f"{id}_scatter_hist_y": y})
43
+ df = pd.DataFrame({
44
+ get_csv_column_name("scatter_hist_x", ax_row, ax_col, trace_id=trace_id): x,
45
+ get_csv_column_name("scatter_hist_y", ax_row, ax_col, trace_id=trace_id): y,
46
+ })
38
47
 
39
48
  # Add histogram data if available
40
49
  hist_x = tracked_dict.get("hist_x")
@@ -50,15 +59,15 @@ def _format_plot_scatter_hist(id, tracked_dict, kwargs):
50
59
  # Create a DataFrame for x histogram data
51
60
  hist_x_df = pd.DataFrame(
52
61
  {
53
- f"{id}_hist_x_bin_centers": bin_centers_x,
54
- f"{id}_hist_x_counts": hist_x,
62
+ get_csv_column_name("hist_x_bin_centers", ax_row, ax_col, trace_id=trace_id): bin_centers_x,
63
+ get_csv_column_name("hist_x_counts", ax_row, ax_col, trace_id=trace_id): hist_x,
55
64
  }
56
65
  )
57
66
 
58
67
  # Add it to the main DataFrame using a MultiIndex
59
68
  for i, (center, count) in enumerate(zip(bin_centers_x, hist_x)):
60
- df.loc[f"hist_x_{i}", f"{id}_hist_x_bin"] = center
61
- df.loc[f"hist_x_{i}", f"{id}_hist_x_count"] = count
69
+ df.loc[f"hist_x_{i}", get_csv_column_name("hist_x_bin", ax_row, ax_col, trace_id=trace_id)] = center
70
+ df.loc[f"hist_x_{i}", get_csv_column_name("hist_x_count", ax_row, ax_col, trace_id=trace_id)] = count
62
71
 
63
72
  # If we have y histogram data
64
73
  if hist_y is not None and bin_edges_y is not None:
@@ -68,15 +77,15 @@ def _format_plot_scatter_hist(id, tracked_dict, kwargs):
68
77
  # Create a DataFrame for y histogram data
69
78
  hist_y_df = pd.DataFrame(
70
79
  {
71
- f"{id}_hist_y_bin_centers": bin_centers_y,
72
- f"{id}_hist_y_counts": hist_y,
80
+ get_csv_column_name("hist_y_bin_centers", ax_row, ax_col, trace_id=trace_id): bin_centers_y,
81
+ get_csv_column_name("hist_y_counts", ax_row, ax_col, trace_id=trace_id): hist_y,
73
82
  }
74
83
  )
75
84
 
76
85
  # Add it to the main DataFrame using a MultiIndex
77
86
  for i, (center, count) in enumerate(zip(bin_centers_y, hist_y)):
78
- df.loc[f"hist_y_{i}", f"{id}_hist_y_bin"] = center
79
- df.loc[f"hist_y_{i}", f"{id}_hist_y_count"] = count
87
+ df.loc[f"hist_y_{i}", get_csv_column_name("hist_y_bin", ax_row, ax_col, trace_id=trace_id)] = center
88
+ df.loc[f"hist_y_{i}", get_csv_column_name("hist_y_count", ax_row, ax_col, trace_id=trace_id)] = count
80
89
 
81
90
  return df
82
91
 
@@ -5,16 +5,18 @@
5
5
 
6
6
  """Empirical Cumulative Distribution Function (ECDF) plotting."""
7
7
 
8
- import warnings
9
8
  from typing import Any, Tuple, Union
10
9
 
11
10
  import numpy as np
12
11
  import pandas as pd
13
12
  from matplotlib.axes import Axes
14
13
 
14
+ from scitex import logging
15
15
  from scitex.pd._force_df import force_df as scitex_pd_force_df
16
16
  from ....plt.utils import assert_valid_axis, mm_to_pt
17
17
 
18
+ logger = logging.getLogger(__name__)
19
+
18
20
 
19
21
  # Default line width (0.2mm for publication)
20
22
  DEFAULT_LINE_WIDTH_MM = 0.2
@@ -68,7 +70,7 @@ def stx_ecdf(
68
70
 
69
71
  # Warnings
70
72
  if np.isnan(values_1d).any():
71
- warnings.warn("NaN value are ignored for ECDF plot.")
73
+ logger.warning("NaN values are ignored for ECDF plot.")
72
74
  values_1d = values_1d[~np.isnan(values_1d)]
73
75
  nn = len(values_1d)
74
76