scitex 2.10.3__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.3.dist-info → scitex-2.11.0.dist-info}/METADATA +190 -73
- {scitex-2.10.3.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.3.dist-info → scitex-2.11.0.dist-info}/WHEEL +0 -0
- {scitex-2.10.3.dist-info → scitex-2.11.0.dist-info}/entry_points.txt +0 -0
- {scitex-2.10.3.dist-info → scitex-2.11.0.dist-info}/licenses/LICENSE +0 -0
scitex/schema/__init__.py
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
SciTeX Schema Module - DEPRECATED
|
|
6
6
|
|
|
7
7
|
This module is scheduled for removal. All schemas are being consolidated
|
|
8
|
-
in scitex.
|
|
8
|
+
in scitex.io.bundle as the single source of truth.
|
|
9
9
|
|
|
10
|
-
For new code, import from scitex.
|
|
11
|
-
from scitex.
|
|
10
|
+
For new code, import from scitex.io.bundle:
|
|
11
|
+
from scitex.io.bundle import FTS, Node, Encoding, Theme, Stats
|
|
12
12
|
|
|
13
13
|
This module exists temporarily for backward compatibility.
|
|
14
14
|
"""
|
|
@@ -16,31 +16,28 @@ This module exists temporarily for backward compatibility.
|
|
|
16
16
|
import warnings
|
|
17
17
|
|
|
18
18
|
warnings.warn(
|
|
19
|
-
"scitex.schema is deprecated. Import from scitex.
|
|
19
|
+
"scitex.schema is deprecated. Import from scitex.io.bundle instead. "
|
|
20
20
|
"This module will be removed in a future version.",
|
|
21
21
|
DeprecationWarning,
|
|
22
|
-
stacklevel=2
|
|
22
|
+
stacklevel=2,
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
# Schema version
|
|
26
26
|
SCHEMA_VERSION = "0.2.0"
|
|
27
27
|
|
|
28
28
|
# =============================================================================
|
|
29
|
-
# Re-export from scitex.
|
|
29
|
+
# Re-export from scitex.io.bundle (new single source of truth)
|
|
30
30
|
# =============================================================================
|
|
31
31
|
try:
|
|
32
|
-
from scitex.
|
|
33
|
-
# Core bundle classes
|
|
32
|
+
from scitex.io.bundle import ( # Core bundle classes; Encoding and Theme; Stats
|
|
34
33
|
FTS,
|
|
35
|
-
Node,
|
|
36
34
|
BBox,
|
|
37
|
-
SizeMM,
|
|
38
35
|
DataInfo,
|
|
39
|
-
# Encoding and Theme
|
|
40
36
|
Encoding,
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
Node,
|
|
38
|
+
SizeMM,
|
|
43
39
|
Stats,
|
|
40
|
+
Theme,
|
|
44
41
|
)
|
|
45
42
|
except ImportError:
|
|
46
43
|
# FTS not fully configured yet
|
|
@@ -52,21 +49,10 @@ except ImportError:
|
|
|
52
49
|
|
|
53
50
|
# =============================================================================
|
|
54
51
|
# Independent schemas (still defined here temporarily)
|
|
55
|
-
# These will be migrated to scitex.
|
|
52
|
+
# These will be migrated to scitex.io.bundle in subsequent phases
|
|
56
53
|
# =============================================================================
|
|
57
54
|
|
|
58
55
|
# Stats schema (GUI-focused version - to be merged with FTS Stats)
|
|
59
|
-
from scitex.schema._stats import (
|
|
60
|
-
Position,
|
|
61
|
-
PositionMode,
|
|
62
|
-
StatPositioning,
|
|
63
|
-
StatResult,
|
|
64
|
-
StatStyling,
|
|
65
|
-
SymbolStyle,
|
|
66
|
-
UnitType,
|
|
67
|
-
create_stat_result,
|
|
68
|
-
)
|
|
69
|
-
|
|
70
56
|
# Encoding schema
|
|
71
57
|
from scitex.schema._encoding import (
|
|
72
58
|
ENCODING_VERSION,
|
|
@@ -87,48 +73,58 @@ from scitex.schema._figure_elements import (
|
|
|
87
73
|
generate_caption_markdown,
|
|
88
74
|
)
|
|
89
75
|
|
|
90
|
-
# Theme schema
|
|
91
|
-
from scitex.schema._theme import (
|
|
92
|
-
THEME_VERSION,
|
|
93
|
-
ColorScheme,
|
|
94
|
-
LegendStyle,
|
|
95
|
-
LineDefaults,
|
|
96
|
-
MarkerDefaults,
|
|
97
|
-
PlotTheme,
|
|
98
|
-
Typography,
|
|
99
|
-
)
|
|
100
|
-
from scitex.schema._theme import TraceStyle as ThemeTraceStyle
|
|
101
|
-
|
|
102
76
|
# Plot schema
|
|
103
77
|
from scitex.schema._plot import (
|
|
104
78
|
DPI_FALLBACK,
|
|
105
79
|
PLOT_GEOMETRY_VERSION,
|
|
106
80
|
PLOT_SPEC_VERSION,
|
|
107
81
|
PLOT_STYLE_VERSION,
|
|
82
|
+
AxesLabels,
|
|
83
|
+
AxesLimits,
|
|
84
|
+
AxesSpecItem,
|
|
108
85
|
BboxPx,
|
|
109
86
|
BboxRatio,
|
|
110
87
|
CoordinateSpace,
|
|
88
|
+
DataSourceSpec,
|
|
89
|
+
FontSpec,
|
|
90
|
+
HitRegionEntry,
|
|
111
91
|
LegendLocation,
|
|
92
|
+
LegendSpec,
|
|
93
|
+
PlotGeometry,
|
|
94
|
+
PlotSpec,
|
|
95
|
+
PlotStyle,
|
|
96
|
+
RenderedArtist,
|
|
97
|
+
RenderedAxes,
|
|
98
|
+
RenderManifest,
|
|
99
|
+
SelectableRegion,
|
|
100
|
+
SizeSpec,
|
|
101
|
+
ThemeSpec,
|
|
102
|
+
TraceSpec,
|
|
103
|
+
TraceStyleSpec,
|
|
112
104
|
TraceType,
|
|
113
105
|
)
|
|
114
|
-
from scitex.schema.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
from scitex.schema.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
106
|
+
from scitex.schema._stats import (
|
|
107
|
+
Position,
|
|
108
|
+
PositionMode,
|
|
109
|
+
StatPositioning,
|
|
110
|
+
StatResult,
|
|
111
|
+
StatStyling,
|
|
112
|
+
SymbolStyle,
|
|
113
|
+
UnitType,
|
|
114
|
+
create_stat_result,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# Theme schema
|
|
118
|
+
from scitex.schema._theme import (
|
|
119
|
+
THEME_VERSION,
|
|
120
|
+
ColorScheme,
|
|
121
|
+
LegendStyle,
|
|
122
|
+
LineDefaults,
|
|
123
|
+
MarkerDefaults,
|
|
124
|
+
PlotTheme,
|
|
125
|
+
)
|
|
126
|
+
from scitex.schema._theme import TraceStyle as ThemeTraceStyle
|
|
127
|
+
from scitex.schema._theme import Typography
|
|
132
128
|
|
|
133
129
|
# Validation (temporarily keep here)
|
|
134
130
|
from scitex.schema._validation import (
|
|
@@ -164,24 +160,24 @@ __all__ = [
|
|
|
164
160
|
"LegendLocation",
|
|
165
161
|
"BboxRatio",
|
|
166
162
|
"BboxPx",
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
163
|
+
"TraceSpec",
|
|
164
|
+
"AxesLimits",
|
|
165
|
+
"AxesLabels",
|
|
166
|
+
"AxesSpecItem",
|
|
167
|
+
"DataSourceSpec",
|
|
168
|
+
"PlotSpec",
|
|
169
|
+
"TraceStyleSpec",
|
|
170
|
+
"ThemeSpec",
|
|
171
|
+
"FontSpec",
|
|
172
|
+
"SizeSpec",
|
|
173
|
+
"LegendSpec",
|
|
174
|
+
"PlotStyle",
|
|
175
|
+
"RenderedArtist",
|
|
176
|
+
"RenderedAxes",
|
|
177
|
+
"HitRegionEntry",
|
|
178
|
+
"SelectableRegion",
|
|
179
|
+
"PlotGeometry",
|
|
180
|
+
"RenderManifest",
|
|
185
181
|
# Encoding
|
|
186
182
|
"ENCODING_VERSION",
|
|
187
183
|
"ChannelBinding",
|
scitex/schema/_canvas.py
CHANGED
|
@@ -327,7 +327,7 @@ class CanvasSpec:
|
|
|
327
327
|
Complete specification for a SciTeX canvas.
|
|
328
328
|
|
|
329
329
|
This is the wire format for canvas.json files.
|
|
330
|
-
The Canvas class in scitex.
|
|
330
|
+
The Canvas class in scitex.canvas provides the OO interface.
|
|
331
331
|
|
|
332
332
|
Examples
|
|
333
333
|
--------
|
scitex/schema/_stats.py
CHANGED
|
@@ -10,7 +10,7 @@ Statistical Result Schema - Central Source of Truth.
|
|
|
10
10
|
This module defines the canonical schema for statistical test results
|
|
11
11
|
that integrates with:
|
|
12
12
|
- scitex.plt (TrackingMixin, metadata embedding)
|
|
13
|
-
- scitex.
|
|
13
|
+
- scitex.canvas (JSON serialization, FigureModel)
|
|
14
14
|
- scitex-cloud GUI (Fabric.js canvas, properties panel, positioning)
|
|
15
15
|
- scitex.bridge (cross-module adapters)
|
|
16
16
|
|
|
@@ -272,7 +272,7 @@ class StatResult:
|
|
|
272
272
|
|
|
273
273
|
This is the central schema for statistical results that integrates with:
|
|
274
274
|
- scitex.plt: Automatic annotation via TrackingMixin
|
|
275
|
-
- scitex.
|
|
275
|
+
- scitex.canvas: JSON serialization for FigureModel
|
|
276
276
|
- scitex-cloud GUI: Fabric.js canvas positioning and properties panel
|
|
277
277
|
- scitex.bridge: Cross-module adapters
|
|
278
278
|
|
scitex/stats/__init__.py
CHANGED
|
@@ -57,21 +57,21 @@ from .auto import (
|
|
|
57
57
|
)
|
|
58
58
|
|
|
59
59
|
# =============================================================================
|
|
60
|
-
# Stats Schema - Use scitex.
|
|
60
|
+
# Stats Schema - Use scitex.io.bundle.Stats as single source of truth
|
|
61
61
|
# =============================================================================
|
|
62
62
|
|
|
63
|
-
#
|
|
63
|
+
# Re-export Stats from bundle module
|
|
64
64
|
try:
|
|
65
|
-
from scitex.
|
|
65
|
+
from scitex.io.bundle import Stats
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
BUNDLE_AVAILABLE = True
|
|
68
68
|
except ImportError:
|
|
69
69
|
Stats = None
|
|
70
|
-
|
|
70
|
+
BUNDLE_AVAILABLE = False
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
def test_result_to_stats(result: dict) -> "Stats":
|
|
74
|
-
"""Convert test result dict to
|
|
74
|
+
"""Convert test result dict to Stats schema.
|
|
75
75
|
|
|
76
76
|
Parameters
|
|
77
77
|
----------
|
|
@@ -92,26 +92,24 @@ def test_result_to_stats(result: dict) -> "Stats":
|
|
|
92
92
|
Returns
|
|
93
93
|
-------
|
|
94
94
|
Stats
|
|
95
|
-
|
|
95
|
+
Stats object suitable for bundle storage
|
|
96
96
|
|
|
97
97
|
Example
|
|
98
98
|
-------
|
|
99
99
|
>>> result = stats.t_test(x, y)
|
|
100
|
-
>>>
|
|
101
|
-
>>> bundle.stats =
|
|
100
|
+
>>> stat_obj = stats.test_result_to_stats(result)
|
|
101
|
+
>>> bundle.stats = stat_obj
|
|
102
102
|
"""
|
|
103
|
-
if not
|
|
104
|
-
raise ImportError("scitex.
|
|
103
|
+
if not BUNDLE_AVAILABLE:
|
|
104
|
+
raise ImportError("scitex.io.bundle is required for Stats conversion")
|
|
105
105
|
|
|
106
106
|
import uuid
|
|
107
107
|
|
|
108
|
-
from scitex.
|
|
108
|
+
from scitex.io.bundle._stats._dataclasses._Stats import (
|
|
109
109
|
Analysis,
|
|
110
110
|
EffectSize,
|
|
111
111
|
StatMethod,
|
|
112
|
-
|
|
113
|
-
from scitex.fts._stats._dataclasses._Stats import (
|
|
114
|
-
StatResult as FTSStatResult,
|
|
112
|
+
StatResult,
|
|
115
113
|
)
|
|
116
114
|
|
|
117
115
|
# Handle legacy flat format vs new nested format
|
|
@@ -134,7 +132,7 @@ def test_result_to_stats(result: dict) -> "Stats":
|
|
|
134
132
|
ci_lower=ci[0] if len(ci) > 0 else None,
|
|
135
133
|
ci_upper=ci[1] if len(ci) > 1 else None,
|
|
136
134
|
)
|
|
137
|
-
stat_result =
|
|
135
|
+
stat_result = StatResult(
|
|
138
136
|
statistic=result.get("statistic", 0.0),
|
|
139
137
|
statistic_name=result.get("statistic_name", ""),
|
|
140
138
|
p_value=result.get("p_value", 1.0),
|
|
@@ -164,7 +162,7 @@ def test_result_to_stats(result: dict) -> "Stats":
|
|
|
164
162
|
ci_upper=es.get("ci_upper"),
|
|
165
163
|
)
|
|
166
164
|
|
|
167
|
-
stat_result =
|
|
165
|
+
stat_result = StatResult(
|
|
168
166
|
statistic=results_data.get("statistic", 0.0),
|
|
169
167
|
statistic_name=results_data.get("statistic_name", ""),
|
|
170
168
|
p_value=results_data.get("p_value", 1.0),
|
|
@@ -189,25 +187,25 @@ def test_result_to_stats(result: dict) -> "Stats":
|
|
|
189
187
|
|
|
190
188
|
|
|
191
189
|
# =============================================================================
|
|
192
|
-
# .
|
|
190
|
+
# .stats Bundle Support
|
|
193
191
|
# =============================================================================
|
|
194
192
|
|
|
195
193
|
|
|
196
|
-
def
|
|
194
|
+
def save_stats(
|
|
197
195
|
comparisons,
|
|
198
196
|
path,
|
|
199
197
|
metadata=None,
|
|
200
198
|
as_zip=False,
|
|
201
199
|
):
|
|
202
200
|
"""
|
|
203
|
-
Save statistical results as
|
|
201
|
+
Save statistical results as a SciTeX bundle.
|
|
204
202
|
|
|
205
203
|
Parameters
|
|
206
204
|
----------
|
|
207
205
|
comparisons : list of dict
|
|
208
206
|
List of comparison results.
|
|
209
207
|
path : str or Path
|
|
210
|
-
Output path (e.g., "results.zip").
|
|
208
|
+
Output path (e.g., "results.stats" or "results.stats.zip").
|
|
211
209
|
metadata : dict, optional
|
|
212
210
|
Additional metadata.
|
|
213
211
|
as_zip : bool, optional
|
|
@@ -220,14 +218,14 @@ def save_statsz(
|
|
|
220
218
|
"""
|
|
221
219
|
from pathlib import Path
|
|
222
220
|
|
|
223
|
-
from scitex.
|
|
221
|
+
from scitex.io.bundle import Bundle
|
|
224
222
|
|
|
225
223
|
p = Path(path)
|
|
226
224
|
if as_zip and not p.suffix == ".zip":
|
|
227
225
|
p = p.with_suffix(".zip")
|
|
228
226
|
|
|
229
|
-
# Create
|
|
230
|
-
bundle =
|
|
227
|
+
# Create bundle
|
|
228
|
+
bundle = Bundle(p, create=True, bundle_type="stats")
|
|
231
229
|
|
|
232
230
|
# Convert comparisons to Stats
|
|
233
231
|
if comparisons:
|
|
@@ -246,14 +244,14 @@ def save_statsz(
|
|
|
246
244
|
return p
|
|
247
245
|
|
|
248
246
|
|
|
249
|
-
def
|
|
247
|
+
def load_stats(path):
|
|
250
248
|
"""
|
|
251
|
-
Load a stats bundle
|
|
249
|
+
Load a stats bundle.
|
|
252
250
|
|
|
253
251
|
Parameters
|
|
254
252
|
----------
|
|
255
253
|
path : str or Path
|
|
256
|
-
Path to bundle.
|
|
254
|
+
Path to bundle (.stats or .stats.zip).
|
|
257
255
|
|
|
258
256
|
Returns
|
|
259
257
|
-------
|
|
@@ -262,9 +260,9 @@ def load_statsz(path):
|
|
|
262
260
|
Each comparison is a flat dict with:
|
|
263
261
|
- name, method, p_value, effect_size, ci95, formatted
|
|
264
262
|
"""
|
|
265
|
-
from scitex.
|
|
263
|
+
from scitex.io.bundle import Bundle
|
|
266
264
|
|
|
267
|
-
bundle =
|
|
265
|
+
bundle = Bundle(path)
|
|
268
266
|
|
|
269
267
|
comparisons = []
|
|
270
268
|
if bundle.stats and bundle.stats.analyses:
|
|
@@ -317,9 +315,8 @@ __all__ = [
|
|
|
317
315
|
"describe",
|
|
318
316
|
# Torch availability flag (for GPU acceleration)
|
|
319
317
|
"TORCH_AVAILABLE",
|
|
320
|
-
# Stats schema
|
|
318
|
+
# Stats schema
|
|
321
319
|
"Stats",
|
|
322
|
-
"FTS_AVAILABLE",
|
|
323
320
|
# Auto module convenience exports
|
|
324
321
|
"StatContext",
|
|
325
322
|
"TestRule",
|
|
@@ -334,8 +331,8 @@ __all__ = [
|
|
|
334
331
|
# Conversion utilities
|
|
335
332
|
"test_result_to_stats",
|
|
336
333
|
# Bundle functions
|
|
337
|
-
"
|
|
338
|
-
"
|
|
334
|
+
"save_stats",
|
|
335
|
+
"load_stats",
|
|
339
336
|
]
|
|
340
337
|
|
|
341
338
|
__version__ = "2.2.0"
|
scitex/stats/_schema.py
CHANGED
|
@@ -7,7 +7,7 @@ Statistical Result Schema - DEPRECATED
|
|
|
7
7
|
This module is deprecated. Import from scitex.schema._stats instead:
|
|
8
8
|
from scitex.schema._stats import Position, StatStyling, StatPositioning, StatResult
|
|
9
9
|
|
|
10
|
-
For the new simplified API, use scitex.
|
|
10
|
+
For the new simplified API, use scitex.io.bundle._stats.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
import warnings
|
scitex/stats/io/__init__.py
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
3
|
# File: /home/ywatanabe/proj/scitex-code/src/scitex/stats/io/__init__.py
|
|
5
4
|
|
|
6
5
|
"""
|
|
7
|
-
I/O operations for scitex.stats - Statistical results bundles (.
|
|
6
|
+
I/O operations for scitex.stats - Statistical results bundles (.stats).
|
|
8
7
|
|
|
9
8
|
This module handles:
|
|
10
|
-
- .
|
|
9
|
+
- .stats bundle load/save operations
|
|
11
10
|
- Statistical comparison metadata
|
|
12
11
|
- P-value and effect size validation
|
|
13
12
|
"""
|
|
14
13
|
|
|
15
14
|
from ._bundle import (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
STATS_SCHEMA_SPEC,
|
|
16
|
+
load_stats_bundle,
|
|
17
|
+
save_stats_bundle,
|
|
18
|
+
validate_stats_spec,
|
|
20
19
|
)
|
|
21
20
|
|
|
22
21
|
__all__ = [
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
22
|
+
"validate_stats_spec",
|
|
23
|
+
"load_stats_bundle",
|
|
24
|
+
"save_stats_bundle",
|
|
25
|
+
"STATS_SCHEMA_SPEC",
|
|
27
26
|
]
|
|
28
27
|
|
|
29
28
|
# EOF
|
scitex/stats/io/_bundle.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
3
|
# File: /home/ywatanabe/proj/scitex-code/src/scitex/stats/io/_bundle.py
|
|
5
4
|
|
|
6
5
|
"""
|
|
7
|
-
SciTeX .
|
|
6
|
+
SciTeX .stats Bundle I/O - Statistics-specific bundle operations.
|
|
8
7
|
|
|
9
8
|
Handles:
|
|
10
9
|
- Statistical results specification validation
|
|
@@ -17,14 +16,14 @@ from pathlib import Path
|
|
|
17
16
|
from typing import Any, Dict, List
|
|
18
17
|
|
|
19
18
|
__all__ = [
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
19
|
+
"validate_stats_spec",
|
|
20
|
+
"load_stats_bundle",
|
|
21
|
+
"save_stats_bundle",
|
|
22
|
+
"STATS_SCHEMA_SPEC",
|
|
24
23
|
]
|
|
25
24
|
|
|
26
|
-
# Schema specification for .
|
|
27
|
-
|
|
25
|
+
# Schema specification for .stats bundles
|
|
26
|
+
STATS_SCHEMA_SPEC = {
|
|
28
27
|
"name": "scitex.stats.stats",
|
|
29
28
|
"version": "1.0.0",
|
|
30
29
|
"required_fields": ["schema"],
|
|
@@ -32,8 +31,8 @@ STATSZ_SCHEMA_SPEC = {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
|
|
35
|
-
def
|
|
36
|
-
"""Validate .
|
|
34
|
+
def validate_stats_spec(spec: Dict[str, Any]) -> List[str]:
|
|
35
|
+
"""Validate .stats-specific fields.
|
|
37
36
|
|
|
38
37
|
Args:
|
|
39
38
|
spec: The specification dictionary to validate.
|
|
@@ -91,8 +90,8 @@ def validate_statsz_spec(spec: Dict[str, Any]) -> List[str]:
|
|
|
91
90
|
return errors
|
|
92
91
|
|
|
93
92
|
|
|
94
|
-
def
|
|
95
|
-
"""Load .
|
|
93
|
+
def load_stats_bundle(bundle_dir: Path) -> Dict[str, Any]:
|
|
94
|
+
"""Load .stats bundle contents from directory.
|
|
96
95
|
|
|
97
96
|
Args:
|
|
98
97
|
bundle_dir: Path to the bundle directory.
|
|
@@ -105,7 +104,7 @@ def load_statsz_bundle(bundle_dir: Path) -> Dict[str, Any]:
|
|
|
105
104
|
# Load specification
|
|
106
105
|
spec_file = bundle_dir / "stats.json"
|
|
107
106
|
if spec_file.exists():
|
|
108
|
-
with open(spec_file
|
|
107
|
+
with open(spec_file) as f:
|
|
109
108
|
result["spec"] = json.load(f)
|
|
110
109
|
else:
|
|
111
110
|
result["spec"] = None
|
|
@@ -115,16 +114,17 @@ def load_statsz_bundle(bundle_dir: Path) -> Dict[str, Any]:
|
|
|
115
114
|
if data_file.exists():
|
|
116
115
|
try:
|
|
117
116
|
import pandas as pd
|
|
117
|
+
|
|
118
118
|
result["data"] = pd.read_csv(data_file)
|
|
119
119
|
except ImportError:
|
|
120
|
-
with open(data_file
|
|
120
|
+
with open(data_file) as f:
|
|
121
121
|
result["data"] = f.read()
|
|
122
122
|
|
|
123
123
|
return result
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
def
|
|
127
|
-
"""Save .
|
|
126
|
+
def save_stats_bundle(data: Dict[str, Any], dir_path: Path) -> None:
|
|
127
|
+
"""Save .stats bundle contents to directory.
|
|
128
128
|
|
|
129
129
|
Args:
|
|
130
130
|
data: Bundle data dictionary.
|