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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Timestamp: 2025-12-08
|
|
4
4
|
# File: ./src/scitex/vis/io/panel.py
|
|
5
5
|
"""
|
|
6
|
-
Panel operations for scitex.
|
|
6
|
+
Panel operations for scitex.canvas.
|
|
7
7
|
|
|
8
8
|
Handles adding, removing, updating, and listing panels within a canvas.
|
|
9
9
|
Panels can be either 'scitex' type (full stx.plt output) or 'image' type (static image).
|
|
@@ -119,7 +119,7 @@ def save_figure_model(
|
|
|
119
119
|
|
|
120
120
|
Examples
|
|
121
121
|
--------
|
|
122
|
-
>>> from scitex.
|
|
122
|
+
>>> from scitex.canvas.model import FigureModel
|
|
123
123
|
>>> fig_model = FigureModel(width_mm=180, height_mm=120)
|
|
124
124
|
>>> save_figure_model(fig_model, "figure.json")
|
|
125
125
|
PosixPath('figure.json')
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/__init__.py
|
|
4
4
|
"""
|
|
5
|
-
JSON models for scitex.
|
|
5
|
+
JSON models for scitex.canvas figure specifications.
|
|
6
6
|
|
|
7
7
|
This module provides dataclass-based models for representing
|
|
8
8
|
publication-quality figures as JSON structures.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/annotations.py
|
|
4
|
-
"""Annotation JSON model for scitex.
|
|
4
|
+
"""Annotation JSON model for scitex.canvas."""
|
|
5
5
|
|
|
6
6
|
from typing import Optional, Dict, Any, Tuple
|
|
7
7
|
from dataclasses import dataclass, field, asdict
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/axes.py
|
|
4
|
-
"""Axes JSON model for scitex.
|
|
4
|
+
"""Axes JSON model for scitex.canvas."""
|
|
5
5
|
|
|
6
6
|
from typing import Optional, List, Dict, Any
|
|
7
7
|
from dataclasses import dataclass, field, asdict
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/figure.py
|
|
4
|
-
"""Figure JSON model for scitex.
|
|
4
|
+
"""Figure JSON model for scitex.canvas."""
|
|
5
5
|
|
|
6
6
|
from typing import Optional, List, Dict, Any
|
|
7
7
|
from dataclasses import dataclass, field, asdict
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/guides.py
|
|
4
|
-
"""Guide elements (lines, spans) JSON model for scitex.
|
|
4
|
+
"""Guide elements (lines, spans) JSON model for scitex.canvas."""
|
|
5
5
|
|
|
6
6
|
from typing import Optional, List, Dict, Any
|
|
7
7
|
from dataclasses import dataclass, field, asdict
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# File: ./src/scitex/vis/model/plot.py
|
|
4
|
-
"""Plot JSON model for scitex.
|
|
4
|
+
"""Plot JSON model for scitex.canvas."""
|
|
5
5
|
|
|
6
6
|
from typing import Optional, List, Dict, Any
|
|
7
7
|
from dataclasses import dataclass, field, asdict
|
scitex/cli/convert.py
CHANGED
|
@@ -227,17 +227,19 @@ def validate_bundles(paths: tuple, verbose: bool):
|
|
|
227
227
|
scitex convert validate output.stx
|
|
228
228
|
scitex convert validate ./figures/*.stx --verbose
|
|
229
229
|
"""
|
|
230
|
-
# Use
|
|
230
|
+
# Use Bundle for validation
|
|
231
231
|
try:
|
|
232
|
-
from scitex.
|
|
232
|
+
from scitex.io.bundle import Bundle as ZipBundle
|
|
233
|
+
|
|
233
234
|
def validate_stx_bundle(path):
|
|
234
235
|
try:
|
|
235
236
|
bundle = ZipBundle(path)
|
|
236
237
|
return bundle.validate(level="strict")
|
|
237
238
|
except Exception as e:
|
|
238
239
|
return {"valid": False, "errors": [str(e)]}
|
|
240
|
+
|
|
239
241
|
except ImportError:
|
|
240
|
-
click.echo("Error: scitex.
|
|
242
|
+
click.echo("Error: scitex.io.bundle not available", err=True)
|
|
241
243
|
return
|
|
242
244
|
|
|
243
245
|
valid = 0
|
|
@@ -303,9 +305,9 @@ def bundle_info(path: str):
|
|
|
303
305
|
scitex convert info figure.stx
|
|
304
306
|
"""
|
|
305
307
|
try:
|
|
306
|
-
from scitex.
|
|
308
|
+
from scitex.io.bundle import Bundle as ZipBundle
|
|
307
309
|
except ImportError:
|
|
308
|
-
click.echo("Error: scitex.
|
|
310
|
+
click.echo("Error: scitex.io.bundle not available", err=True)
|
|
309
311
|
return
|
|
310
312
|
|
|
311
313
|
bundle_path = Path(path)
|
|
@@ -368,12 +370,14 @@ def _convert_bundle(input_path: Path, output_path: Path) -> None:
|
|
|
368
370
|
"""
|
|
369
371
|
import json
|
|
370
372
|
import tempfile
|
|
371
|
-
import zipfile
|
|
372
373
|
|
|
373
374
|
# Generate bundle ID and normalize spec - inline functions since io.bundle is deprecated
|
|
374
375
|
import uuid
|
|
376
|
+
import zipfile
|
|
377
|
+
|
|
375
378
|
def generate_bundle_id():
|
|
376
379
|
return str(uuid.uuid4())[:8]
|
|
380
|
+
|
|
377
381
|
def normalize_spec(spec):
|
|
378
382
|
return spec # FTS handles normalization internally
|
|
379
383
|
|
scitex/diagram/README.md
CHANGED
|
@@ -50,23 +50,23 @@ title: SciTeX Figure Lifecycle
|
|
|
50
50
|
paper:
|
|
51
51
|
column: single
|
|
52
52
|
mode: publication # draft | publication
|
|
53
|
-
emphasize: [
|
|
53
|
+
emphasize: [figure_bundle, editor]
|
|
54
54
|
return_edges: # Hide in publication mode
|
|
55
|
-
- [editor,
|
|
55
|
+
- [editor, figure_bundle]
|
|
56
56
|
|
|
57
57
|
layout:
|
|
58
58
|
layer_gap: tight
|
|
59
59
|
layers: # rank=same constraints
|
|
60
60
|
- [python, savefig]
|
|
61
|
-
- [
|
|
61
|
+
- [figure_bundle]
|
|
62
62
|
- [editor, ai_review]
|
|
63
63
|
|
|
64
64
|
nodes:
|
|
65
65
|
- id: python
|
|
66
66
|
label: Python
|
|
67
67
|
shape: rounded
|
|
68
|
-
- id:
|
|
69
|
-
label: .
|
|
68
|
+
- id: figure_bundle
|
|
69
|
+
label: .figure Bundle
|
|
70
70
|
shape: stadium
|
|
71
71
|
emphasis: primary
|
|
72
72
|
|
|
@@ -74,7 +74,7 @@ edges:
|
|
|
74
74
|
- from: python
|
|
75
75
|
to: savefig
|
|
76
76
|
- from: savefig
|
|
77
|
-
to:
|
|
77
|
+
to: figure_bundle
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
```python
|
|
@@ -98,7 +98,7 @@ d.to_mermaid("workflow.mmd")
|
|
|
98
98
|
paper:
|
|
99
99
|
mode: publication
|
|
100
100
|
return_edges:
|
|
101
|
-
- [editor,
|
|
101
|
+
- [editor, figure_bundle] # Will be invisible
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
## Auto-Split Large Diagrams
|
scitex/io/__init__.py
CHANGED
|
@@ -9,21 +9,19 @@ __DIR__ = os.path.dirname(__FILE__)
|
|
|
9
9
|
# ----------------------------------------
|
|
10
10
|
"""Scitex IO module with lazy imports to avoid circular dependencies.
|
|
11
11
|
|
|
12
|
-
Bundle I/O is handled via scitex.
|
|
13
|
-
from scitex.
|
|
14
|
-
bundle =
|
|
12
|
+
Bundle I/O is handled via scitex.io.bundle:
|
|
13
|
+
from scitex.io.bundle import Bundle
|
|
14
|
+
bundle = Bundle("Figure1.figure")
|
|
15
15
|
bundle.save()
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
# Import commonly used functions directly
|
|
19
|
+
# Bundle I/O - import the bundle submodule
|
|
20
|
+
from . import bundle
|
|
19
21
|
from ._cache import cache
|
|
20
22
|
from ._flush import flush
|
|
21
23
|
from ._glob import glob, parse_glob
|
|
22
24
|
from ._load import load
|
|
23
|
-
|
|
24
|
-
# Bundle I/O - import the bundle submodule
|
|
25
|
-
from . import bundle
|
|
26
|
-
|
|
27
25
|
from ._load_configs import load_configs
|
|
28
26
|
from ._reload import reload
|
|
29
27
|
from ._save import save
|
|
@@ -45,20 +43,10 @@ except ImportError:
|
|
|
45
43
|
has_zarr_key = None
|
|
46
44
|
|
|
47
45
|
# Import load cache control functions
|
|
48
|
-
from ._load_cache import
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
from ._load_cache import (
|
|
52
|
-
configure_cache,
|
|
53
|
-
get_cache_info,
|
|
54
|
-
)
|
|
46
|
+
from ._load_cache import clear_cache as clear_load_cache
|
|
47
|
+
from ._load_cache import configure_cache, get_cache_info
|
|
55
48
|
|
|
56
49
|
# Import load cache control functions
|
|
57
|
-
from ._load_cache import (
|
|
58
|
-
get_cache_info,
|
|
59
|
-
configure_cache,
|
|
60
|
-
clear_cache as clear_load_cache,
|
|
61
|
-
)
|
|
62
50
|
|
|
63
51
|
# Import save module functions
|
|
64
52
|
try:
|
scitex/io/_load.py
CHANGED
|
@@ -16,11 +16,7 @@ from typing import Any, Union
|
|
|
16
16
|
|
|
17
17
|
from scitex.decorators import preserve_doc
|
|
18
18
|
|
|
19
|
-
from ._load_cache import
|
|
20
|
-
cache_data,
|
|
21
|
-
get_cached_data,
|
|
22
|
-
load_npy_cached,
|
|
23
|
-
)
|
|
19
|
+
from ._load_cache import cache_data, get_cached_data, load_npy_cached
|
|
24
20
|
|
|
25
21
|
# Core loaders (no special dependencies)
|
|
26
22
|
from ._load_modules._bibtex import _load_bibtex
|
|
@@ -101,7 +97,7 @@ except ImportError:
|
|
|
101
97
|
|
|
102
98
|
|
|
103
99
|
def _load_bundle(lpath, verbose=False, **kwargs):
|
|
104
|
-
"""Load a .
|
|
100
|
+
"""Load a .plot, .figure, or .stats bundle.
|
|
105
101
|
|
|
106
102
|
Parameters
|
|
107
103
|
----------
|
|
@@ -114,12 +110,12 @@ def _load_bundle(lpath, verbose=False, **kwargs):
|
|
|
114
110
|
|
|
115
111
|
Returns
|
|
116
112
|
-------
|
|
117
|
-
For .
|
|
113
|
+
For .plot bundles:
|
|
118
114
|
tuple: (fig, ax, data) where fig is reconstructed figure,
|
|
119
115
|
ax is the axes, data is DataFrame or None.
|
|
120
|
-
For .
|
|
116
|
+
For .figure bundles:
|
|
121
117
|
dict: Figure data with 'spec' and 'panels'.
|
|
122
|
-
For .
|
|
118
|
+
For .stats bundles:
|
|
123
119
|
dict: Stats data with 'spec' and 'comparisons'.
|
|
124
120
|
"""
|
|
125
121
|
from .bundle import BundleType
|
|
@@ -128,8 +124,8 @@ def _load_bundle(lpath, verbose=False, **kwargs):
|
|
|
128
124
|
bundle = load_bundle(lpath)
|
|
129
125
|
bundle_type = bundle.get("type")
|
|
130
126
|
|
|
131
|
-
if bundle_type == BundleType.
|
|
132
|
-
# Return (fig, ax, data) tuple for .
|
|
127
|
+
if bundle_type == BundleType.PLOT:
|
|
128
|
+
# Return (fig, ax, data) tuple for .plot bundles
|
|
133
129
|
# Note: We return the spec and data, not a reconstructed figure
|
|
134
130
|
# as matplotlib figures cannot be perfectly serialized/deserialized
|
|
135
131
|
from pathlib import Path
|
|
@@ -177,19 +173,19 @@ def _load_bundle(lpath, verbose=False, **kwargs):
|
|
|
177
173
|
if theme:
|
|
178
174
|
fig._scitex_theme = theme.get("mode")
|
|
179
175
|
|
|
180
|
-
# Data from bundle (merged in
|
|
176
|
+
# Data from bundle (merged in load_layered_plot_bundle)
|
|
181
177
|
data = bundle.get("data")
|
|
182
178
|
return fig, ax, data
|
|
183
179
|
else:
|
|
184
180
|
# No PNG, return spec and data
|
|
185
181
|
return bundle.get("spec"), None, bundle.get("data")
|
|
186
182
|
|
|
187
|
-
elif bundle_type == BundleType.
|
|
188
|
-
# Return figure dict for .
|
|
183
|
+
elif bundle_type == BundleType.FIGURE:
|
|
184
|
+
# Return figure dict for .figure bundles
|
|
189
185
|
return bundle
|
|
190
186
|
|
|
191
|
-
elif bundle_type == BundleType.
|
|
192
|
-
# Return stats dict for .
|
|
187
|
+
elif bundle_type == BundleType.STATS:
|
|
188
|
+
# Return stats dict for .stats bundles
|
|
193
189
|
return bundle
|
|
194
190
|
|
|
195
191
|
return bundle
|
|
@@ -300,10 +296,10 @@ def load(
|
|
|
300
296
|
if verbose:
|
|
301
297
|
print(f"[DEBUG] After Path conversion: {lpath}")
|
|
302
298
|
|
|
303
|
-
# Handle bundle formats (.
|
|
304
|
-
bundle_extensions = (".
|
|
299
|
+
# Handle bundle formats (.plot, .figure, .stats and their ZIP variants)
|
|
300
|
+
bundle_extensions = (".figure", ".plot", ".stats")
|
|
305
301
|
for bext in bundle_extensions:
|
|
306
|
-
if lpath.endswith(bext) or lpath.endswith(f"{bext}.
|
|
302
|
+
if lpath.endswith(bext) or lpath.endswith(f"{bext}.zip"):
|
|
307
303
|
return _load_bundle(lpath, verbose=verbose, **kwargs)
|
|
308
304
|
|
|
309
305
|
# Check if it's a glob pattern
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Timestamp: 2025-12-08
|
|
4
4
|
# File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_load_modules/_canvas.py
|
|
5
5
|
"""
|
|
6
|
-
Load canvas directory (.canvas) for scitex.
|
|
6
|
+
Load canvas directory (.canvas) for scitex.canvas.
|
|
7
7
|
|
|
8
8
|
Canvas directories are portable figure bundles containing:
|
|
9
9
|
- canvas.json: Layout, panels, composition settings
|
|
@@ -100,7 +100,7 @@ def _load_canvas(
|
|
|
100
100
|
# Return Canvas object by default
|
|
101
101
|
if not as_dict:
|
|
102
102
|
try:
|
|
103
|
-
from scitex.
|
|
103
|
+
from scitex.canvas.canvas import Canvas
|
|
104
104
|
|
|
105
105
|
canvas_obj = Canvas.from_dict(canvas_dict)
|
|
106
106
|
# Store reference to original directory for copying
|
scitex/io/_load_modules/_con.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Time-stamp: "2024-11-14 07:51:45 (ywatanabe)"
|
|
4
3
|
# File: ./scitex_repo/src/scitex/io/_load_modules/_con.py
|
|
5
4
|
|
|
@@ -11,10 +10,11 @@ import mne
|
|
|
11
10
|
def _load_con(lpath: str, **kwargs) -> Any:
|
|
12
11
|
if not lpath.endswith(".con"):
|
|
13
12
|
raise ValueError("File must have .con extension")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
raw = mne.io.read_raw_fif(lpath, preload=True, **kwargs)
|
|
14
|
+
sfreq = raw.info["sfreq"]
|
|
15
|
+
df = raw.to_data_frame()
|
|
16
|
+
df["samp_rate"] = sfreq
|
|
17
|
+
return df
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
# EOF
|
scitex/io/_load_modules/_eeg.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Time-stamp: "2024-11-14 07:56:27 (ywatanabe)"
|
|
4
3
|
# File: ./scitex_repo/src/scitex/io/_load_modules/_eeg.py
|
|
5
4
|
|
|
@@ -10,7 +9,7 @@ from typing import Any
|
|
|
10
9
|
import mne
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
def _load_eeg_data(
|
|
12
|
+
def _load_eeg_data(lpath: str, **kwargs) -> Any:
|
|
14
13
|
"""
|
|
15
14
|
Load EEG data based on file extension and associated files using MNE-Python.
|
|
16
15
|
|
|
@@ -43,15 +42,15 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
|
|
|
43
42
|
extension = lpath.split(".")[-1]
|
|
44
43
|
|
|
45
44
|
allowed_extensions = [
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
45
|
+
"vhdr",
|
|
46
|
+
"vmrk",
|
|
47
|
+
"edf",
|
|
48
|
+
"bdf",
|
|
49
|
+
"gdf",
|
|
50
|
+
"cnt",
|
|
51
|
+
"egi",
|
|
52
|
+
"eeg",
|
|
53
|
+
"set",
|
|
55
54
|
]
|
|
56
55
|
|
|
57
56
|
if extension not in allowed_extensions:
|
|
@@ -59,6 +58,9 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
|
|
|
59
58
|
f"File must have one of these extensions: {', '.join(allowed_extensions)}"
|
|
60
59
|
)
|
|
61
60
|
|
|
61
|
+
# Remove preload from kwargs if present - we always use preload=True
|
|
62
|
+
kwargs.pop("preload", None)
|
|
63
|
+
|
|
62
64
|
with warnings.catch_warnings():
|
|
63
65
|
warnings.simplefilter("ignore", RuntimeWarning)
|
|
64
66
|
|
|
@@ -98,9 +100,11 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
|
|
|
98
100
|
lpath_v = lpath.replace(".eeg", ".vhdr")
|
|
99
101
|
raw = mne.io.read_raw_brainvision(lpath_v, preload=True, **kwargs)
|
|
100
102
|
# Nihon Koden
|
|
101
|
-
|
|
103
|
+
elif is_NihonKoden:
|
|
102
104
|
# raw = mne.io.read_raw_nihon(lpath, preload=True, **kwargs)
|
|
103
105
|
raw = mne.io.read_raw(lpath, preload=True, **kwargs)
|
|
106
|
+
else:
|
|
107
|
+
raise ValueError("No associated files found for .eeg file")
|
|
104
108
|
else:
|
|
105
109
|
raise ValueError(f"Unsupported file extension: {extension}")
|
|
106
110
|
|
scitex/io/_save.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Save utilities for various data types to different file formats.
|
|
7
7
|
|
|
8
8
|
Supported formats include CSV, NPY, PKL, JOBLIB, PNG, HTML, TIFF, MP4, YAML,
|
|
9
|
-
JSON, HDF5, PTH, MAT, CBM, and
|
|
9
|
+
JSON, HDF5, PTH, MAT, CBM, and SciTeX bundles (.zip or directory).
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
import inspect
|
|
@@ -40,8 +40,6 @@ from ._save_modules import (
|
|
|
40
40
|
save_npz,
|
|
41
41
|
save_pickle,
|
|
42
42
|
save_pickle_compressed,
|
|
43
|
-
save_pltz_bundle,
|
|
44
|
-
save_stx_bundle,
|
|
45
43
|
save_tex,
|
|
46
44
|
save_text,
|
|
47
45
|
save_torch,
|
|
@@ -53,12 +51,9 @@ from ._save_modules import (
|
|
|
53
51
|
|
|
54
52
|
logger = logging.getLogger()
|
|
55
53
|
|
|
56
|
-
# Re-export for backward compatibility
|
|
57
54
|
_get_figure_with_data = get_figure_with_data
|
|
58
55
|
_symlink = symlink
|
|
59
56
|
_symlink_to = symlink_to
|
|
60
|
-
_save_stx_bundle = save_stx_bundle
|
|
61
|
-
_save_pltz_bundle = save_pltz_bundle
|
|
62
57
|
_handle_image_with_csv = handle_image_with_csv
|
|
63
58
|
|
|
64
59
|
|
|
@@ -278,17 +273,17 @@ def _save(
|
|
|
278
273
|
"""Core dispatcher for saving objects to various formats."""
|
|
279
274
|
ext = _os.path.splitext(spath)[1].lower()
|
|
280
275
|
|
|
281
|
-
# Check if this is a matplotlib figure being saved to
|
|
282
|
-
#
|
|
276
|
+
# Check if this is a matplotlib figure being saved to SciTeX bundle format
|
|
277
|
+
# SciTeX bundles use .zip (archive) or no extension (directory)
|
|
283
278
|
if _is_matplotlib_figure(obj):
|
|
284
|
-
# Save as
|
|
279
|
+
# Save as SciTeX bundle if:
|
|
285
280
|
# 1. Path ends with .zip (create ZIP bundle)
|
|
286
281
|
# 2. Path has no extension and doesn't match other formats (create directory bundle)
|
|
287
282
|
if ext == ".zip" or (ext == "" and not spath.endswith("/")):
|
|
288
|
-
# Check if explicitly requesting
|
|
283
|
+
# Check if explicitly requesting SciTeX bundle or just .zip
|
|
289
284
|
# Pop as_zip from kwargs to avoid duplicate parameter error
|
|
290
285
|
as_zip = kwargs.pop("as_zip", ext == ".zip")
|
|
291
|
-
|
|
286
|
+
_save_scitex_bundle(
|
|
292
287
|
obj, spath, as_zip, verbose, symlink_from_cwd, symlink_to, **kwargs
|
|
293
288
|
)
|
|
294
289
|
return
|
|
@@ -348,12 +343,12 @@ def _is_matplotlib_figure(obj):
|
|
|
348
343
|
return False
|
|
349
344
|
|
|
350
345
|
|
|
351
|
-
def
|
|
346
|
+
def _save_scitex_bundle(
|
|
352
347
|
obj, spath, as_zip, verbose, symlink_from_cwd, symlink_to_path, **kwargs
|
|
353
348
|
):
|
|
354
|
-
"""Save matplotlib figure as
|
|
349
|
+
"""Save matplotlib figure as SciTeX bundle (.zip or directory).
|
|
355
350
|
|
|
356
|
-
Delegates to scitex.
|
|
351
|
+
Delegates to scitex.io.bundle.from_matplotlib as the single source of truth
|
|
357
352
|
for bundle structure (canonical/artifacts/payload/children).
|
|
358
353
|
|
|
359
354
|
When figrecipe is available and enabled on the figure, also saves
|
|
@@ -362,7 +357,7 @@ def _save_fts_bundle(
|
|
|
362
357
|
# Get the actual matplotlib figure
|
|
363
358
|
import matplotlib.figure
|
|
364
359
|
|
|
365
|
-
from scitex.
|
|
360
|
+
from scitex.io.bundle import from_matplotlib
|
|
366
361
|
|
|
367
362
|
from ._save_modules._figure_utils import get_figure_with_data
|
|
368
363
|
|
|
@@ -390,7 +385,7 @@ def _save_fts_bundle(
|
|
|
390
385
|
except Exception:
|
|
391
386
|
pass
|
|
392
387
|
|
|
393
|
-
# Delegate to
|
|
388
|
+
# Delegate to Bundle (single source of truth)
|
|
394
389
|
# Encoding is built from CSV columns directly for consistency
|
|
395
390
|
from_matplotlib(fig, spath, name=name, csv_df=csv_df, dpi=dpi)
|
|
396
391
|
|
|
@@ -55,14 +55,10 @@ from ._mp4 import _mk_mp4 as save_mp4
|
|
|
55
55
|
from ._numpy import _save_npy as save_npy
|
|
56
56
|
from ._numpy import _save_npz as save_npz
|
|
57
57
|
from ._optuna_study_as_csv_and_pngs import save_optuna_study_as_csv_and_pngs
|
|
58
|
-
from ._pickle import
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
from .
|
|
62
|
-
_save_pickle_gz as save_pickle_compressed,
|
|
63
|
-
)
|
|
64
|
-
from ._pltz_bundle import save_pltz_bundle
|
|
65
|
-
from ._pltz_stx import save_pltz_as_stx
|
|
58
|
+
from ._pickle import _save_pickle as save_pickle
|
|
59
|
+
from ._pickle import _save_pickle_gz as save_pickle_compressed
|
|
60
|
+
from ._plot_bundle import save_plot_bundle
|
|
61
|
+
from ._plot_scitex import save_plot_as_scitex
|
|
66
62
|
from ._stx_bundle import save_stx_bundle
|
|
67
63
|
from ._symlink import symlink, symlink_to
|
|
68
64
|
from ._tex import _save_tex as save_tex
|
|
@@ -121,8 +117,8 @@ __all__ = [
|
|
|
121
117
|
"save_optuna_study_as_csv_and_pngs",
|
|
122
118
|
# Bundle save functions
|
|
123
119
|
"save_stx_bundle",
|
|
124
|
-
"
|
|
125
|
-
"
|
|
120
|
+
"save_plot_bundle",
|
|
121
|
+
"save_plot_as_scitex",
|
|
126
122
|
"save_separate_legends",
|
|
127
123
|
"handle_image_with_csv",
|
|
128
124
|
# Utilities
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Timestamp: 2025-12-08
|
|
4
4
|
# File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_save_modules/_canvas.py
|
|
5
5
|
"""
|
|
6
|
-
Save canvas directory (.canvas) for scitex.
|
|
6
|
+
Save canvas directory (.canvas) for scitex.canvas.
|
|
7
7
|
|
|
8
8
|
Canvas directories are portable figure bundles containing:
|
|
9
9
|
- canvas.json: Layout, panels, composition settings
|
|
@@ -113,7 +113,7 @@ def _export_canvas_figures(
|
|
|
113
113
|
formats = ["png", "pdf", "svg"]
|
|
114
114
|
|
|
115
115
|
try:
|
|
116
|
-
from scitex.
|
|
116
|
+
from scitex.canvas.io.export import _compose_and_export
|
|
117
117
|
import json
|
|
118
118
|
|
|
119
119
|
# Load canvas.json
|
|
@@ -136,7 +136,7 @@ def _export_canvas_figures(
|
|
|
136
136
|
transparent=False,
|
|
137
137
|
)
|
|
138
138
|
except ImportError:
|
|
139
|
-
# scitex.
|
|
139
|
+
# scitex.canvas not available
|
|
140
140
|
pass
|
|
141
141
|
except Exception as e:
|
|
142
142
|
# Log but don't fail save if export fails
|