scitex 2.10.2__py3-none-any.whl → 2.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scitex/__init__.py +1 -4
- scitex/__version__.py +1 -1
- scitex/_install_guide.py +14 -2
- scitex/bridge/_figrecipe.py +1 -1
- scitex/bridge/_helpers.py +1 -1
- scitex/bridge/_plt_vis.py +1 -1
- scitex/bridge/_stats_plt.py +1 -1
- scitex/bridge/_stats_vis.py +2 -2
- scitex/{fig → canvas}/__init__.py +84 -96
- scitex/{fig → canvas}/backend/_parser.py +1 -1
- scitex/{fig → canvas}/canvas.py +13 -14
- scitex/{fts/_fig/_editor → canvas/editor}/_defaults.py +2 -2
- scitex/{fig → canvas}/editor/edit/__init__.py +11 -14
- scitex/{fig → canvas}/editor/edit/bundle_resolver.py +56 -48
- scitex/{fig → canvas}/editor/edit/editor_launcher.py +79 -26
- scitex/{fts/_fig/_editor/_cui/_panel_loader.py → canvas/editor/edit/panel_loader.py} +8 -8
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_bbox.py +2 -1
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_core.py +84 -84
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_renderer.py +7 -6
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/static/css/features/canvas.css +2 -2
- scitex/{fig → canvas}/editor/flask_editor/static/css/features/panel-grid.css +1 -1
- scitex/{fig → canvas}/editor/flask_editor/static/js/core/api.js +3 -4
- scitex/{fig → canvas}/editor/flask_editor/static/js/editor/preview.js +5 -5
- scitex/{fig → canvas}/editor/flask_editor/templates/_html.py +3 -3
- scitex/{fig → canvas}/editor/flask_editor/templates/_scripts.py +10 -10
- scitex/{fig → canvas}/editor/flask_editor/templates/_styles.py +3 -3
- scitex/{fig → canvas}/io/__init__.py +32 -38
- scitex/{fig → canvas}/io/_bundle.py +217 -154
- scitex/{fig → canvas}/io/_canvas.py +1 -1
- scitex/{fig → canvas}/io/_data.py +1 -1
- scitex/{fig → canvas}/io/_export.py +1 -1
- scitex/{fig → canvas}/io/_load.py +1 -1
- scitex/{fig → canvas}/io/_panel.py +1 -1
- scitex/{fig → canvas}/io/_save.py +1 -1
- scitex/{fig → canvas}/model/__init__.py +1 -1
- scitex/{fig → canvas}/model/_annotations.py +1 -1
- scitex/{fig → canvas}/model/_axes.py +1 -1
- scitex/{fig → canvas}/model/_figure.py +1 -1
- scitex/{fig → canvas}/model/_guides.py +1 -1
- scitex/{fig → canvas}/model/_plot.py +1 -1
- scitex/{fig → canvas}/model/_styles.py +1 -1
- scitex/{fig → canvas}/utils/__init__.py +1 -1
- scitex/cli/convert.py +10 -6
- scitex/diagram/README.md +7 -7
- scitex/io/__init__.py +7 -19
- scitex/io/_load.py +15 -19
- scitex/io/_load_modules/_canvas.py +2 -2
- scitex/io/_load_modules/_con.py +5 -5
- scitex/io/_load_modules/_eeg.py +16 -12
- scitex/io/_save.py +11 -16
- scitex/io/_save_modules/__init__.py +6 -10
- scitex/io/_save_modules/_canvas.py +3 -3
- scitex/io/_save_modules/_plot_bundle.py +112 -0
- scitex/io/_save_modules/{_pltz_stx.py → _plot_scitex.py} +7 -7
- scitex/io/_save_modules/_stx_bundle.py +16 -16
- scitex/io/bundle/README.md +89 -80
- scitex/{fts/_bundle/_FTS.py → io/bundle/_Bundle.py} +197 -95
- scitex/io/bundle/__init__.py +67 -35
- scitex/{fts/_bundle → io/bundle}/_children.py +32 -40
- scitex/io/bundle/_core.py +184 -97
- scitex/{fts/_bundle/_dataclasses/_Node.py → io/bundle/_dataclasses/_Spec.py} +29 -23
- scitex/{fts/_bundle/_dataclasses/_NodeRefs.py → io/bundle/_dataclasses/_SpecRefs.py} +6 -6
- scitex/{fts/_bundle → io/bundle}/_dataclasses/__init__.py +4 -4
- scitex/{fts/_bundle → io/bundle}/_loader.py +19 -19
- scitex/io/bundle/_manifest.py +99 -0
- scitex/{fts/_bundle → io/bundle}/_mpl_helpers.py +119 -28
- scitex/io/bundle/_nested.py +113 -100
- scitex/{fts/_bundle → io/bundle}/_saver.py +13 -14
- scitex/{fts/_bundle → io/bundle}/_storage.py +3 -3
- scitex/io/bundle/_types.py +41 -16
- scitex/{fts/_bundle → io/bundle}/_validation.py +20 -18
- scitex/io/bundle/_zip.py +21 -31
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_backend/_parser.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Annotations.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Axes.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Figure.py +1 -1
- scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Guides.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Plot.py +1 -1
- scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Styles.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_utils/_plot_layout.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/__init__.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/_app.py +1 -1
- scitex/{fts/_tables → io/bundle/kinds/_table}/_latex/_export.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_figure_exporter.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_table_exporter.py +1 -1
- scitex/io/bundle/schemas/__init__.py +30 -0
- scitex/parallel/_run.py +5 -4
- scitex/path/_find.py +60 -83
- scitex/path/_get_module_path.py +23 -21
- scitex/path/_get_spath.py +6 -27
- scitex/path/_getsize.py +23 -9
- scitex/path/_increment_version.py +31 -38
- scitex/path/_mk_spath.py +26 -29
- scitex/path/_path.py +5 -12
- scitex/path/_split.py +27 -15
- scitex/path/_this_path.py +23 -9
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +2 -1
- scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +2 -2
- scitex/plt/gallery/_generate.py +76 -50
- scitex/plt/io/__init__.py +17 -19
- scitex/plt/io/_bundle.py +99 -52
- scitex/plt/io/_layered_bundle.py +303 -168
- scitex/plt/utils/_csv_column_naming.py +250 -118
- scitex/schema/__init__.py +69 -73
- scitex/schema/_canvas.py +1 -1
- scitex/schema/_stats.py +2 -2
- scitex/stats/__init__.py +30 -33
- scitex/stats/_schema.py +1 -1
- scitex/stats/io/__init__.py +10 -11
- scitex/stats/io/_bundle.py +16 -16
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/METADATA +191 -72
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/RECORD +237 -360
- scitex/fig/editor/_defaults.py +0 -300
- scitex/fig/editor/edit/panel_loader.py +0 -232
- scitex/fig/editor/flask_editor/_bbox.py +0 -1299
- scitex/fig/editor/flask_editor/_core.py +0 -1429
- scitex/fig/editor/flask_editor/_renderer.py +0 -813
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +0 -176
- scitex/fts/README.md +0 -262
- scitex/fts/TODO.md +0 -66
- scitex/fts/__init__.py +0 -90
- scitex/fts/_bundle/README_IN_BUNDLE.md +0 -102
- scitex/fts/_bundle/__init__.py +0 -38
- scitex/fts/_bundle/_utils/__init__.py +0 -55
- scitex/fts/_bundle/_utils/_const.py +0 -26
- scitex/fts/_bundle/_utils/_errors.py +0 -73
- scitex/fts/_bundle/_utils/_generate.py +0 -21
- scitex/fts/_bundle/_utils/_types.py +0 -76
- scitex/fts/_bundle/_zipbundle.py +0 -165
- scitex/fts/_fig/__init__.py +0 -22
- scitex/fts/_fig/_backend/_parser.py +0 -188
- scitex/fts/_fig/_editor/__init__.py +0 -14
- scitex/fts/_fig/_editor/_cui/__init__.py +0 -33
- scitex/fts/_fig/_editor/_cui/_backend_detector.py +0 -39
- scitex/fts/_fig/_editor/_cui/_bundle_resolver.py +0 -366
- scitex/fts/_fig/_editor/_cui/_editor_launcher.py +0 -175
- scitex/fts/_fig/_editor/_cui/_manual_handler.py +0 -52
- scitex/fts/_fig/_editor/_cui/_path_resolver.py +0 -66
- scitex/fts/_fig/_editor/_gui/__init__.py +0 -11
- scitex/fts/_fig/_editor/_gui/_flask_editor/__init__.py +0 -20
- scitex/fts/_fig/_editor/_gui/_flask_editor/_plotter.py +0 -664
- scitex/fts/_fig/_editor/_gui/_flask_editor/_utils.py +0 -79
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/reset.css +0 -41
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/typography.css +0 -16
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/variables.css +0 -85
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/buttons.css +0 -217
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/context-menu.css +0 -93
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/dropdown.css +0 -57
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/forms.css +0 -112
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/modal.css +0 -59
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/sections.css +0 -212
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/element-inspector.css +0 -190
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/loading.css +0 -59
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/overlay.css +0 -45
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/panel-grid.css +0 -95
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/selection.css +0 -101
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/statistics.css +0 -138
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/index.css +0 -31
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/container.css +0 -7
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/controls.css +0 -56
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/preview.css +0 -78
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/axis.js +0 -314
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/basic.js +0 -107
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/distribute.js +0 -54
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/canvas.js +0 -172
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/dragging.js +0 -258
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/resize.js +0 -48
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/selection.js +0 -71
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/api.js +0 -288
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/state.js +0 -143
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/utils.js +0 -245
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/dev/element-inspector.js +0 -992
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/bbox.js +0 -339
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/element-drag.js +0 -286
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/overlay.js +0 -371
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/preview.js +0 -293
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/main.js +0 -426
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/context-menu.js +0 -152
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/keyboard.js +0 -265
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/controls.js +0 -184
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/download.js +0 -57
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/help.js +0 -100
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/theme.js +0 -34
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/__init__.py +0 -124
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_html.py +0 -851
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_scripts.py +0 -4932
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_styles.py +0 -1657
- scitex/fts/_fig/_editor/_gui/_flask_editor.py +0 -36
- scitex/fts/_fig/_models/_Annotations.py +0 -115
- scitex/fts/_fig/_models/_Axes.py +0 -152
- scitex/fts/_fig/_models/_Figure.py +0 -138
- scitex/fts/_fig/_models/_Plot.py +0 -123
- scitex/fts/_fig/_utils/_plot_layout.py +0 -397
- scitex/fts/_kinds/_figure/_composite.py +0 -345
- scitex/fts/_kinds/_plot/_backend/__init__.py +0 -53
- scitex/fts/_kinds/_plot/_backend/_export.py +0 -165
- scitex/fts/_kinds/_plot/_backend/_render.py +0 -538
- scitex/fts/_kinds/_plot/_dataclasses/_ChannelEncoding.py +0 -46
- scitex/fts/_kinds/_plot/_dataclasses/_Encoding.py +0 -82
- scitex/fts/_kinds/_plot/_dataclasses/_Theme.py +0 -441
- scitex/fts/_kinds/_plot/_dataclasses/_TraceEncoding.py +0 -52
- scitex/fts/_kinds/_plot/_dataclasses/__init__.py +0 -47
- scitex/fts/_kinds/_plot/_models/_Guides.py +0 -104
- scitex/fts/_kinds/_plot/_models/_Styles.py +0 -245
- scitex/fts/_kinds/_plot/_models/__init__.py +0 -80
- scitex/fts/_kinds/_plot/_models/_plot_types/__init__.py +0 -156
- scitex/fts/_kinds/_plot/_models/_plot_types/_bar.py +0 -43
- scitex/fts/_kinds/_plot/_models/_plot_types/_box.py +0 -38
- scitex/fts/_kinds/_plot/_models/_plot_types/_distribution.py +0 -36
- scitex/fts/_kinds/_plot/_models/_plot_types/_errorbar.py +0 -60
- scitex/fts/_kinds/_plot/_models/_plot_types/_histogram.py +0 -30
- scitex/fts/_kinds/_plot/_models/_plot_types/_image.py +0 -61
- scitex/fts/_kinds/_plot/_models/_plot_types/_line.py +0 -57
- scitex/fts/_kinds/_plot/_models/_plot_types/_scatter.py +0 -30
- scitex/fts/_kinds/_plot/_models/_plot_types/_seaborn.py +0 -121
- scitex/fts/_kinds/_plot/_models/_plot_types/_violin.py +0 -36
- scitex/fts/_kinds/_plot/_utils/__init__.py +0 -129
- scitex/fts/_kinds/_plot/_utils/_auto_layout.py +0 -127
- scitex/fts/_kinds/_plot/_utils/_calc_bounds.py +0 -111
- scitex/fts/_kinds/_plot/_utils/_const_sizes.py +0 -48
- scitex/fts/_kinds/_plot/_utils/_convert_coords.py +0 -77
- scitex/fts/_kinds/_plot/_utils/_get_template.py +0 -178
- scitex/fts/_kinds/_plot/_utils/_normalize.py +0 -73
- scitex/fts/_kinds/_plot/_utils/_validate.py +0 -197
- scitex/fts/_kinds/_table/_latex/_export.py +0 -279
- scitex/fts/_stats/__init__.py +0 -48
- scitex/fts/_stats/_dataclasses/_Stats.py +0 -423
- scitex/fts/_stats/_dataclasses/__init__.py +0 -48
- scitex/fts/_tables/__init__.py +0 -65
- scitex/fts/_tables/_latex/__init__.py +0 -93
- scitex/fts/_tables/_latex/_editor/__init__.py +0 -11
- scitex/fts/_tables/_latex/_editor/_app.py +0 -725
- scitex/fts/_tables/_latex/_figure_exporter.py +0 -153
- scitex/fts/_tables/_latex/_stats_formatter.py +0 -274
- scitex/fts/_tables/_latex/_table_exporter.py +0 -362
- scitex/fts/_tables/_latex/_utils.py +0 -369
- scitex/fts/_tables/_latex/_validator.py +0 -445
- scitex/io/_save_modules/_pltz_bundle.py +0 -356
- /scitex/{fig → canvas}/README.md +0 -0
- /scitex/{fig → canvas}/backend/__init__.py +0 -0
- /scitex/{fig → canvas}/backend/_export.py +0 -0
- /scitex/{fig → canvas}/backend/_render.py +0 -0
- /scitex/{fig → canvas}/docs/CANVAS_ARCHITECTURE.md +0 -0
- /scitex/{fig → canvas}/editor/__init__.py +0 -0
- /scitex/{fig → canvas}/editor/_dearpygui_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_flask_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_mpl_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_qt_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_tkinter_editor.py +0 -0
- /scitex/{fig → canvas}/editor/edit/backend_detector.py +0 -0
- /scitex/{fig → canvas}/editor/edit/manual_handler.py +0 -0
- /scitex/{fig → canvas}/editor/edit/path_resolver.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/__init__.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/_plotter.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/_utils.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/reset.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/typography.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/variables.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/buttons.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/context-menu.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/dropdown.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/forms.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/modal.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/sections.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/element-inspector.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/loading.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/overlay.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/selection.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/statistics.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/index.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/container.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/controls.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/preview.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/axis.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/basic.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/distribute.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/canvas.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/dragging.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/resize.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/selection.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/core/state.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/core/utils.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/dev/element-inspector.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/bbox.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/element-drag.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/overlay.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/main.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/context-menu.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/keyboard.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/controls.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/download.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/help.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/theme.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/templates/__init__.py +0 -0
- /scitex/{fig → canvas}/io/_directory.py +0 -0
- /scitex/{fig → canvas}/model/_plot_types.py +0 -0
- /scitex/{fig → canvas}/utils/_defaults.py +0 -0
- /scitex/{fig → canvas}/utils/_validate.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/__init__.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/_bundle2dict.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/_dict2bundle.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_Axes.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_BBox.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_ColumnDef.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataFormat.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataInfo.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataSource.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_SizeMM.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/__init__.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_bar.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_line.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_scatter.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_figure/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_figure}/_composite.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_plot/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_export.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_render.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_ChannelEncoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Encoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Theme.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_TraceEncoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_bar.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_box.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_distribution.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_errorbar.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_histogram.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_image.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_line.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_scatter.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_seaborn.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_violin.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_auto_layout.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_calc_bounds.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_const_sizes.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_convert_coords.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_get_template.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_normalize.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_validate.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_shape/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/_Stats.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_stats_formatter.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_utils.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_validator.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_text/__init__.py +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/data_info.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/encoding.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/node.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/render_manifest.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/stats.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/theme.schema.json +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/WHEEL +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/entry_points.txt +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# Timestamp: 2025-12-20
|
|
3
|
-
# File: /home/ywatanabe/proj/scitex-code/src/scitex/fsb/_tables/_latex/_utils.py
|
|
4
|
-
|
|
5
|
-
"""LaTeX utility functions for escaping and formatting."""
|
|
6
|
-
|
|
7
|
-
import re
|
|
8
|
-
from typing import Any, Optional
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Characters that need escaping in LaTeX
|
|
12
|
-
LATEX_SPECIAL_CHARS = {
|
|
13
|
-
"&": r"\&",
|
|
14
|
-
"%": r"\%",
|
|
15
|
-
"$": r"\$",
|
|
16
|
-
"#": r"\#",
|
|
17
|
-
"_": r"\_",
|
|
18
|
-
"{": r"\{",
|
|
19
|
-
"}": r"\}",
|
|
20
|
-
"~": r"\textasciitilde{}",
|
|
21
|
-
"^": r"\textasciicircum{}",
|
|
22
|
-
"\\": r"\textbackslash{}",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
# Greek letters mapping
|
|
26
|
-
GREEK_LETTERS = {
|
|
27
|
-
"alpha": r"\alpha",
|
|
28
|
-
"beta": r"\beta",
|
|
29
|
-
"gamma": r"\gamma",
|
|
30
|
-
"delta": r"\delta",
|
|
31
|
-
"epsilon": r"\epsilon",
|
|
32
|
-
"mu": r"\mu",
|
|
33
|
-
"sigma": r"\sigma",
|
|
34
|
-
"chi": r"\chi",
|
|
35
|
-
"eta": r"\eta",
|
|
36
|
-
"theta": r"\theta",
|
|
37
|
-
"lambda": r"\lambda",
|
|
38
|
-
"omega": r"\omega",
|
|
39
|
-
"pi": r"\pi",
|
|
40
|
-
"rho": r"\rho",
|
|
41
|
-
"tau": r"\tau",
|
|
42
|
-
"phi": r"\phi",
|
|
43
|
-
"psi": r"\psi",
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
# Unit formatting for siunitx
|
|
47
|
-
UNIT_LATEX = {
|
|
48
|
-
"ms": r"\milli\second",
|
|
49
|
-
"s": r"\second",
|
|
50
|
-
"Hz": r"\hertz",
|
|
51
|
-
"kHz": r"\kilo\hertz",
|
|
52
|
-
"MHz": r"\mega\hertz",
|
|
53
|
-
"mm": r"\milli\metre",
|
|
54
|
-
"cm": r"\centi\metre",
|
|
55
|
-
"m": r"\metre",
|
|
56
|
-
"kg": r"\kilo\gram",
|
|
57
|
-
"g": r"\gram",
|
|
58
|
-
"mg": r"\milli\gram",
|
|
59
|
-
"mV": r"\milli\volt",
|
|
60
|
-
"V": r"\volt",
|
|
61
|
-
"mA": r"\milli\ampere",
|
|
62
|
-
"A": r"\ampere",
|
|
63
|
-
"%": r"\percent",
|
|
64
|
-
"years": r"years",
|
|
65
|
-
"yr": r"yr",
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def escape_latex(text: str) -> str:
|
|
70
|
-
"""Escape special LaTeX characters in text.
|
|
71
|
-
|
|
72
|
-
Args:
|
|
73
|
-
text: Plain text string
|
|
74
|
-
|
|
75
|
-
Returns:
|
|
76
|
-
LaTeX-safe string with special characters escaped
|
|
77
|
-
"""
|
|
78
|
-
if not text:
|
|
79
|
-
return ""
|
|
80
|
-
|
|
81
|
-
result = str(text)
|
|
82
|
-
# Process backslash FIRST to avoid double-escaping
|
|
83
|
-
if "\\" in result:
|
|
84
|
-
result = result.replace("\\", r"\textbackslash{}")
|
|
85
|
-
# Then other special characters (order doesn't matter for these)
|
|
86
|
-
for char in ["&", "%", "$", "#", "_", "{", "}", "~", "^"]:
|
|
87
|
-
if char in LATEX_SPECIAL_CHARS:
|
|
88
|
-
result = result.replace(char, LATEX_SPECIAL_CHARS[char])
|
|
89
|
-
return result
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
def escape_latex_minimal(text: str) -> str:
|
|
93
|
-
"""Minimal escaping for text that may contain intentional LaTeX.
|
|
94
|
-
|
|
95
|
-
Only escapes & % # which are most likely unintentional.
|
|
96
|
-
|
|
97
|
-
Args:
|
|
98
|
-
text: Text that may contain LaTeX commands
|
|
99
|
-
|
|
100
|
-
Returns:
|
|
101
|
-
Minimally escaped string
|
|
102
|
-
"""
|
|
103
|
-
if not text:
|
|
104
|
-
return ""
|
|
105
|
-
|
|
106
|
-
result = str(text)
|
|
107
|
-
for char in ["&", "%", "#"]:
|
|
108
|
-
result = result.replace(char, LATEX_SPECIAL_CHARS[char])
|
|
109
|
-
return result
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
def format_unit(unit: Optional[str], use_siunitx: bool = False) -> str:
|
|
113
|
-
"""Format a unit string for LaTeX.
|
|
114
|
-
|
|
115
|
-
Args:
|
|
116
|
-
unit: Unit string (e.g., "ms", "Hz")
|
|
117
|
-
use_siunitx: Whether to use siunitx package format
|
|
118
|
-
|
|
119
|
-
Returns:
|
|
120
|
-
LaTeX formatted unit string
|
|
121
|
-
"""
|
|
122
|
-
if not unit:
|
|
123
|
-
return ""
|
|
124
|
-
|
|
125
|
-
if use_siunitx:
|
|
126
|
-
return UNIT_LATEX.get(unit, escape_latex(unit))
|
|
127
|
-
else:
|
|
128
|
-
# Simple formatting
|
|
129
|
-
return escape_latex(unit)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def format_number(
|
|
133
|
-
value: float,
|
|
134
|
-
precision: int = 3,
|
|
135
|
-
scientific: bool = False,
|
|
136
|
-
use_siunitx: bool = False,
|
|
137
|
-
) -> str:
|
|
138
|
-
"""Format a number for LaTeX.
|
|
139
|
-
|
|
140
|
-
Args:
|
|
141
|
-
value: Numeric value
|
|
142
|
-
precision: Decimal places
|
|
143
|
-
scientific: Use scientific notation
|
|
144
|
-
use_siunitx: Use siunitx \\num{} command
|
|
145
|
-
|
|
146
|
-
Returns:
|
|
147
|
-
LaTeX formatted number string
|
|
148
|
-
"""
|
|
149
|
-
if value is None:
|
|
150
|
-
return "---"
|
|
151
|
-
|
|
152
|
-
if scientific or (abs(value) > 0 and (abs(value) >= 1e4 or abs(value) < 1e-3)):
|
|
153
|
-
formatted = f"{value:.{precision}e}"
|
|
154
|
-
else:
|
|
155
|
-
formatted = f"{value:.{precision}f}"
|
|
156
|
-
|
|
157
|
-
if use_siunitx:
|
|
158
|
-
return rf"\num{{{formatted}}}"
|
|
159
|
-
return formatted
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
def format_p_value(p: float, threshold: float = 0.001) -> str:
|
|
163
|
-
"""Format a p-value for scientific reporting.
|
|
164
|
-
|
|
165
|
-
Args:
|
|
166
|
-
p: P-value
|
|
167
|
-
threshold: Threshold below which to show "< threshold"
|
|
168
|
-
|
|
169
|
-
Returns:
|
|
170
|
-
Formatted p-value string (e.g., ".023" or "< .001")
|
|
171
|
-
"""
|
|
172
|
-
if p is None:
|
|
173
|
-
return "---"
|
|
174
|
-
|
|
175
|
-
if p < threshold:
|
|
176
|
-
return f"< {threshold:.3f}".lstrip("0")
|
|
177
|
-
elif p < 0.01:
|
|
178
|
-
return f"{p:.3f}".lstrip("0")
|
|
179
|
-
else:
|
|
180
|
-
return f"{p:.2f}".lstrip("0")
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def format_statistic(
|
|
184
|
-
name: str,
|
|
185
|
-
value: float,
|
|
186
|
-
df: Optional[float] = None,
|
|
187
|
-
precision: int = 2,
|
|
188
|
-
) -> str:
|
|
189
|
-
"""Format a test statistic for LaTeX.
|
|
190
|
-
|
|
191
|
-
Args:
|
|
192
|
-
name: Statistic name (t, F, chi2, r, etc.)
|
|
193
|
-
value: Statistic value
|
|
194
|
-
df: Degrees of freedom
|
|
195
|
-
precision: Decimal places
|
|
196
|
-
|
|
197
|
-
Returns:
|
|
198
|
-
LaTeX math mode string (e.g., "$t(48) = 2.31$")
|
|
199
|
-
"""
|
|
200
|
-
stat_symbols = {
|
|
201
|
-
"t": "t",
|
|
202
|
-
"F": "F",
|
|
203
|
-
"chi2": r"\chi^2",
|
|
204
|
-
"chi_squared": r"\chi^2",
|
|
205
|
-
"r": "r",
|
|
206
|
-
"rho": r"\rho",
|
|
207
|
-
"z": "z",
|
|
208
|
-
"W": "W",
|
|
209
|
-
"U": "U",
|
|
210
|
-
"H": "H",
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
symbol = stat_symbols.get(name, name)
|
|
214
|
-
|
|
215
|
-
if df is not None:
|
|
216
|
-
if isinstance(df, float) and df == int(df):
|
|
217
|
-
df_str = str(int(df))
|
|
218
|
-
else:
|
|
219
|
-
df_str = str(df)
|
|
220
|
-
return f"${symbol}({df_str}) = {value:.{precision}f}$"
|
|
221
|
-
else:
|
|
222
|
-
return f"${symbol} = {value:.{precision}f}$"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
def format_effect_size(
|
|
226
|
-
name: str,
|
|
227
|
-
value: float,
|
|
228
|
-
ci_lower: Optional[float] = None,
|
|
229
|
-
ci_upper: Optional[float] = None,
|
|
230
|
-
precision: int = 2,
|
|
231
|
-
) -> str:
|
|
232
|
-
"""Format an effect size for LaTeX.
|
|
233
|
-
|
|
234
|
-
Args:
|
|
235
|
-
name: Effect size name (cohens_d, hedges_g, eta_squared, etc.)
|
|
236
|
-
value: Effect size value
|
|
237
|
-
ci_lower: Lower CI bound
|
|
238
|
-
ci_upper: Upper CI bound
|
|
239
|
-
precision: Decimal places
|
|
240
|
-
|
|
241
|
-
Returns:
|
|
242
|
-
LaTeX formatted effect size string
|
|
243
|
-
"""
|
|
244
|
-
es_symbols = {
|
|
245
|
-
"cohens_d": "d",
|
|
246
|
-
"hedges_g": "g",
|
|
247
|
-
"eta_squared": r"\eta^2",
|
|
248
|
-
"partial_eta_squared": r"\eta_p^2",
|
|
249
|
-
"omega_squared": r"\omega^2",
|
|
250
|
-
"r_squared": "R^2",
|
|
251
|
-
"cramers_v": "V",
|
|
252
|
-
"phi": r"\phi",
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
symbol = es_symbols.get(name, name)
|
|
256
|
-
result = f"${symbol} = {value:.{precision}f}$"
|
|
257
|
-
|
|
258
|
-
if ci_lower is not None and ci_upper is not None:
|
|
259
|
-
result += f" [{ci_lower:.{precision}f}, {ci_upper:.{precision}f}]"
|
|
260
|
-
|
|
261
|
-
return result
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
def significance_stars(p: float, levels: tuple = (0.05, 0.01, 0.001)) -> str:
|
|
265
|
-
"""Get significance stars for a p-value.
|
|
266
|
-
|
|
267
|
-
Args:
|
|
268
|
-
p: P-value
|
|
269
|
-
levels: Significance levels (default: .05, .01, .001)
|
|
270
|
-
|
|
271
|
-
Returns:
|
|
272
|
-
Stars string ("*", "**", "***", or "")
|
|
273
|
-
"""
|
|
274
|
-
if p is None:
|
|
275
|
-
return ""
|
|
276
|
-
|
|
277
|
-
if p < levels[2]:
|
|
278
|
-
return "***"
|
|
279
|
-
elif p < levels[1]:
|
|
280
|
-
return "**"
|
|
281
|
-
elif p < levels[0]:
|
|
282
|
-
return "*"
|
|
283
|
-
return ""
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
def sanitize_label(text: str) -> str:
|
|
287
|
-
"""Sanitize a string for use as a LaTeX label.
|
|
288
|
-
|
|
289
|
-
Args:
|
|
290
|
-
text: Text to sanitize
|
|
291
|
-
|
|
292
|
-
Returns:
|
|
293
|
-
Label-safe string (alphanumeric, hyphens, underscores only)
|
|
294
|
-
"""
|
|
295
|
-
if not text:
|
|
296
|
-
return "unnamed"
|
|
297
|
-
|
|
298
|
-
# Replace spaces with underscores
|
|
299
|
-
result = text.replace(" ", "_")
|
|
300
|
-
# Keep only alphanumeric, hyphens, underscores
|
|
301
|
-
result = re.sub(r"[^a-zA-Z0-9_-]", "", result)
|
|
302
|
-
# Ensure doesn't start with number
|
|
303
|
-
if result and result[0].isdigit():
|
|
304
|
-
result = "n" + result
|
|
305
|
-
return result or "unnamed"
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
def wrap_math(text: str) -> str:
|
|
309
|
-
"""Wrap text in math mode if not already.
|
|
310
|
-
|
|
311
|
-
Args:
|
|
312
|
-
text: Text to wrap
|
|
313
|
-
|
|
314
|
-
Returns:
|
|
315
|
-
Math mode string
|
|
316
|
-
"""
|
|
317
|
-
if not text:
|
|
318
|
-
return ""
|
|
319
|
-
if text.startswith("$") and text.endswith("$"):
|
|
320
|
-
return text
|
|
321
|
-
return f"${text}$"
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
def column_spec(
|
|
325
|
-
num_cols: int,
|
|
326
|
-
alignment: str = "l",
|
|
327
|
-
first_col: str = "l",
|
|
328
|
-
use_siunitx: bool = False,
|
|
329
|
-
) -> str:
|
|
330
|
-
"""Generate LaTeX column specification.
|
|
331
|
-
|
|
332
|
-
Args:
|
|
333
|
-
num_cols: Total number of columns
|
|
334
|
-
alignment: Default alignment for data columns
|
|
335
|
-
first_col: Alignment for first column (usually labels)
|
|
336
|
-
use_siunitx: Use S columns for numeric alignment
|
|
337
|
-
|
|
338
|
-
Returns:
|
|
339
|
-
Column spec string (e.g., "lrrr" or "lSSS")
|
|
340
|
-
"""
|
|
341
|
-
if num_cols < 1:
|
|
342
|
-
return "l"
|
|
343
|
-
|
|
344
|
-
if use_siunitx:
|
|
345
|
-
data_cols = "S" * (num_cols - 1)
|
|
346
|
-
else:
|
|
347
|
-
data_cols = alignment * (num_cols - 1)
|
|
348
|
-
|
|
349
|
-
return first_col + data_cols
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
__all__ = [
|
|
353
|
-
"escape_latex",
|
|
354
|
-
"escape_latex_minimal",
|
|
355
|
-
"format_unit",
|
|
356
|
-
"format_number",
|
|
357
|
-
"format_p_value",
|
|
358
|
-
"format_statistic",
|
|
359
|
-
"format_effect_size",
|
|
360
|
-
"significance_stars",
|
|
361
|
-
"sanitize_label",
|
|
362
|
-
"wrap_math",
|
|
363
|
-
"column_spec",
|
|
364
|
-
"LATEX_SPECIAL_CHARS",
|
|
365
|
-
"GREEK_LETTERS",
|
|
366
|
-
"UNIT_LATEX",
|
|
367
|
-
]
|
|
368
|
-
|
|
369
|
-
# EOF
|