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.
- scitex/__init__.py +6 -2
- scitex/__version__.py +1 -1
- scitex/audio/README.md +52 -0
- scitex/audio/__init__.py +384 -0
- scitex/audio/__main__.py +129 -0
- scitex/audio/_tts.py +334 -0
- scitex/audio/engines/__init__.py +44 -0
- scitex/audio/engines/base.py +275 -0
- scitex/audio/engines/elevenlabs_engine.py +143 -0
- scitex/audio/engines/gtts_engine.py +162 -0
- scitex/audio/engines/pyttsx3_engine.py +131 -0
- scitex/audio/mcp_server.py +757 -0
- scitex/bridge/_helpers.py +1 -1
- scitex/bridge/_plt_vis.py +1 -1
- scitex/bridge/_stats_vis.py +1 -1
- scitex/dev/plt/__init__.py +272 -0
- scitex/dev/plt/plot_mpl_axhline.py +28 -0
- scitex/dev/plt/plot_mpl_axhspan.py +28 -0
- scitex/dev/plt/plot_mpl_axvline.py +28 -0
- scitex/dev/plt/plot_mpl_axvspan.py +28 -0
- scitex/dev/plt/plot_mpl_bar.py +29 -0
- scitex/dev/plt/plot_mpl_barh.py +29 -0
- scitex/dev/plt/plot_mpl_boxplot.py +28 -0
- scitex/dev/plt/plot_mpl_contour.py +31 -0
- scitex/dev/plt/plot_mpl_contourf.py +31 -0
- scitex/dev/plt/plot_mpl_errorbar.py +30 -0
- scitex/dev/plt/plot_mpl_eventplot.py +28 -0
- scitex/dev/plt/plot_mpl_fill.py +30 -0
- scitex/dev/plt/plot_mpl_fill_between.py +31 -0
- scitex/dev/plt/plot_mpl_hexbin.py +28 -0
- scitex/dev/plt/plot_mpl_hist.py +28 -0
- scitex/dev/plt/plot_mpl_hist2d.py +28 -0
- scitex/dev/plt/plot_mpl_imshow.py +29 -0
- scitex/dev/plt/plot_mpl_pcolormesh.py +31 -0
- scitex/dev/plt/plot_mpl_pie.py +29 -0
- scitex/dev/plt/plot_mpl_plot.py +29 -0
- scitex/dev/plt/plot_mpl_quiver.py +31 -0
- scitex/dev/plt/plot_mpl_scatter.py +28 -0
- scitex/dev/plt/plot_mpl_stackplot.py +31 -0
- scitex/dev/plt/plot_mpl_stem.py +29 -0
- scitex/dev/plt/plot_mpl_step.py +29 -0
- scitex/dev/plt/plot_mpl_violinplot.py +28 -0
- scitex/dev/plt/plot_sns_barplot.py +29 -0
- scitex/dev/plt/plot_sns_boxplot.py +29 -0
- scitex/dev/plt/plot_sns_heatmap.py +28 -0
- scitex/dev/plt/plot_sns_histplot.py +29 -0
- scitex/dev/plt/plot_sns_kdeplot.py +29 -0
- scitex/dev/plt/plot_sns_lineplot.py +31 -0
- scitex/dev/plt/plot_sns_scatterplot.py +29 -0
- scitex/dev/plt/plot_sns_stripplot.py +29 -0
- scitex/dev/plt/plot_sns_swarmplot.py +29 -0
- scitex/dev/plt/plot_sns_violinplot.py +29 -0
- scitex/dev/plt/plot_stx_bar.py +29 -0
- scitex/dev/plt/plot_stx_barh.py +29 -0
- scitex/dev/plt/plot_stx_box.py +28 -0
- scitex/dev/plt/plot_stx_boxplot.py +28 -0
- scitex/dev/plt/plot_stx_conf_mat.py +28 -0
- scitex/dev/plt/plot_stx_contour.py +31 -0
- scitex/dev/plt/plot_stx_ecdf.py +28 -0
- scitex/dev/plt/plot_stx_errorbar.py +30 -0
- scitex/dev/plt/plot_stx_fill_between.py +31 -0
- scitex/dev/plt/plot_stx_fillv.py +28 -0
- scitex/dev/plt/plot_stx_heatmap.py +28 -0
- scitex/dev/plt/plot_stx_image.py +28 -0
- scitex/dev/plt/plot_stx_imshow.py +28 -0
- scitex/dev/plt/plot_stx_joyplot.py +28 -0
- scitex/dev/plt/plot_stx_kde.py +28 -0
- scitex/dev/plt/plot_stx_line.py +28 -0
- scitex/dev/plt/plot_stx_mean_ci.py +28 -0
- scitex/dev/plt/plot_stx_mean_std.py +28 -0
- scitex/dev/plt/plot_stx_median_iqr.py +28 -0
- scitex/dev/plt/plot_stx_raster.py +28 -0
- scitex/dev/plt/plot_stx_rectangle.py +28 -0
- scitex/dev/plt/plot_stx_scatter.py +29 -0
- scitex/dev/plt/plot_stx_shaded_line.py +29 -0
- scitex/dev/plt/plot_stx_violin.py +28 -0
- scitex/dev/plt/plot_stx_violinplot.py +28 -0
- scitex/diagram/README.md +197 -0
- scitex/diagram/__init__.py +48 -0
- scitex/diagram/_compile.py +312 -0
- scitex/diagram/_diagram.py +355 -0
- scitex/diagram/_presets.py +173 -0
- scitex/diagram/_schema.py +182 -0
- scitex/diagram/_split.py +278 -0
- scitex/fig/__init__.py +352 -0
- scitex/{vis → fig}/backend/_parser.py +1 -1
- scitex/{vis → fig}/canvas.py +1 -1
- scitex/{vis → fig}/editor/__init__.py +5 -2
- scitex/{vis → fig}/editor/_dearpygui_editor.py +1 -1
- scitex/{vis → fig}/editor/_defaults.py +70 -5
- scitex/{vis → fig}/editor/_mpl_editor.py +1 -1
- scitex/{vis → fig}/editor/_qt_editor.py +182 -2
- scitex/{vis → fig}/editor/_tkinter_editor.py +1 -1
- scitex/fig/editor/edit/__init__.py +50 -0
- scitex/fig/editor/edit/backend_detector.py +109 -0
- scitex/fig/editor/edit/bundle_resolver.py +240 -0
- scitex/fig/editor/edit/editor_launcher.py +239 -0
- scitex/fig/editor/edit/manual_handler.py +53 -0
- scitex/fig/editor/edit/panel_loader.py +232 -0
- scitex/fig/editor/edit/path_resolver.py +67 -0
- scitex/fig/editor/flask_editor/_bbox.py +1299 -0
- scitex/fig/editor/flask_editor/_core.py +1429 -0
- scitex/{vis → fig}/editor/flask_editor/_plotter.py +38 -4
- scitex/fig/editor/flask_editor/_renderer.py +813 -0
- scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
- scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
- scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
- scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
- scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
- scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
- scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
- scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
- scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
- scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
- scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
- scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
- scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
- scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
- scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
- scitex/fig/editor/flask_editor/static/css/index.css +31 -0
- scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
- scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
- scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
- scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
- scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
- scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
- scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
- scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
- scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
- scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
- scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
- scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
- scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
- scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
- scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
- scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
- scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
- scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
- scitex/fig/editor/flask_editor/static/js/main.js +426 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
- scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
- scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
- scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
- scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
- scitex/fig/editor/flask_editor/templates/__init__.py +123 -0
- scitex/fig/editor/flask_editor/templates/_html.py +852 -0
- scitex/fig/editor/flask_editor/templates/_scripts.py +4933 -0
- scitex/fig/editor/flask_editor/templates/_styles.py +1658 -0
- scitex/{vis → fig}/io/__init__.py +13 -1
- scitex/fig/io/_bundle.py +1058 -0
- scitex/{vis → fig}/io/_canvas.py +1 -1
- scitex/{vis → fig}/io/_data.py +1 -1
- scitex/{vis → fig}/io/_export.py +1 -1
- scitex/{vis → fig}/io/_load.py +1 -1
- scitex/{vis → fig}/io/_panel.py +1 -1
- scitex/{vis → fig}/io/_save.py +1 -1
- scitex/{vis → fig}/model/__init__.py +1 -1
- scitex/{vis → fig}/model/_annotations.py +1 -1
- scitex/{vis → fig}/model/_axes.py +1 -1
- scitex/{vis → fig}/model/_figure.py +1 -1
- scitex/{vis → fig}/model/_guides.py +1 -1
- scitex/{vis → fig}/model/_plot.py +1 -1
- scitex/{vis → fig}/model/_styles.py +1 -1
- scitex/{vis → fig}/utils/__init__.py +1 -1
- scitex/io/__init__.py +22 -26
- scitex/io/_bundle.py +493 -0
- scitex/io/_flush.py +5 -2
- scitex/io/_load.py +98 -0
- scitex/io/_load_modules/_H5Explorer.py +5 -2
- scitex/io/_load_modules/_canvas.py +2 -2
- scitex/io/_load_modules/_image.py +3 -4
- scitex/io/_load_modules/_txt.py +4 -2
- scitex/io/_metadata.py +34 -324
- scitex/io/_metadata_modules/__init__.py +46 -0
- scitex/io/_metadata_modules/_embed.py +70 -0
- scitex/io/_metadata_modules/_read.py +64 -0
- scitex/io/_metadata_modules/_utils.py +79 -0
- scitex/io/_metadata_modules/embed_metadata_jpeg.py +74 -0
- scitex/io/_metadata_modules/embed_metadata_pdf.py +53 -0
- scitex/io/_metadata_modules/embed_metadata_png.py +26 -0
- scitex/io/_metadata_modules/embed_metadata_svg.py +62 -0
- scitex/io/_metadata_modules/read_metadata_jpeg.py +57 -0
- scitex/io/_metadata_modules/read_metadata_pdf.py +51 -0
- scitex/io/_metadata_modules/read_metadata_png.py +39 -0
- scitex/io/_metadata_modules/read_metadata_svg.py +44 -0
- scitex/io/_qr_utils.py +5 -3
- scitex/io/_save.py +548 -30
- scitex/io/_save_modules/_canvas.py +3 -3
- scitex/io/_save_modules/_image.py +5 -9
- scitex/io/_save_modules/_tex.py +7 -4
- scitex/io/_zip_bundle.py +439 -0
- scitex/io/utils/h5_to_zarr.py +11 -9
- scitex/msword/__init__.py +255 -0
- scitex/msword/profiles.py +357 -0
- scitex/msword/reader.py +753 -0
- scitex/msword/utils.py +289 -0
- scitex/msword/writer.py +362 -0
- scitex/plt/__init__.py +5 -2
- scitex/plt/_subplots/_AxesWrapper.py +6 -6
- scitex/plt/_subplots/_AxisWrapper.py +15 -9
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +36 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +264 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +213 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +128 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +59 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +34 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +593 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +654 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +527 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +321 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +33 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +152 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +600 -0
- scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +79 -5
- scitex/plt/_subplots/_FigWrapper.py +6 -6
- scitex/plt/_subplots/_SubplotsWrapper.py +28 -18
- scitex/plt/_subplots/_export_as_csv.py +35 -5
- scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +8 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_annotate.py +10 -21
- scitex/plt/_subplots/_export_as_csv_formatters/_format_eventplot.py +18 -7
- scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py +28 -12
- scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py +10 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_imshow.py +13 -1
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_kde.py +12 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_scatter.py +10 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_quiver.py +10 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_jointplot.py +18 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_lineplot.py +44 -36
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_pairplot.py +14 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_streamplot.py +11 -5
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +84 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +85 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_conf_mat.py +14 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_contour.py +54 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_ecdf.py +14 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +120 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_heatmap.py +16 -6
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_image.py +29 -19
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_imshow.py +63 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_joyplot.py +22 -5
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_raster.py +10 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +51 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter_hist.py +18 -9
- scitex/plt/ax/_plot/_stx_ecdf.py +4 -2
- scitex/plt/gallery/_generate.py +421 -14
- scitex/plt/io/__init__.py +53 -0
- scitex/plt/io/_bundle.py +490 -0
- scitex/plt/io/_layered_bundle.py +1343 -0
- scitex/plt/styles/SCITEX_STYLE.yaml +26 -0
- scitex/plt/styles/__init__.py +14 -0
- scitex/plt/styles/presets.py +78 -0
- scitex/plt/utils/__init__.py +13 -1
- scitex/plt/utils/_collect_figure_metadata.py +10 -14
- scitex/plt/utils/_configure_mpl.py +6 -18
- scitex/plt/utils/_crop.py +32 -14
- scitex/plt/utils/_csv_column_naming.py +54 -0
- scitex/plt/utils/_figure_mm.py +116 -1
- scitex/plt/utils/_hitmap.py +1643 -0
- scitex/plt/utils/metadata/__init__.py +25 -0
- scitex/plt/utils/metadata/_core.py +9 -10
- scitex/plt/utils/metadata/_dimensions.py +6 -3
- scitex/plt/utils/metadata/_editable_export.py +405 -0
- scitex/plt/utils/metadata/_geometry_extraction.py +570 -0
- scitex/schema/__init__.py +109 -16
- scitex/schema/_canvas.py +1 -1
- scitex/schema/_plot.py +1015 -0
- scitex/schema/_stats.py +2 -2
- scitex/stats/__init__.py +117 -0
- scitex/stats/io/__init__.py +29 -0
- scitex/stats/io/_bundle.py +156 -0
- scitex/tex/__init__.py +4 -0
- scitex/tex/_export.py +890 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/METADATA +11 -1
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/RECORD +294 -170
- scitex/io/memo.md +0 -2827
- scitex/plt/REQUESTS.md +0 -191
- scitex/plt/_subplots/TODO.md +0 -53
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin.py +0 -559
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py +0 -1609
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin.py +0 -447
- scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_between.json +0 -110
- scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_betweenx.json +0 -88
- scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fill_between.json +0 -103
- scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fillv.json +0 -106
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/bar.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/barh.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/boxplot.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_bar.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_barh.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_box.json +0 -83
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_boxplot.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violin.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violinplot.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/violinplot.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/contour.json +0 -97
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/contourf.json +0 -98
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/stx_contour.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist.json +0 -101
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist2d.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_ecdf.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_joyplot.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_kde.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/imshow.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/matshow.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_conf_mat.json +0 -83
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_heatmap.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_image.json +0 -121
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_imshow.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/line/plot.json +0 -110
- scitex/plt/templates/research-master/scitex/vis/gallery/line/step.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_line.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_shaded_line.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/hexbin.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/scatter.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stem.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stx_scatter.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/special/pie.json +0 -94
- scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_raster.json +0 -109
- scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_rectangle.json +0 -108
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/errorbar.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_errorbar.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_ci.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_std.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_median_iqr.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/vector/quiver.json +0 -99
- scitex/plt/templates/research-master/scitex/vis/gallery/vector/streamplot.json +0 -100
- scitex/vis/__init__.py +0 -177
- scitex/vis/editor/_edit.py +0 -390
- scitex/vis/editor/flask_editor/_bbox.py +0 -529
- scitex/vis/editor/flask_editor/_core.py +0 -168
- scitex/vis/editor/flask_editor/_renderer.py +0 -393
- scitex/vis/editor/flask_editor/templates/__init__.py +0 -33
- scitex/vis/editor/flask_editor/templates/_html.py +0 -513
- scitex/vis/editor/flask_editor/templates/_scripts.py +0 -1261
- scitex/vis/editor/flask_editor/templates/_styles.py +0 -739
- /scitex/{vis → fig}/README.md +0 -0
- /scitex/{vis → fig}/backend/__init__.py +0 -0
- /scitex/{vis → fig}/backend/_export.py +0 -0
- /scitex/{vis → fig}/backend/_render.py +0 -0
- /scitex/{vis → fig}/docs/CANVAS_ARCHITECTURE.md +0 -0
- /scitex/{vis → fig}/editor/_flask_editor.py +0 -0
- /scitex/{vis → fig}/editor/flask_editor/__init__.py +0 -0
- /scitex/{vis → fig}/editor/flask_editor/_utils.py +0 -0
- /scitex/{vis → fig}/io/_directory.py +0 -0
- /scitex/{vis → fig}/model/_plot_types.py +0 -0
- /scitex/{vis → fig}/utils/_defaults.py +0 -0
- /scitex/{vis → fig}/utils/_validate.py +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/WHEEL +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/entry_points.txt +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -14,6 +14,10 @@ import warnings
|
|
|
14
14
|
import numpy as np
|
|
15
15
|
import pandas as pd
|
|
16
16
|
|
|
17
|
+
from scitex import logging
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
class FigWrapper:
|
|
19
23
|
def __init__(self, fig_mpl):
|
|
@@ -169,9 +173,7 @@ class FigWrapper:
|
|
|
169
173
|
auto_metadata["custom"].update(metadata)
|
|
170
174
|
except Exception as e:
|
|
171
175
|
# If metadata collection fails, warn but continue
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
warnings.warn(f"Could not collect metadata: {e}")
|
|
176
|
+
logger.warning(f"Could not collect metadata: {e}")
|
|
175
177
|
auto_metadata = metadata
|
|
176
178
|
|
|
177
179
|
# Use scitex.io.save_image for metadata embedding
|
|
@@ -183,9 +185,7 @@ class FigWrapper:
|
|
|
183
185
|
)
|
|
184
186
|
except Exception as e:
|
|
185
187
|
# Fallback to regular matplotlib savefig
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
warnings.warn(f"Metadata embedding failed, using regular savefig: {e}")
|
|
188
|
+
logger.warning(f"Metadata embedding failed, using regular savefig: {e}")
|
|
189
189
|
self._fig_mpl.savefig(fname, *args, **kwargs)
|
|
190
190
|
else:
|
|
191
191
|
# For non-image formats or when metadata disabled, use regular savefig
|
|
@@ -62,24 +62,13 @@ if _arial_enabled:
|
|
|
62
62
|
]
|
|
63
63
|
else:
|
|
64
64
|
# Warn about missing Arial
|
|
65
|
-
|
|
66
|
-
from scitex.logging import getLogger
|
|
65
|
+
from scitex import logging as _logging
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
except:
|
|
74
|
-
# If scitex.logging not available, use standard warnings
|
|
75
|
-
import warnings
|
|
76
|
-
|
|
77
|
-
warnings.warn(
|
|
78
|
-
"Arial font not found. Using fallback fonts (Helvetica/DejaVu Sans). "
|
|
79
|
-
"For publication figures with Arial: sudo apt-get install ttf-mscorefonts-installer && fc-cache -fv",
|
|
80
|
-
UserWarning,
|
|
81
|
-
stacklevel=2,
|
|
82
|
-
)
|
|
67
|
+
_logger = _logging.getLogger(__name__)
|
|
68
|
+
_logger.warning(
|
|
69
|
+
"Arial font not found. Using fallback fonts (Helvetica/DejaVu Sans). "
|
|
70
|
+
"For publication figures with Arial: sudo apt-get install ttf-mscorefonts-installer && fc-cache -fv"
|
|
71
|
+
)
|
|
83
72
|
|
|
84
73
|
|
|
85
74
|
class SubplotsWrapper:
|
|
@@ -124,6 +113,7 @@ class SubplotsWrapper:
|
|
|
124
113
|
dpi=None,
|
|
125
114
|
styles=None, # List of style dicts for per-axes control
|
|
126
115
|
transparent=None, # Transparent background (default: from SCITEX_STYLE.yaml)
|
|
116
|
+
theme=None, # Color theme: "light" or "dark" (default: "light")
|
|
127
117
|
**kwargs,
|
|
128
118
|
):
|
|
129
119
|
"""
|
|
@@ -179,6 +169,9 @@ class SubplotsWrapper:
|
|
|
179
169
|
transparent : bool, optional
|
|
180
170
|
Create figure with transparent background (default: False)
|
|
181
171
|
Useful for publication-ready figures that will be cropped
|
|
172
|
+
theme : str, optional
|
|
173
|
+
Color theme: "light" or "dark" (default: "light")
|
|
174
|
+
Dark mode uses eye-friendly colors optimized for dark backgrounds
|
|
182
175
|
**kwargs
|
|
183
176
|
Additional arguments passed to matplotlib.pyplot.subplots
|
|
184
177
|
|
|
@@ -287,6 +280,9 @@ class SubplotsWrapper:
|
|
|
287
280
|
transparent = _S.get("transparent", True)
|
|
288
281
|
if mode is None:
|
|
289
282
|
mode = _S.get("mode", "publication")
|
|
283
|
+
# Resolve theme from YAML (default: "light")
|
|
284
|
+
if theme is None:
|
|
285
|
+
theme = _resolve("theme.mode", None, "light", str)
|
|
290
286
|
|
|
291
287
|
# Always use mm-control pathway with SCITEX_STYLE defaults
|
|
292
288
|
if True:
|
|
@@ -319,6 +315,7 @@ class SubplotsWrapper:
|
|
|
319
315
|
dpi=dpi,
|
|
320
316
|
styles=styles,
|
|
321
317
|
transparent=transparent,
|
|
318
|
+
theme=theme,
|
|
322
319
|
**kwargs,
|
|
323
320
|
)
|
|
324
321
|
|
|
@@ -355,17 +352,22 @@ class SubplotsWrapper:
|
|
|
355
352
|
dpi=None,
|
|
356
353
|
styles=None,
|
|
357
354
|
transparent=None, # Resolved from caller
|
|
355
|
+
theme=None, # Color theme: "light" or "dark"
|
|
358
356
|
**kwargs,
|
|
359
357
|
):
|
|
360
358
|
"""Create figure with mm-based control over axes dimensions."""
|
|
361
359
|
from scitex.plt.utils import mm_to_inch, apply_style_mm
|
|
362
360
|
|
|
363
|
-
# Parse nrows, ncols from args (like matplotlib.pyplot.subplots)
|
|
361
|
+
# Parse nrows, ncols from args or kwargs (like matplotlib.pyplot.subplots)
|
|
364
362
|
nrows, ncols = 1, 1
|
|
365
363
|
if len(args) >= 1:
|
|
366
364
|
nrows = args[0]
|
|
365
|
+
elif "nrows" in kwargs:
|
|
366
|
+
nrows = kwargs.pop("nrows")
|
|
367
367
|
if len(args) >= 2:
|
|
368
368
|
ncols = args[1]
|
|
369
|
+
elif "ncols" in kwargs:
|
|
370
|
+
ncols = kwargs.pop("ncols")
|
|
369
371
|
|
|
370
372
|
n_axes = nrows * ncols
|
|
371
373
|
|
|
@@ -451,6 +453,10 @@ class SubplotsWrapper:
|
|
|
451
453
|
else:
|
|
452
454
|
self._fig_mpl = plt.figure(figsize=figsize_inch, dpi=dpi)
|
|
453
455
|
|
|
456
|
+
# Store theme on figure for later retrieval (e.g., when saving plot.json)
|
|
457
|
+
if theme is not None:
|
|
458
|
+
self._fig_mpl._scitex_theme = theme
|
|
459
|
+
|
|
454
460
|
# Create axes array and position each one manually
|
|
455
461
|
axes_mpl_list = []
|
|
456
462
|
ax_idx = 0
|
|
@@ -541,6 +547,10 @@ class SubplotsWrapper:
|
|
|
541
547
|
if n_ticks is not None:
|
|
542
548
|
style_dict["n_ticks"] = n_ticks
|
|
543
549
|
|
|
550
|
+
# Always add theme to style_dict (default: "light")
|
|
551
|
+
if theme is not None:
|
|
552
|
+
style_dict["theme"] = theme
|
|
553
|
+
|
|
544
554
|
# Extract suptitle font size if available
|
|
545
555
|
if "suptitle_font_size_pt" in style_dict:
|
|
546
556
|
suptitle_font_size_pt_value = style_dict["suptitle_font_size_pt"]
|
|
@@ -10,12 +10,14 @@ __FILE__ = __file__
|
|
|
10
10
|
__DIR__ = os.path.dirname(__FILE__)
|
|
11
11
|
# ----------------------------------------
|
|
12
12
|
|
|
13
|
-
import warnings
|
|
14
|
-
|
|
15
13
|
import numpy as np
|
|
16
14
|
import pandas as pd
|
|
17
15
|
from scitex.pd import to_xyz
|
|
18
16
|
|
|
17
|
+
from scitex import logging
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
19
21
|
# Global warning registry to track which warnings have been shown
|
|
20
22
|
_warning_registry = set()
|
|
21
23
|
|
|
@@ -59,7 +61,7 @@ def _warn_once(message, category=UserWarning):
|
|
|
59
61
|
"""
|
|
60
62
|
if message not in _warning_registry:
|
|
61
63
|
_warning_registry.add(message)
|
|
62
|
-
|
|
64
|
+
logger.warning(message)
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
from ._export_as_csv_formatters import (
|
|
@@ -93,11 +95,13 @@ from ._export_as_csv_formatters import (
|
|
|
93
95
|
# Custom scitex formatters
|
|
94
96
|
_format_plot_box,
|
|
95
97
|
_format_plot_conf_mat,
|
|
98
|
+
_format_stx_contour,
|
|
96
99
|
_format_plot_ecdf,
|
|
97
100
|
_format_plot_fillv,
|
|
98
101
|
_format_plot_heatmap,
|
|
99
102
|
_format_plot_image,
|
|
100
103
|
_format_plot_imshow,
|
|
104
|
+
_format_stx_imshow,
|
|
101
105
|
_format_plot_joyplot,
|
|
102
106
|
_format_plot_kde,
|
|
103
107
|
_format_plot_line,
|
|
@@ -110,6 +114,11 @@ from ._export_as_csv_formatters import (
|
|
|
110
114
|
_format_plot_scatter_hist,
|
|
111
115
|
_format_plot_shaded_line,
|
|
112
116
|
_format_plot_violin,
|
|
117
|
+
# stx_ aliases formatters
|
|
118
|
+
_format_stx_scatter,
|
|
119
|
+
_format_stx_bar,
|
|
120
|
+
_format_stx_barh,
|
|
121
|
+
_format_stx_errorbar,
|
|
113
122
|
# Seaborn formatters
|
|
114
123
|
_format_sns_barplot,
|
|
115
124
|
_format_sns_boxplot,
|
|
@@ -157,11 +166,13 @@ _FORMATTER_REGISTRY = {
|
|
|
157
166
|
# Custom scitex methods
|
|
158
167
|
"stx_box": _format_plot_box,
|
|
159
168
|
"stx_conf_mat": _format_plot_conf_mat,
|
|
169
|
+
"stx_contour": _format_stx_contour,
|
|
160
170
|
"stx_ecdf": _format_plot_ecdf,
|
|
161
171
|
"stx_fillv": _format_plot_fillv,
|
|
162
172
|
"stx_heatmap": _format_plot_heatmap,
|
|
163
173
|
"stx_image": _format_plot_image,
|
|
164
174
|
"plot_imshow": _format_plot_imshow,
|
|
175
|
+
"stx_imshow": _format_stx_imshow,
|
|
165
176
|
"stx_joyplot": _format_plot_joyplot,
|
|
166
177
|
"stx_kde": _format_plot_kde,
|
|
167
178
|
"stx_line": _format_plot_line,
|
|
@@ -174,6 +185,11 @@ _FORMATTER_REGISTRY = {
|
|
|
174
185
|
"stx_scatter_hist": _format_plot_scatter_hist,
|
|
175
186
|
"stx_shaded_line": _format_plot_shaded_line,
|
|
176
187
|
"stx_violin": _format_plot_violin,
|
|
188
|
+
# stx_ aliases
|
|
189
|
+
"stx_scatter": _format_stx_scatter,
|
|
190
|
+
"stx_bar": _format_stx_bar,
|
|
191
|
+
"stx_barh": _format_stx_barh,
|
|
192
|
+
"stx_errorbar": _format_stx_errorbar,
|
|
177
193
|
# Seaborn methods (sns_ prefix)
|
|
178
194
|
"sns_barplot": _format_sns_barplot,
|
|
179
195
|
"sns_boxplot": _format_sns_boxplot,
|
|
@@ -226,7 +242,7 @@ def export_as_csv(history_records):
|
|
|
226
242
|
ValueError: If no plotting records are found or they cannot be combined.
|
|
227
243
|
"""
|
|
228
244
|
if len(history_records) <= 0:
|
|
229
|
-
|
|
245
|
+
logger.warning("Plotting records not found. Cannot export empty data.")
|
|
230
246
|
return pd.DataFrame() # Return empty DataFrame instead of None
|
|
231
247
|
|
|
232
248
|
dfs = []
|
|
@@ -268,7 +284,7 @@ def export_as_csv(history_records):
|
|
|
268
284
|
df = pd.concat(dfs_reset, axis=1)
|
|
269
285
|
return df
|
|
270
286
|
except Exception as e:
|
|
271
|
-
|
|
287
|
+
logger.warning(f"Failed to combine plotting records: {e}")
|
|
272
288
|
# Return a DataFrame with metadata about what records were attempted
|
|
273
289
|
meta_df = pd.DataFrame(
|
|
274
290
|
{
|
|
@@ -355,6 +371,8 @@ def format_record(record, record_index=0):
|
|
|
355
371
|
return _format_plot_box(id, tracked_dict, kwargs)
|
|
356
372
|
elif method == "stx_conf_mat":
|
|
357
373
|
return _format_plot_conf_mat(id, tracked_dict, kwargs)
|
|
374
|
+
elif method == "stx_contour":
|
|
375
|
+
return _format_stx_contour(id, tracked_dict, kwargs)
|
|
358
376
|
elif method == "stx_ecdf":
|
|
359
377
|
return _format_plot_ecdf(id, tracked_dict, kwargs)
|
|
360
378
|
elif method == "stx_fillv":
|
|
@@ -365,6 +383,8 @@ def format_record(record, record_index=0):
|
|
|
365
383
|
return _format_plot_image(id, tracked_dict, kwargs)
|
|
366
384
|
elif method == "plot_imshow":
|
|
367
385
|
return _format_plot_imshow(id, tracked_dict, kwargs)
|
|
386
|
+
elif method == "stx_imshow":
|
|
387
|
+
return _format_stx_imshow(id, tracked_dict, kwargs)
|
|
368
388
|
elif method == "stx_joyplot":
|
|
369
389
|
return _format_plot_joyplot(id, tracked_dict, kwargs)
|
|
370
390
|
elif method == "stx_kde":
|
|
@@ -390,6 +410,16 @@ def format_record(record, record_index=0):
|
|
|
390
410
|
elif method == "stx_violin":
|
|
391
411
|
return _format_plot_violin(id, tracked_dict, kwargs)
|
|
392
412
|
|
|
413
|
+
# stx_ aliases
|
|
414
|
+
elif method == "stx_scatter":
|
|
415
|
+
return _format_stx_scatter(id, tracked_dict, kwargs)
|
|
416
|
+
elif method == "stx_bar":
|
|
417
|
+
return _format_stx_bar(id, tracked_dict, kwargs)
|
|
418
|
+
elif method == "stx_barh":
|
|
419
|
+
return _format_stx_barh(id, tracked_dict, kwargs)
|
|
420
|
+
elif method == "stx_errorbar":
|
|
421
|
+
return _format_stx_errorbar(id, tracked_dict, kwargs)
|
|
422
|
+
|
|
393
423
|
# Seaborn functions (sns_ prefix)
|
|
394
424
|
elif method == "sns_barplot":
|
|
395
425
|
return _format_sns_barplot(id, tracked_dict, kwargs)
|
|
@@ -41,10 +41,12 @@ from ._format_violinplot import _format_violinplot
|
|
|
41
41
|
from ._format_plot_imshow import _format_plot_imshow
|
|
42
42
|
from ._format_plot_box import _format_plot_box
|
|
43
43
|
from ._format_stx_conf_mat import _format_plot_conf_mat
|
|
44
|
+
from ._format_stx_contour import _format_stx_contour
|
|
44
45
|
from ._format_stx_ecdf import _format_plot_ecdf
|
|
45
46
|
from ._format_stx_fillv import _format_plot_fillv
|
|
46
47
|
from ._format_stx_heatmap import _format_plot_heatmap
|
|
47
48
|
from ._format_stx_image import _format_plot_image
|
|
49
|
+
from ._format_stx_imshow import _format_stx_imshow
|
|
48
50
|
from ._format_stx_joyplot import _format_plot_joyplot
|
|
49
51
|
from ._format_plot_kde import _format_plot_kde
|
|
50
52
|
from ._format_stx_line import _format_plot_line
|
|
@@ -58,6 +60,12 @@ from ._format_stx_scatter_hist import _format_plot_scatter_hist
|
|
|
58
60
|
from ._format_stx_shaded_line import _format_plot_shaded_line
|
|
59
61
|
from ._format_stx_violin import _format_plot_violin
|
|
60
62
|
|
|
63
|
+
# stx_ aliases formatters
|
|
64
|
+
from ._format_stx_scatter import _format_stx_scatter
|
|
65
|
+
from ._format_stx_bar import _format_stx_bar
|
|
66
|
+
from ._format_stx_barh import _format_stx_barh
|
|
67
|
+
from ._format_stx_errorbar import _format_stx_errorbar
|
|
68
|
+
|
|
61
69
|
# Seaborn formatters (sns_ prefix)
|
|
62
70
|
from ._format_sns_barplot import _format_sns_barplot
|
|
63
71
|
from ._format_sns_boxplot import _format_sns_boxplot
|
|
@@ -12,22 +12,8 @@ __DIR__ = os.path.dirname(__FILE__)
|
|
|
12
12
|
|
|
13
13
|
import pandas as pd
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"""Create column name with method descriptor, avoiding duplication.
|
|
18
|
-
|
|
19
|
-
For example:
|
|
20
|
-
- id="annotate_0", suffix="x" -> "annotate_0_x"
|
|
21
|
-
- id="plot_5", suffix="x" -> "plot_5_annotate_x"
|
|
22
|
-
"""
|
|
23
|
-
# Check if method name is already in the ID
|
|
24
|
-
id_parts = id.rsplit("_", 1)
|
|
25
|
-
if len(id_parts) == 2 and id_parts[0].endswith(method):
|
|
26
|
-
# Method already in ID, don't duplicate
|
|
27
|
-
return f"{id}_{suffix}"
|
|
28
|
-
else:
|
|
29
|
-
# Method not in ID, add it for clarity
|
|
30
|
-
return f"{id}_{method}_{suffix}"
|
|
15
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
16
|
+
from ._format_plot import _parse_tracking_id
|
|
31
17
|
|
|
32
18
|
|
|
33
19
|
def _format_annotate(id, tracked_dict, kwargs):
|
|
@@ -42,6 +28,9 @@ def _format_annotate(id, tracked_dict, kwargs):
|
|
|
42
28
|
if not tracked_dict or not isinstance(tracked_dict, dict):
|
|
43
29
|
return pd.DataFrame()
|
|
44
30
|
|
|
31
|
+
# Parse the tracking ID to get axes position and trace ID
|
|
32
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
33
|
+
|
|
45
34
|
# Get the args from tracked_dict
|
|
46
35
|
args = tracked_dict.get("args", [])
|
|
47
36
|
|
|
@@ -57,9 +46,9 @@ def _format_annotate(id, tracked_dict, kwargs):
|
|
|
57
46
|
return pd.DataFrame()
|
|
58
47
|
|
|
59
48
|
data = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id): [x],
|
|
50
|
+
get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id): [y],
|
|
51
|
+
get_csv_column_name("content", ax_row, ax_col, trace_id=trace_id): [text_content],
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
# Check if xytext was provided (either as third arg or in kwargs)
|
|
@@ -70,8 +59,8 @@ def _format_annotate(id, tracked_dict, kwargs):
|
|
|
70
59
|
xytext = kwargs["xytext"]
|
|
71
60
|
|
|
72
61
|
if xytext is not None and hasattr(xytext, "__len__") and len(xytext) >= 2:
|
|
73
|
-
data[
|
|
74
|
-
data[
|
|
62
|
+
data[get_csv_column_name("text_x", ax_row, ax_col, trace_id=trace_id)] = [xytext[0]]
|
|
63
|
+
data[get_csv_column_name("text_y", ax_row, ax_col, trace_id=trace_id)] = [xytext[1]]
|
|
75
64
|
|
|
76
65
|
# Create DataFrame with proper column names (use dict with list values)
|
|
77
66
|
df = pd.DataFrame(data)
|
|
@@ -13,6 +13,12 @@ import numpy as np
|
|
|
13
13
|
import pandas as pd
|
|
14
14
|
import scitex
|
|
15
15
|
|
|
16
|
+
from scitex import logging
|
|
17
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
18
|
+
from ._format_plot import _parse_tracking_id
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
16
22
|
|
|
17
23
|
def _format_eventplot(id, tracked_dict, kwargs):
|
|
18
24
|
"""Format data from an eventplot call."""
|
|
@@ -20,6 +26,9 @@ def _format_eventplot(id, tracked_dict, kwargs):
|
|
|
20
26
|
if not tracked_dict or not isinstance(tracked_dict, dict):
|
|
21
27
|
return pd.DataFrame()
|
|
22
28
|
|
|
29
|
+
# Parse the tracking ID to get axes position and trace ID
|
|
30
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
31
|
+
|
|
23
32
|
# Get the args from tracked_dict
|
|
24
33
|
args = tracked_dict.get("args", [])
|
|
25
34
|
|
|
@@ -36,13 +45,15 @@ def _format_eventplot(id, tracked_dict, kwargs):
|
|
|
36
45
|
if isinstance(positions, (list, np.ndarray)) and not isinstance(
|
|
37
46
|
positions[0], (list, np.ndarray)
|
|
38
47
|
):
|
|
39
|
-
|
|
48
|
+
col_name = get_csv_column_name("eventplot-events", ax_row, ax_col, trace_id=trace_id)
|
|
49
|
+
return pd.DataFrame({col_name: positions})
|
|
40
50
|
|
|
41
51
|
# If positions is a list of arrays (multiple event sets)
|
|
42
52
|
elif isinstance(positions, (list, np.ndarray)):
|
|
43
53
|
data = {}
|
|
44
54
|
for i, events in enumerate(positions):
|
|
45
|
-
|
|
55
|
+
col_name = get_csv_column_name(f"eventplot-events{i:02d}", ax_row, ax_col, trace_id=f"{trace_id}-{i}")
|
|
56
|
+
data[col_name] = events
|
|
46
57
|
|
|
47
58
|
# Use force_df to handle different length arrays
|
|
48
59
|
return scitex.pd.force_df(data)
|
|
@@ -53,20 +64,20 @@ def _format_eventplot(id, tracked_dict, kwargs):
|
|
|
53
64
|
if isinstance(positions, (list, np.ndarray)) and not isinstance(
|
|
54
65
|
positions[0], (list, np.ndarray)
|
|
55
66
|
):
|
|
56
|
-
|
|
67
|
+
col_name = get_csv_column_name("eventplot-events", ax_row, ax_col, trace_id=trace_id)
|
|
68
|
+
return pd.DataFrame({col_name: positions})
|
|
57
69
|
|
|
58
70
|
# If positions is a list of arrays (multiple event sets)
|
|
59
71
|
elif isinstance(positions, (list, np.ndarray)):
|
|
60
72
|
# Create a DataFrame where each column is a Series that can handle varying lengths
|
|
61
73
|
df = pd.DataFrame()
|
|
62
74
|
for i, events in enumerate(positions):
|
|
63
|
-
|
|
75
|
+
col_name = get_csv_column_name(f"eventplot-events{i:02d}", ax_row, ax_col, trace_id=f"{trace_id}-{i}")
|
|
76
|
+
df[col_name] = pd.Series(events)
|
|
64
77
|
return df
|
|
65
78
|
except Exception as e:
|
|
66
79
|
# If all else fails, return an empty DataFrame
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
warnings.warn(f"Error formatting eventplot data: {str(e)}")
|
|
80
|
+
logger.warning(f"Error formatting eventplot data: {str(e)}")
|
|
70
81
|
return pd.DataFrame()
|
|
71
82
|
|
|
72
83
|
return pd.DataFrame()
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
-
# Timestamp: "2025-
|
|
4
|
-
# File: /
|
|
5
|
-
# ----------------------------------------
|
|
6
|
-
import os
|
|
7
|
-
|
|
8
|
-
__FILE__ = __file__
|
|
9
|
-
__DIR__ = os.path.dirname(__FILE__)
|
|
10
|
-
# ----------------------------------------
|
|
3
|
+
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
|
+
# File: /home/ywatanabe/proj/scitex-code/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py
|
|
11
5
|
|
|
12
6
|
import pandas as pd
|
|
13
7
|
|
|
8
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
9
|
+
from ._format_plot import _parse_tracking_id
|
|
10
|
+
|
|
14
11
|
|
|
15
12
|
def _format_imshow2d(id, tracked_dict, kwargs):
|
|
16
|
-
"""Format data from an imshow2d call.
|
|
13
|
+
"""Format data from an imshow2d call.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
id (str): Identifier for the plot
|
|
17
|
+
tracked_dict (dict): Dictionary containing tracked data
|
|
18
|
+
kwargs (dict): Keyword arguments passed to imshow2d
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
pd.DataFrame: Formatted data from imshow2d
|
|
22
|
+
"""
|
|
17
23
|
# Check if tracked_dict is empty or not a dictionary
|
|
18
24
|
if not tracked_dict or not isinstance(tracked_dict, dict):
|
|
19
25
|
return pd.DataFrame()
|
|
20
26
|
|
|
27
|
+
# Parse the tracking ID to get axes position and trace ID
|
|
28
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
29
|
+
|
|
21
30
|
# Get the args from tracked_dict
|
|
22
31
|
args = tracked_dict.get("args", [])
|
|
23
32
|
|
|
24
33
|
# Extract data if available
|
|
25
34
|
if len(args) >= 1 and isinstance(args[0], pd.DataFrame):
|
|
26
35
|
df = args[0].copy()
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
# Rename columns using the single source of truth
|
|
37
|
+
renamed_cols = {}
|
|
38
|
+
for col in df.columns:
|
|
39
|
+
renamed_cols[col] = get_csv_column_name(
|
|
40
|
+
f"imshow2d_{col}", ax_row, ax_col, trace_id=trace_id
|
|
41
|
+
)
|
|
42
|
+
df = df.rename(columns=renamed_cols)
|
|
30
43
|
return df
|
|
31
44
|
|
|
32
45
|
return pd.DataFrame()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# EOF
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
-
# Timestamp: "2025-12-
|
|
3
|
+
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
4
|
# File: /home/ywatanabe/proj/scitex-code/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
import pandas as pd
|
|
8
8
|
|
|
9
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
10
|
+
from ._format_plot import _parse_tracking_id
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
def _format_matshow(id, tracked_dict, kwargs):
|
|
11
14
|
"""Format data from a matshow call.
|
|
@@ -21,6 +24,9 @@ def _format_matshow(id, tracked_dict, kwargs):
|
|
|
21
24
|
if not tracked_dict or not isinstance(tracked_dict, dict):
|
|
22
25
|
return pd.DataFrame()
|
|
23
26
|
|
|
27
|
+
# Parse the tracking ID to get axes position and trace ID
|
|
28
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
29
|
+
|
|
24
30
|
if "args" in tracked_dict:
|
|
25
31
|
args = tracked_dict["args"]
|
|
26
32
|
if isinstance(args, tuple) and len(args) > 0:
|
|
@@ -31,9 +37,9 @@ def _format_matshow(id, tracked_dict, kwargs):
|
|
|
31
37
|
|
|
32
38
|
df = pd.DataFrame(
|
|
33
39
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
get_csv_column_name("row", ax_row, ax_col, trace_id=trace_id): rows.flatten(),
|
|
41
|
+
get_csv_column_name("col", ax_row, ax_col, trace_id=trace_id): cols.flatten(),
|
|
42
|
+
get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id): Z.flatten(),
|
|
37
43
|
}
|
|
38
44
|
)
|
|
39
45
|
return df
|
|
@@ -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_imshow(id, tracked_dict, kwargs):
|
|
@@ -29,8 +31,18 @@ def _format_plot_imshow(id, tracked_dict, kwargs):
|
|
|
29
31
|
|
|
30
32
|
# Add id prefix to column names if id is provided
|
|
31
33
|
if id is not None:
|
|
34
|
+
# Parse tracking ID to extract axes position and trace ID
|
|
35
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
36
|
+
|
|
37
|
+
# Use standardized column naming for each column
|
|
32
38
|
df = df.copy()
|
|
33
|
-
|
|
39
|
+
renamed_cols = {}
|
|
40
|
+
for col in df.columns:
|
|
41
|
+
# Create column name like "plot_imshow_row" or "plot_imshow_col"
|
|
42
|
+
renamed_cols[col] = get_csv_column_name(
|
|
43
|
+
f"plot_imshow_{col}", ax_row, ax_col, trace_id=trace_id
|
|
44
|
+
)
|
|
45
|
+
df.rename(columns=renamed_cols, inplace=True)
|
|
34
46
|
|
|
35
47
|
return df
|
|
36
48
|
|
|
@@ -11,6 +11,8 @@ __DIR__ = os.path.dirname(__FILE__)
|
|
|
11
11
|
|
|
12
12
|
import pandas as pd
|
|
13
13
|
from scitex.pd import force_df
|
|
14
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
15
|
+
from ._format_plot import _parse_tracking_id
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
def _format_plot_kde(id, tracked_dict, kwargs):
|
|
@@ -37,13 +39,21 @@ def _format_plot_kde(id, tracked_dict, kwargs):
|
|
|
37
39
|
if x is None or kde is None:
|
|
38
40
|
return pd.DataFrame()
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
# Parse tracking ID to extract axes position and trace ID
|
|
43
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
44
|
+
|
|
45
|
+
# Use standardized column naming
|
|
46
|
+
x_col = get_csv_column_name("kde_x", ax_row, ax_col, trace_id=trace_id)
|
|
47
|
+
density_col = get_csv_column_name("kde_density", ax_row, ax_col, trace_id=trace_id)
|
|
48
|
+
|
|
49
|
+
df = pd.DataFrame({x_col: x, density_col: kde})
|
|
41
50
|
|
|
42
51
|
# Add sample count if available
|
|
43
52
|
if n is not None:
|
|
44
53
|
# If n is a scalar, create a list with the same length as x
|
|
45
54
|
if not hasattr(n, "__len__"):
|
|
46
55
|
n = [n] * len(x)
|
|
47
|
-
|
|
56
|
+
n_col = get_csv_column_name("kde_n", ax_row, ax_col, trace_id=trace_id)
|
|
57
|
+
df[n_col] = n
|
|
48
58
|
|
|
49
59
|
return df
|
|
@@ -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_scatter(id, tracked_dict, kwargs):
|
|
@@ -26,10 +28,15 @@ def _format_plot_scatter(id, tracked_dict, kwargs):
|
|
|
26
28
|
scatter_df = tracked_dict.get("scatter_df")
|
|
27
29
|
|
|
28
30
|
if scatter_df is not None and isinstance(scatter_df, pd.DataFrame):
|
|
31
|
+
# Parse tracking ID to extract axes position and trace ID
|
|
32
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
33
|
+
|
|
34
|
+
# Use standardized column naming
|
|
35
|
+
x_col = get_csv_column_name("scatter_x", ax_row, ax_col, trace_id=trace_id)
|
|
36
|
+
y_col = get_csv_column_name("scatter_y", ax_row, ax_col, trace_id=trace_id)
|
|
37
|
+
|
|
29
38
|
# Rename columns to include the id
|
|
30
|
-
return scatter_df.rename(
|
|
31
|
-
columns={"x": f"{id}_scatter_x", "y": f"{id}_scatter_y"}
|
|
32
|
-
)
|
|
39
|
+
return scatter_df.rename(columns={"x": x_col, "y": y_col})
|
|
33
40
|
|
|
34
41
|
return pd.DataFrame()
|
|
35
42
|
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
import pandas as pd
|
|
8
8
|
|
|
9
|
+
from scitex.plt.utils._csv_column_naming import get_csv_column_name
|
|
10
|
+
from ._format_plot import _parse_tracking_id
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
def _format_quiver(id, tracked_dict, kwargs):
|
|
11
14
|
"""Format data from a quiver (vector field) call.
|
|
@@ -21,6 +24,9 @@ def _format_quiver(id, tracked_dict, kwargs):
|
|
|
21
24
|
if not tracked_dict or not isinstance(tracked_dict, dict):
|
|
22
25
|
return pd.DataFrame()
|
|
23
26
|
|
|
27
|
+
# Parse the tracking ID to get axes position and trace ID
|
|
28
|
+
ax_row, ax_col, trace_id = _parse_tracking_id(id)
|
|
29
|
+
|
|
24
30
|
if "args" in tracked_dict:
|
|
25
31
|
args = tracked_dict["args"]
|
|
26
32
|
if isinstance(args, tuple):
|
|
@@ -41,10 +47,10 @@ def _format_quiver(id, tracked_dict, kwargs):
|
|
|
41
47
|
|
|
42
48
|
df = pd.DataFrame(
|
|
43
49
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
get_csv_column_name("quiver-x", ax_row, ax_col, trace_id=trace_id): X.flatten(),
|
|
51
|
+
get_csv_column_name("quiver-y", ax_row, ax_col, trace_id=trace_id): Y.flatten(),
|
|
52
|
+
get_csv_column_name("quiver-u", ax_row, ax_col, trace_id=trace_id): U.flatten(),
|
|
53
|
+
get_csv_column_name("quiver-v", ax_row, ax_col, trace_id=trace_id): V.flatten(),
|
|
48
54
|
}
|
|
49
55
|
)
|
|
50
56
|
return df
|