scitex 2.7.3__py3-none-any.whl → 2.10.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 +15 -7
- scitex/__version__.py +1 -2
- scitex/_install_guide.py +250 -0
- scitex/_optional_deps.py +206 -39
- scitex/ai/_gen_ai/_Groq.py +2 -4
- scitex/ai/_gen_ai/_OpenAI.py +5 -2
- scitex/ai/_gen_ai/_Perplexity.py +20 -6
- scitex/audio/__init__.py +24 -15
- scitex/audio/_cross_process_lock.py +139 -0
- scitex/audio/_mcp_handlers.py +256 -0
- scitex/audio/_mcp_tool_schemas.py +203 -0
- scitex/audio/engines/elevenlabs_engine.py +5 -2
- scitex/audio/mcp_server.py +98 -457
- scitex/bridge/__init__.py +30 -19
- scitex/bridge/_figrecipe.py +245 -0
- scitex/bridge/_helpers.py +2 -1
- scitex/bridge/_plt_vis.py +23 -10
- scitex/bridge/_stats_plt.py +18 -5
- scitex/bridge/_stats_vis.py +16 -2
- scitex/browser/__init__.py +84 -44
- scitex/browser/automation/__init__.py +5 -1
- scitex/browser/core/BrowserMixin.py +17 -4
- scitex/browser/core/__init__.py +11 -2
- scitex/browser/remote/CaptchaHandler.py +1 -1
- scitex/browser/remote/ZenRowsAPIClient.py +1 -1
- scitex/capture/grid.py +487 -0
- scitex/capture/mcp_handlers.py +401 -0
- scitex/capture/mcp_tool_defs.py +192 -0
- scitex/capture/mcp_tools.py +241 -0
- scitex/capture/mcp_utils.py +30 -0
- scitex/cli/convert.py +421 -0
- scitex/cli/main.py +6 -4
- scitex/datetime/__init__.py +46 -0
- scitex/datetime/_linspace.py +100 -0
- scitex/datetime/_normalize_timestamp.py +306 -0
- scitex/db/_delete_duplicates.py +4 -4
- scitex/db/_sqlite3/_delete_duplicates.py +11 -2
- scitex/dev/plt/__init__.py +61 -62
- scitex/dev/plt/demo_plotters/__init__.py +0 -0
- scitex/dev/plt/demo_plotters/plot_mpl_axhline.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_axhspan.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_axvline.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_axvspan.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_bar.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_barh.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_boxplot.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_contour.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_contourf.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_errorbar.py +30 -0
- scitex/dev/plt/demo_plotters/plot_mpl_eventplot.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_fill.py +30 -0
- scitex/dev/plt/demo_plotters/plot_mpl_fill_between.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_hexbin.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_hist.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_hist2d.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_imshow.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_pcolormesh.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_pie.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_plot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_quiver.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_scatter.py +28 -0
- scitex/dev/plt/demo_plotters/plot_mpl_stackplot.py +31 -0
- scitex/dev/plt/demo_plotters/plot_mpl_stem.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_step.py +29 -0
- scitex/dev/plt/demo_plotters/plot_mpl_violinplot.py +28 -0
- scitex/dev/plt/demo_plotters/plot_sns_barplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_boxplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_heatmap.py +28 -0
- scitex/dev/plt/demo_plotters/plot_sns_histplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_kdeplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_lineplot.py +31 -0
- scitex/dev/plt/demo_plotters/plot_sns_scatterplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_stripplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_swarmplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_sns_violinplot.py +29 -0
- scitex/dev/plt/demo_plotters/plot_stx_bar.py +29 -0
- scitex/dev/plt/demo_plotters/plot_stx_barh.py +29 -0
- scitex/dev/plt/demo_plotters/plot_stx_box.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_boxplot.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_conf_mat.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_contour.py +31 -0
- scitex/dev/plt/demo_plotters/plot_stx_ecdf.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_errorbar.py +30 -0
- scitex/dev/plt/demo_plotters/plot_stx_fill_between.py +31 -0
- scitex/dev/plt/demo_plotters/plot_stx_fillv.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_heatmap.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_image.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_imshow.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_joyplot.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_kde.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_line.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_mean_ci.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_mean_std.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_median_iqr.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_raster.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_rectangle.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_scatter.py +29 -0
- scitex/dev/plt/demo_plotters/plot_stx_shaded_line.py +29 -0
- scitex/dev/plt/demo_plotters/plot_stx_violin.py +28 -0
- scitex/dev/plt/demo_plotters/plot_stx_violinplot.py +28 -0
- scitex/dev/plt/mpl/get_dir_ax.py +46 -0
- scitex/dev/plt/mpl/get_signatures.py +176 -0
- scitex/dev/plt/mpl/get_signatures_details.py +522 -0
- scitex/dev/plt/plot_mpl_axhline.py +0 -0
- scitex/dev/plt/plot_mpl_axhspan.py +0 -0
- scitex/dev/plt/plot_mpl_axvline.py +0 -0
- scitex/dev/plt/plot_mpl_axvspan.py +0 -0
- scitex/dev/plt/plot_mpl_bar.py +0 -0
- scitex/dev/plt/plot_mpl_barh.py +0 -0
- scitex/dev/plt/plot_mpl_boxplot.py +0 -0
- scitex/dev/plt/plot_mpl_contour.py +0 -0
- scitex/dev/plt/plot_mpl_contourf.py +0 -0
- scitex/dev/plt/plot_mpl_errorbar.py +0 -0
- scitex/dev/plt/plot_mpl_eventplot.py +0 -0
- scitex/dev/plt/plot_mpl_fill.py +0 -0
- scitex/dev/plt/plot_mpl_fill_between.py +0 -0
- scitex/dev/plt/plot_mpl_hexbin.py +0 -0
- scitex/dev/plt/plot_mpl_hist.py +0 -0
- scitex/dev/plt/plot_mpl_hist2d.py +0 -0
- scitex/dev/plt/plot_mpl_imshow.py +0 -0
- scitex/dev/plt/plot_mpl_pcolormesh.py +0 -0
- scitex/dev/plt/plot_mpl_pie.py +0 -0
- scitex/dev/plt/plot_mpl_plot.py +0 -0
- scitex/dev/plt/plot_mpl_quiver.py +0 -0
- scitex/dev/plt/plot_mpl_scatter.py +0 -0
- scitex/dev/plt/plot_mpl_stackplot.py +0 -0
- scitex/dev/plt/plot_mpl_stem.py +0 -0
- scitex/dev/plt/plot_mpl_step.py +0 -0
- scitex/dev/plt/plot_mpl_violinplot.py +0 -0
- scitex/dev/plt/plot_sns_barplot.py +0 -0
- scitex/dev/plt/plot_sns_boxplot.py +0 -0
- scitex/dev/plt/plot_sns_heatmap.py +0 -0
- scitex/dev/plt/plot_sns_histplot.py +0 -0
- scitex/dev/plt/plot_sns_kdeplot.py +0 -0
- scitex/dev/plt/plot_sns_lineplot.py +0 -0
- scitex/dev/plt/plot_sns_scatterplot.py +0 -0
- scitex/dev/plt/plot_sns_stripplot.py +0 -0
- scitex/dev/plt/plot_sns_swarmplot.py +0 -0
- scitex/dev/plt/plot_sns_violinplot.py +0 -0
- scitex/dev/plt/plot_stx_bar.py +0 -0
- scitex/dev/plt/plot_stx_barh.py +0 -0
- scitex/dev/plt/plot_stx_box.py +0 -0
- scitex/dev/plt/plot_stx_boxplot.py +0 -0
- scitex/dev/plt/plot_stx_conf_mat.py +0 -0
- scitex/dev/plt/plot_stx_contour.py +0 -0
- scitex/dev/plt/plot_stx_ecdf.py +0 -0
- scitex/dev/plt/plot_stx_errorbar.py +0 -0
- scitex/dev/plt/plot_stx_fill_between.py +0 -0
- scitex/dev/plt/plot_stx_fillv.py +0 -0
- scitex/dev/plt/plot_stx_heatmap.py +0 -0
- scitex/dev/plt/plot_stx_image.py +0 -0
- scitex/dev/plt/plot_stx_imshow.py +0 -0
- scitex/dev/plt/plot_stx_joyplot.py +0 -0
- scitex/dev/plt/plot_stx_kde.py +0 -0
- scitex/dev/plt/plot_stx_line.py +0 -0
- scitex/dev/plt/plot_stx_mean_ci.py +0 -0
- scitex/dev/plt/plot_stx_mean_std.py +0 -0
- scitex/dev/plt/plot_stx_median_iqr.py +0 -0
- scitex/dev/plt/plot_stx_raster.py +0 -0
- scitex/dev/plt/plot_stx_rectangle.py +0 -0
- scitex/dev/plt/plot_stx_scatter.py +0 -0
- scitex/dev/plt/plot_stx_shaded_line.py +0 -0
- scitex/dev/plt/plot_stx_violin.py +0 -0
- scitex/dev/plt/plot_stx_violinplot.py +0 -0
- scitex/diagram/README.md +197 -0
- scitex/diagram/__init__.py +48 -0
- scitex/diagram/_compile.py +312 -0
- scitex/diagram/_diagram.py +355 -0
- scitex/diagram/_presets.py +173 -0
- scitex/diagram/_schema.py +182 -0
- scitex/diagram/_split.py +278 -0
- scitex/dict/_pop_keys.py +1 -7
- scitex/dsp/__init__.py +15 -10
- scitex/dsp/add_noise.py +5 -2
- scitex/dsp/example.py +35 -22
- scitex/dsp/filt.py +8 -3
- scitex/dsp/reference.py +3 -2
- scitex/dsp/utils/__init__.py +2 -1
- scitex/dsp/utils/_differential_bandpass_filters.py +14 -4
- scitex/dt/__init__.py +39 -2
- scitex/errors.py +82 -521
- scitex/fig/__init__.py +4 -4
- scitex/fig/editor/__init__.py +5 -2
- scitex/fig/editor/_dearpygui_editor.py +1 -1
- scitex/fig/editor/_mpl_editor.py +1 -1
- scitex/fig/editor/_qt_editor.py +1 -1
- scitex/fig/editor/_tkinter_editor.py +1 -1
- scitex/fig/editor/edit/__init__.py +50 -0
- scitex/fig/editor/edit/backend_detector.py +109 -0
- scitex/fig/editor/edit/bundle_resolver.py +240 -0
- scitex/fig/editor/edit/editor_launcher.py +239 -0
- scitex/fig/editor/edit/manual_handler.py +53 -0
- scitex/fig/editor/edit/panel_loader.py +232 -0
- scitex/fig/editor/edit/path_resolver.py +67 -0
- scitex/fig/editor/flask_editor/_bbox.py +23 -0
- scitex/fig/editor/flask_editor/_core.py +908 -103
- scitex/fig/editor/flask_editor/_renderer.py +74 -0
- scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
- scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
- scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
- scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
- scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
- scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
- scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
- scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
- scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
- scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
- scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
- scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
- scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
- scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
- scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
- scitex/fig/editor/flask_editor/static/css/index.css +31 -0
- scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
- scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
- scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
- scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
- scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
- scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
- scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
- scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
- scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
- scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
- scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
- scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
- scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
- scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
- scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
- scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
- scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
- scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
- scitex/fig/editor/flask_editor/static/js/main.js +426 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
- scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
- scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
- scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
- scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
- scitex/fig/editor/flask_editor/templates/__init__.py +95 -5
- scitex/fig/editor/flask_editor/templates/_html.py +27 -9
- scitex/fig/editor/flask_editor/templates/_scripts.py +1928 -131
- scitex/fig/editor/flask_editor/templates/_styles.py +363 -51
- scitex/fig/io/_bundle.py +104 -19
- scitex/fts/README.md +262 -0
- scitex/fts/TODO.md +66 -0
- scitex/fts/__init__.py +90 -0
- scitex/fts/_bundle/README_IN_BUNDLE.md +102 -0
- scitex/fts/_bundle/_FTS.py +657 -0
- scitex/fts/_bundle/__init__.py +38 -0
- scitex/fts/_bundle/_children.py +216 -0
- scitex/fts/_bundle/_conversion/__init__.py +15 -0
- scitex/fts/_bundle/_conversion/_bundle2dict.py +44 -0
- scitex/fts/_bundle/_conversion/_dict2bundle.py +50 -0
- scitex/fts/_bundle/_dataclasses/_Axes.py +57 -0
- scitex/fts/_bundle/_dataclasses/_BBox.py +54 -0
- scitex/fts/_bundle/_dataclasses/_ColumnDef.py +72 -0
- scitex/fts/_bundle/_dataclasses/_DataFormat.py +40 -0
- scitex/fts/_bundle/_dataclasses/_DataInfo.py +135 -0
- scitex/fts/_bundle/_dataclasses/_DataSource.py +44 -0
- scitex/fts/_bundle/_dataclasses/_Node.py +319 -0
- scitex/fts/_bundle/_dataclasses/_NodeRefs.py +45 -0
- scitex/fts/_bundle/_dataclasses/_SizeMM.py +38 -0
- scitex/fts/_bundle/_dataclasses/__init__.py +35 -0
- scitex/fts/_bundle/_extractors/__init__.py +32 -0
- scitex/fts/_bundle/_extractors/_extract_bar.py +131 -0
- scitex/fts/_bundle/_extractors/_extract_line.py +71 -0
- scitex/fts/_bundle/_extractors/_extract_scatter.py +79 -0
- scitex/fts/_bundle/_loader.py +134 -0
- scitex/fts/_bundle/_mpl_helpers.py +389 -0
- scitex/fts/_bundle/_saver.py +269 -0
- scitex/fts/_bundle/_storage.py +200 -0
- scitex/fts/_bundle/_utils/__init__.py +55 -0
- scitex/fts/_bundle/_utils/_const.py +26 -0
- scitex/fts/_bundle/_utils/_errors.py +73 -0
- scitex/fts/_bundle/_utils/_generate.py +21 -0
- scitex/fts/_bundle/_utils/_types.py +76 -0
- scitex/fts/_bundle/_validation.py +434 -0
- scitex/fts/_bundle/_zipbundle.py +165 -0
- scitex/fts/_fig/__init__.py +22 -0
- scitex/fts/_fig/_backend/__init__.py +53 -0
- scitex/fts/_fig/_backend/_export.py +165 -0
- scitex/fts/_fig/_backend/_parser.py +188 -0
- scitex/fts/_fig/_backend/_render.py +538 -0
- scitex/fts/_fig/_composite.py +345 -0
- scitex/fts/_fig/_dataclasses/_ChannelEncoding.py +46 -0
- scitex/fts/_fig/_dataclasses/_Encoding.py +82 -0
- scitex/fts/_fig/_dataclasses/_Theme.py +441 -0
- scitex/fts/_fig/_dataclasses/_TraceEncoding.py +52 -0
- scitex/fts/_fig/_dataclasses/__init__.py +47 -0
- scitex/fts/_fig/_editor/__init__.py +14 -0
- scitex/fts/_fig/_editor/_cui/__init__.py +33 -0
- scitex/fts/_fig/_editor/_cui/_backend_detector.py +39 -0
- scitex/fts/_fig/_editor/_cui/_bundle_resolver.py +366 -0
- scitex/fts/_fig/_editor/_cui/_editor_launcher.py +175 -0
- scitex/fts/_fig/_editor/_cui/_manual_handler.py +52 -0
- scitex/fts/_fig/_editor/_cui/_panel_loader.py +246 -0
- scitex/fts/_fig/_editor/_cui/_path_resolver.py +66 -0
- scitex/fts/_fig/_editor/_defaults.py +300 -0
- scitex/fts/_fig/_editor/_gui/__init__.py +11 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/__init__.py +20 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/_bbox.py +1339 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/_core.py +1688 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/_plotter.py +664 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/_renderer.py +853 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/_utils.py +79 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/reset.css +41 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/typography.css +16 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/variables.css +85 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/buttons.css +217 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/context-menu.css +93 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/dropdown.css +57 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/forms.css +112 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/modal.css +59 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/sections.css +212 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/canvas.css +176 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/element-inspector.css +190 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/loading.css +59 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/overlay.css +45 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/panel-grid.css +95 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/selection.css +101 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/statistics.css +138 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/index.css +31 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/container.css +7 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/controls.css +56 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/preview.css +78 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/axis.js +314 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/basic.js +107 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/distribute.js +54 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/canvas.js +172 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/dragging.js +258 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/resize.js +48 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/selection.js +71 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/api.js +288 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/state.js +143 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/utils.js +245 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/dev/element-inspector.js +992 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/bbox.js +339 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/element-drag.js +286 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/overlay.js +371 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/preview.js +293 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/main.js +426 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/context-menu.js +152 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/keyboard.js +265 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/controls.js +184 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/download.js +57 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/help.js +100 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/theme.js +34 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/__init__.py +124 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_html.py +851 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_scripts.py +4932 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_styles.py +1657 -0
- scitex/fts/_fig/_editor/_gui/_flask_editor.py +36 -0
- scitex/fts/_fig/_models/_Annotations.py +115 -0
- scitex/fts/_fig/_models/_Axes.py +152 -0
- scitex/fts/_fig/_models/_Figure.py +138 -0
- scitex/fts/_fig/_models/_Guides.py +104 -0
- scitex/fts/_fig/_models/_Plot.py +123 -0
- scitex/fts/_fig/_models/_Styles.py +245 -0
- scitex/fts/_fig/_models/__init__.py +80 -0
- scitex/fts/_fig/_models/_plot_types/__init__.py +156 -0
- scitex/fts/_fig/_models/_plot_types/_bar.py +43 -0
- scitex/fts/_fig/_models/_plot_types/_box.py +38 -0
- scitex/fts/_fig/_models/_plot_types/_distribution.py +36 -0
- scitex/fts/_fig/_models/_plot_types/_errorbar.py +60 -0
- scitex/fts/_fig/_models/_plot_types/_histogram.py +30 -0
- scitex/fts/_fig/_models/_plot_types/_image.py +61 -0
- scitex/fts/_fig/_models/_plot_types/_line.py +57 -0
- scitex/fts/_fig/_models/_plot_types/_scatter.py +30 -0
- scitex/fts/_fig/_models/_plot_types/_seaborn.py +121 -0
- scitex/fts/_fig/_models/_plot_types/_violin.py +36 -0
- scitex/fts/_fig/_utils/__init__.py +129 -0
- scitex/fts/_fig/_utils/_auto_layout.py +127 -0
- scitex/fts/_fig/_utils/_calc_bounds.py +111 -0
- scitex/fts/_fig/_utils/_const_sizes.py +48 -0
- scitex/fts/_fig/_utils/_convert_coords.py +77 -0
- scitex/fts/_fig/_utils/_get_template.py +178 -0
- scitex/fts/_fig/_utils/_normalize.py +73 -0
- scitex/fts/_fig/_utils/_plot_layout.py +397 -0
- scitex/fts/_fig/_utils/_validate.py +197 -0
- scitex/fts/_kinds/__init__.py +45 -0
- scitex/fts/_kinds/_figure/__init__.py +19 -0
- scitex/fts/_kinds/_figure/_composite.py +345 -0
- scitex/fts/_kinds/_plot/__init__.py +25 -0
- scitex/fts/_kinds/_plot/_backend/__init__.py +53 -0
- scitex/fts/_kinds/_plot/_backend/_export.py +165 -0
- scitex/fts/_kinds/_plot/_backend/_parser.py +188 -0
- scitex/fts/_kinds/_plot/_backend/_render.py +538 -0
- scitex/fts/_kinds/_plot/_dataclasses/_ChannelEncoding.py +46 -0
- scitex/fts/_kinds/_plot/_dataclasses/_Encoding.py +82 -0
- scitex/fts/_kinds/_plot/_dataclasses/_Theme.py +441 -0
- scitex/fts/_kinds/_plot/_dataclasses/_TraceEncoding.py +52 -0
- scitex/fts/_kinds/_plot/_dataclasses/__init__.py +47 -0
- scitex/fts/_kinds/_plot/_models/_Annotations.py +115 -0
- scitex/fts/_kinds/_plot/_models/_Axes.py +152 -0
- scitex/fts/_kinds/_plot/_models/_Figure.py +138 -0
- scitex/fts/_kinds/_plot/_models/_Guides.py +104 -0
- scitex/fts/_kinds/_plot/_models/_Plot.py +123 -0
- scitex/fts/_kinds/_plot/_models/_Styles.py +245 -0
- scitex/fts/_kinds/_plot/_models/__init__.py +80 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/__init__.py +156 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_bar.py +43 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_box.py +38 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_distribution.py +36 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_errorbar.py +60 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_histogram.py +30 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_image.py +61 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_line.py +57 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_scatter.py +30 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_seaborn.py +121 -0
- scitex/fts/_kinds/_plot/_models/_plot_types/_violin.py +36 -0
- scitex/fts/_kinds/_plot/_utils/__init__.py +129 -0
- scitex/fts/_kinds/_plot/_utils/_auto_layout.py +127 -0
- scitex/fts/_kinds/_plot/_utils/_calc_bounds.py +111 -0
- scitex/fts/_kinds/_plot/_utils/_const_sizes.py +48 -0
- scitex/fts/_kinds/_plot/_utils/_convert_coords.py +77 -0
- scitex/fts/_kinds/_plot/_utils/_get_template.py +178 -0
- scitex/fts/_kinds/_plot/_utils/_normalize.py +73 -0
- scitex/fts/_kinds/_plot/_utils/_plot_layout.py +397 -0
- scitex/fts/_kinds/_plot/_utils/_validate.py +197 -0
- scitex/fts/_kinds/_shape/__init__.py +141 -0
- scitex/fts/_kinds/_stats/__init__.py +56 -0
- scitex/fts/_kinds/_stats/_dataclasses/_Stats.py +423 -0
- scitex/fts/_kinds/_stats/_dataclasses/__init__.py +48 -0
- scitex/fts/_kinds/_table/__init__.py +72 -0
- scitex/fts/_kinds/_table/_latex/__init__.py +93 -0
- scitex/fts/_kinds/_table/_latex/_editor/__init__.py +11 -0
- scitex/fts/_kinds/_table/_latex/_editor/_app.py +725 -0
- scitex/fts/_kinds/_table/_latex/_export.py +279 -0
- scitex/fts/_kinds/_table/_latex/_figure_exporter.py +153 -0
- scitex/fts/_kinds/_table/_latex/_stats_formatter.py +274 -0
- scitex/fts/_kinds/_table/_latex/_table_exporter.py +362 -0
- scitex/fts/_kinds/_table/_latex/_utils.py +369 -0
- scitex/fts/_kinds/_table/_latex/_validator.py +445 -0
- scitex/fts/_kinds/_text/__init__.py +77 -0
- scitex/fts/_schemas/data_info.schema.json +75 -0
- scitex/fts/_schemas/encoding.schema.json +90 -0
- scitex/fts/_schemas/node.schema.json +145 -0
- scitex/fts/_schemas/render_manifest.schema.json +62 -0
- scitex/fts/_schemas/stats.schema.json +132 -0
- scitex/fts/_schemas/theme.schema.json +141 -0
- scitex/fts/_stats/__init__.py +48 -0
- scitex/fts/_stats/_dataclasses/_Stats.py +423 -0
- scitex/fts/_stats/_dataclasses/__init__.py +48 -0
- scitex/fts/_tables/__init__.py +65 -0
- scitex/fts/_tables/_latex/__init__.py +93 -0
- scitex/fts/_tables/_latex/_editor/__init__.py +11 -0
- scitex/fts/_tables/_latex/_editor/_app.py +725 -0
- scitex/fts/_tables/_latex/_export.py +279 -0
- scitex/fts/_tables/_latex/_figure_exporter.py +153 -0
- scitex/fts/_tables/_latex/_stats_formatter.py +274 -0
- scitex/fts/_tables/_latex/_table_exporter.py +362 -0
- scitex/fts/_tables/_latex/_utils.py +369 -0
- scitex/fts/_tables/_latex/_validator.py +445 -0
- scitex/gen/__init__.py +66 -25
- scitex/gen/misc.py +28 -0
- scitex/io/__init__.py +47 -20
- scitex/io/_load.py +87 -36
- scitex/io/_load_modules/__init__.py +10 -7
- scitex/io/_load_modules/_pandas.py +6 -1
- scitex/io/_save.py +299 -1556
- scitex/io/_save_modules/__init__.py +76 -19
- scitex/io/_save_modules/_figure_utils.py +90 -0
- scitex/io/_save_modules/_image_csv.py +497 -0
- scitex/io/_save_modules/_legends.py +91 -0
- scitex/io/_save_modules/_pltz_bundle.py +356 -0
- scitex/io/_save_modules/_pltz_stx.py +536 -0
- scitex/io/_save_modules/_stx_bundle.py +104 -0
- scitex/io/_save_modules/_symlink.py +96 -0
- scitex/io/_save_modules/_yaml.py +1 -1
- scitex/io/_save_modules/_zarr.py +64 -18
- scitex/io/bundle/README.md +212 -0
- scitex/io/bundle/__init__.py +110 -0
- scitex/io/{_bundle.py → bundle/_core.py} +219 -89
- scitex/io/bundle/_nested.py +713 -0
- scitex/io/bundle/_types.py +74 -0
- scitex/io/bundle/_zip.py +487 -0
- scitex/io/utils/h5_to_zarr.py +1 -1
- scitex/logging/__init__.py +108 -13
- scitex/logging/_errors.py +508 -0
- scitex/logging/_formatters.py +30 -6
- scitex/logging/_warnings.py +261 -0
- scitex/plt/__init__.py +4 -1
- scitex/plt/_figrecipe.py +236 -0
- scitex/plt/_subplots/_AxisWrapper.py +6 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_UnitAwareMixin.py +112 -1
- scitex/plt/_subplots/_FigWrapper.py +15 -0
- scitex/plt/_subplots/_SubplotsWrapper.py +125 -489
- scitex/plt/_subplots/_export_as_csv.py +11 -0
- scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +2 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_pcolormesh.py +66 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stackplot.py +62 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/test_formatters.py +208 -0
- scitex/plt/_subplots/_fonts.py +71 -0
- scitex/plt/_subplots/_mm_layout.py +282 -0
- scitex/plt/gallery/__init__.py +99 -2
- scitex/plt/io/_layered_bundle.py +0 -0
- scitex/plt/styles/_plot_postprocess.py +3 -1
- scitex/plt/utils/_configure_mpl.py +16 -19
- scitex/repro/_RandomStateManager.py +13 -8
- scitex/resource/__init__.py +19 -1
- scitex/resource/_utils/_get_env_info.py +13 -25
- scitex/schema/__init__.py +149 -160
- scitex/schema/_encoding.py +273 -0
- scitex/schema/_figure_elements.py +406 -0
- scitex/schema/_plot.py +0 -0
- scitex/schema/_theme.py +360 -0
- scitex/schema/_validation.py +0 -98
- scitex/scholar/__init__.py +56 -14
- scitex/scholar/auth/ScholarAuthManager.py +1 -1
- scitex/scholar/auth/__init__.py +11 -2
- scitex/scholar/auth/providers/BaseAuthenticator.py +1 -1
- scitex/scholar/auth/providers/EZProxyAuthenticator.py +1 -1
- scitex/scholar/auth/providers/OpenAthensAuthenticator.py +1 -1
- scitex/scholar/auth/providers/ShibbolethAuthenticator.py +1 -1
- scitex/scholar/config/ScholarConfig.py +1 -1
- scitex/scholar/core/Scholar.py +1 -1
- scitex/session/_decorator.py +18 -16
- scitex/session/_lifecycle.py +9 -11
- scitex/session/template.py +9 -8
- scitex/sh/test_sh.py +72 -0
- scitex/sh/test_sh_simple.py +61 -0
- scitex/stats/__init__.py +221 -97
- scitex/stats/_schema.py +21 -22
- scitex/stats/descriptive/_circular.py +212 -351
- scitex/stats/descriptive/_describe.py +81 -132
- scitex/stats/descriptive/_nan.py +205 -433
- scitex/stats/descriptive/_real.py +127 -141
- scitex/str/_format_plot_text.py +5 -5
- scitex/str/_latex.py +26 -84
- scitex/str/_latex_fallback.py +53 -47
- scitex/web/_search_pubmed.py +5 -4
- scitex/writer/tests/test_diff_between.py +451 -0
- scitex/writer/tests/test_document_section.py +311 -0
- scitex/writer/tests/test_document_workflow.py +393 -0
- scitex/writer/tests/test_writer.py +361 -0
- scitex/writer/tests/test_writer_integration.py +303 -0
- {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/METADATA +364 -181
- {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/RECORD +479 -108
- scitex/fig/editor/_edit.py +0 -751
- scitex/scholar/docs/to_claude/guidelines/examples/mgmt/ARCHITECTURE_EXAMPLE.md +0 -905
- scitex/scholar/docs/to_claude/guidelines/examples/mgmt/BULLETIN_BOARD_EXAMPLE.md +0 -99
- scitex/scholar/docs/to_claude/guidelines/examples/mgmt/PROJECT_DESCRIPTION_EXAMPLE.md +0 -96
- {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/WHEEL +0 -0
- {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/entry_points.txt +0 -0
- {scitex-2.7.3.dist-info → scitex-2.10.0.dist-info}/licenses/LICENSE +0 -0
scitex/__init__.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Timestamp: "2025-07-14 15:28:49 (ywatanabe)"
|
|
4
3
|
# File: /ssh:ywatanabe@sp:/home/ywatanabe/proj/SciTeX-Code/src/scitex/__init__.py
|
|
5
4
|
# ----------------------------------------
|
|
@@ -16,14 +15,15 @@ Modules are imported on-demand to avoid circular dependencies.
|
|
|
16
15
|
|
|
17
16
|
import warnings
|
|
18
17
|
|
|
19
|
-
#
|
|
20
|
-
warnings.filterwarnings("
|
|
21
|
-
# Then ignore others
|
|
22
|
-
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
18
|
+
# Show deprecation warnings from scitex modules (educational for migration)
|
|
19
|
+
warnings.filterwarnings("default", category=DeprecationWarning, module="scitex.*")
|
|
23
20
|
|
|
24
21
|
# Version
|
|
25
22
|
from .__version__ import __version__
|
|
26
23
|
|
|
24
|
+
# Installation guide - show users what modules are available
|
|
25
|
+
from ._install_guide import show_install_guide
|
|
26
|
+
|
|
27
27
|
|
|
28
28
|
# Sentinel object for decorator-injected parameters
|
|
29
29
|
class _InjectedSentinel:
|
|
@@ -145,7 +145,8 @@ resource = _LazyModule("resource")
|
|
|
145
145
|
tex = _LazyModule("tex")
|
|
146
146
|
linalg = _LazyModule("linalg")
|
|
147
147
|
parallel = _LazyModule("parallel")
|
|
148
|
-
|
|
148
|
+
datetime = _LazyModule("datetime")
|
|
149
|
+
dt = _LazyModule("dt") # Alias for datetime (shorter name)
|
|
149
150
|
types = _LazyModule("types")
|
|
150
151
|
utils = _LazyModule("utils")
|
|
151
152
|
etc = _LazyModule("etc")
|
|
@@ -163,6 +164,10 @@ cloud = _LazyModule("cloud")
|
|
|
163
164
|
config = _LazyModule("config")
|
|
164
165
|
audio = _LazyModule("audio")
|
|
165
166
|
msword = _LazyModule("msword")
|
|
167
|
+
fts = _LazyModule(
|
|
168
|
+
"fts"
|
|
169
|
+
) # Figure-Table-Statistics - single source of truth for bundle schemas
|
|
170
|
+
fsb = fts # Legacy alias (FSB -> FTS)
|
|
166
171
|
|
|
167
172
|
# Centralized path configuration - eager loaded for convenience
|
|
168
173
|
# Usage: scitex.PATHS.logs, scitex.PATHS.cache, etc.
|
|
@@ -214,7 +219,8 @@ __all__ = [
|
|
|
214
219
|
"tex",
|
|
215
220
|
"linalg",
|
|
216
221
|
"parallel",
|
|
217
|
-
"
|
|
222
|
+
"datetime",
|
|
223
|
+
"dt", # Alias for datetime (shorter name)
|
|
218
224
|
"types",
|
|
219
225
|
"utils",
|
|
220
226
|
"etc",
|
|
@@ -225,6 +231,8 @@ __all__ = [
|
|
|
225
231
|
"config",
|
|
226
232
|
"audio",
|
|
227
233
|
"msword",
|
|
234
|
+
"fts",
|
|
235
|
+
"fsb", # Legacy alias
|
|
228
236
|
"PATHS",
|
|
229
237
|
"INJECTED",
|
|
230
238
|
]
|
scitex/__version__.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Timestamp: "2025-05-31 00:20:14 (ywatanabe)"
|
|
4
3
|
# File: /ssh:ywatanabe@sp:/home/ywatanabe/proj/.claude-worktree/scitex_repo/src/scitex/__version__.py
|
|
5
4
|
# ----------------------------------------
|
|
@@ -9,6 +8,6 @@ __FILE__ = "./src/scitex/__version__.py"
|
|
|
9
8
|
__DIR__ = os.path.dirname(__FILE__)
|
|
10
9
|
# ----------------------------------------
|
|
11
10
|
|
|
12
|
-
__version__ = "2.
|
|
11
|
+
__version__ = "2.10.0"
|
|
13
12
|
|
|
14
13
|
# EOF
|
scitex/_install_guide.py
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Installation guide and module dependency checking for SciTeX.
|
|
4
|
+
|
|
5
|
+
This module provides helpers to check module dependencies and show
|
|
6
|
+
helpful installation guides when dependencies are missing.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import functools
|
|
10
|
+
import importlib
|
|
11
|
+
import warnings
|
|
12
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
|
|
13
|
+
|
|
14
|
+
from ._optional_deps import PACKAGE_TO_EXTRA, check_optional_deps
|
|
15
|
+
|
|
16
|
+
F = TypeVar("F", bound=Callable[..., Any])
|
|
17
|
+
|
|
18
|
+
# Module name -> (required_packages, extra_name, description)
|
|
19
|
+
MODULE_REQUIREMENTS: Dict[str, Tuple[List[str], str, str]] = {
|
|
20
|
+
"ai": (["openai", "anthropic"], "ai", "LLM APIs"),
|
|
21
|
+
"audio": (["pyttsx3", "gtts"], "audio", "Text-to-Speech"),
|
|
22
|
+
"benchmark": (["psutil"], "benchmark", "Performance Monitoring"),
|
|
23
|
+
"browser": (["playwright"], "browser", "Web Automation"),
|
|
24
|
+
"capture": (["mss", "PIL"], "capture", "Screenshot Capture"),
|
|
25
|
+
"cli": (["click"], "cli", "Command Line Interface"),
|
|
26
|
+
"db": (["sqlalchemy"], "db", "Database"),
|
|
27
|
+
"decorators": (["joblib"], "decorators", "Caching Utilities"),
|
|
28
|
+
"dsp": (["scipy", "sounddevice"], "dsp", "Signal Processing"),
|
|
29
|
+
"fts": (["matplotlib", "PIL", "flask"], "fts", "Figures/Tables/Stats"),
|
|
30
|
+
"gen": (["IPython", "h5py"], "gen", "General Utilities"),
|
|
31
|
+
"git": (["git"], "git", "Git Operations"),
|
|
32
|
+
"io": (["h5py", "openpyxl"], "io", "File I/O"),
|
|
33
|
+
"linalg": (["scipy", "sympy"], "linalg", "Linear Algebra"),
|
|
34
|
+
"msword": (["docx"], "msword", "MS Word"),
|
|
35
|
+
"neuro": (["mne"], "neuro", "Neuroscience"),
|
|
36
|
+
"nn": (["torch"], "nn", "Neural Networks"),
|
|
37
|
+
"path": (["git"], "path", "Path Utilities"),
|
|
38
|
+
"plt": (["matplotlib", "seaborn"], "plt", "Plotting"),
|
|
39
|
+
"repro": (["torch"], "repro", "Reproducibility"),
|
|
40
|
+
"resource": (["psutil"], "resource", "Resource Monitoring"),
|
|
41
|
+
"scholar": (["selenium", "bs4", "playwright"], "scholar", "Paper Management"),
|
|
42
|
+
"stats": (["scipy", "statsmodels"], "stats", "Statistical Analysis"),
|
|
43
|
+
"str": (["natsort"], "str", "String Utilities"),
|
|
44
|
+
"torch": (["torch"], "torch", "PyTorch Support"),
|
|
45
|
+
"types": (["xarray"], "types", "Type Utilities"),
|
|
46
|
+
"web": (["aiohttp", "bs4"], "web", "Web Utilities"),
|
|
47
|
+
"writer": (["yq"], "writer", "Academic Writing"),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def check_module_deps(module_name: str) -> Dict[str, Any]:
|
|
52
|
+
"""
|
|
53
|
+
Check if a module's dependencies are installed.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
module_name: Name of the scitex module (e.g., 'audio', 'scholar')
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
Dict with keys:
|
|
60
|
+
- available: bool - whether all required deps are installed
|
|
61
|
+
- missing: list - list of missing packages
|
|
62
|
+
- install_cmd: str - command to install missing deps
|
|
63
|
+
- extra: str - the installation extra name
|
|
64
|
+
"""
|
|
65
|
+
if module_name not in MODULE_REQUIREMENTS:
|
|
66
|
+
return {"available": True, "missing": [], "install_cmd": "", "extra": ""}
|
|
67
|
+
|
|
68
|
+
required, extra, _desc = MODULE_REQUIREMENTS[module_name]
|
|
69
|
+
available = check_optional_deps(*required)
|
|
70
|
+
missing = [pkg for pkg, is_available in available.items() if not is_available]
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
"available": len(missing) == 0,
|
|
74
|
+
"missing": missing,
|
|
75
|
+
"install_cmd": f"pip install scitex[{extra}]",
|
|
76
|
+
"extra": extra,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def require_module(module_name: str) -> None:
|
|
81
|
+
"""
|
|
82
|
+
Check module dependencies and raise helpful error if missing.
|
|
83
|
+
|
|
84
|
+
Call this at the top of a module's __init__.py to provide
|
|
85
|
+
clear guidance when dependencies aren't installed.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
module_name: Name of the scitex module
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
ImportError: With helpful installation instructions
|
|
92
|
+
|
|
93
|
+
Example:
|
|
94
|
+
# In scitex/audio/__init__.py:
|
|
95
|
+
from scitex._install_guide import require_module
|
|
96
|
+
require_module("audio") # Raises helpful error if deps missing
|
|
97
|
+
"""
|
|
98
|
+
result = check_module_deps(module_name)
|
|
99
|
+
|
|
100
|
+
if not result["available"]:
|
|
101
|
+
if module_name in MODULE_REQUIREMENTS:
|
|
102
|
+
_, extra, desc = MODULE_REQUIREMENTS[module_name]
|
|
103
|
+
else:
|
|
104
|
+
extra, desc = "all", module_name
|
|
105
|
+
|
|
106
|
+
missing_str = ", ".join(result["missing"])
|
|
107
|
+
raise ImportError(
|
|
108
|
+
f"\n"
|
|
109
|
+
f"{'=' * 70}\n"
|
|
110
|
+
f"scitex.{module_name} - {desc}\n"
|
|
111
|
+
f"{'=' * 70}\n"
|
|
112
|
+
f"\n"
|
|
113
|
+
f"This module requires dependencies that are not installed:\n"
|
|
114
|
+
f" Missing: {missing_str}\n"
|
|
115
|
+
f"\n"
|
|
116
|
+
f"To use this module, install with:\n"
|
|
117
|
+
f"\n"
|
|
118
|
+
f" {result['install_cmd']}\n"
|
|
119
|
+
f"\n"
|
|
120
|
+
f"Or install all optional dependencies:\n"
|
|
121
|
+
f"\n"
|
|
122
|
+
f" pip install scitex[all]\n"
|
|
123
|
+
f"\n"
|
|
124
|
+
f"{'=' * 70}\n"
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def warn_module_deps(module_name: str) -> List[str]:
|
|
129
|
+
"""
|
|
130
|
+
Check module dependencies and print warning if missing (non-blocking).
|
|
131
|
+
|
|
132
|
+
Unlike require_module(), this doesn't raise an error, just warns.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
module_name: Name of the scitex module
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
List of missing package names
|
|
139
|
+
"""
|
|
140
|
+
result = check_module_deps(module_name)
|
|
141
|
+
|
|
142
|
+
if not result["available"]:
|
|
143
|
+
if module_name in MODULE_REQUIREMENTS:
|
|
144
|
+
_, extra, desc = MODULE_REQUIREMENTS[module_name]
|
|
145
|
+
else:
|
|
146
|
+
extra, desc = "all", module_name
|
|
147
|
+
|
|
148
|
+
missing_str = ", ".join(result["missing"])
|
|
149
|
+
warnings.warn(
|
|
150
|
+
f"\nscitex.{module_name} ({desc}): Some features unavailable.\n"
|
|
151
|
+
f"Missing: {missing_str}\n"
|
|
152
|
+
f"Install with: {result['install_cmd']}\n",
|
|
153
|
+
ImportWarning,
|
|
154
|
+
stacklevel=2,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
return result["missing"]
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def requires(*packages: str, extra: Optional[str] = None):
|
|
161
|
+
"""
|
|
162
|
+
Decorator that checks dependencies before function execution.
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
*packages: Required package names
|
|
166
|
+
extra: Installation extra name (auto-detected if not provided)
|
|
167
|
+
|
|
168
|
+
Example:
|
|
169
|
+
@requires("torch", "torchvision", extra="dl")
|
|
170
|
+
def train_model(data):
|
|
171
|
+
import torch
|
|
172
|
+
...
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
def decorator(func: F) -> F:
|
|
176
|
+
@functools.wraps(func)
|
|
177
|
+
def wrapper(*args, **kwargs):
|
|
178
|
+
missing = []
|
|
179
|
+
for pkg in packages:
|
|
180
|
+
try:
|
|
181
|
+
importlib.import_module(pkg)
|
|
182
|
+
except ImportError:
|
|
183
|
+
missing.append(pkg)
|
|
184
|
+
|
|
185
|
+
if missing:
|
|
186
|
+
install_extra = extra
|
|
187
|
+
if install_extra is None:
|
|
188
|
+
pkg_info = PACKAGE_TO_EXTRA.get(missing[0])
|
|
189
|
+
install_extra = pkg_info[1] if pkg_info else "all"
|
|
190
|
+
|
|
191
|
+
missing_str = ", ".join(missing)
|
|
192
|
+
raise ImportError(
|
|
193
|
+
f"\n"
|
|
194
|
+
f"Function '{func.__name__}' requires: {missing_str}\n"
|
|
195
|
+
f"Install with: pip install scitex[{install_extra}]\n"
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return func(*args, **kwargs)
|
|
199
|
+
|
|
200
|
+
return wrapper # type: ignore
|
|
201
|
+
|
|
202
|
+
return decorator
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def show_install_guide(module_name: Optional[str] = None) -> None:
|
|
206
|
+
"""
|
|
207
|
+
Print installation guide for scitex modules.
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
module_name: Specific module to show guide for, or None for all
|
|
211
|
+
|
|
212
|
+
Example:
|
|
213
|
+
>>> from scitex._install_guide import show_install_guide
|
|
214
|
+
>>> show_install_guide("audio")
|
|
215
|
+
>>> show_install_guide() # Shows all modules
|
|
216
|
+
"""
|
|
217
|
+
print("\n" + "=" * 70)
|
|
218
|
+
print("SciTeX Installation Guide")
|
|
219
|
+
print("=" * 70)
|
|
220
|
+
|
|
221
|
+
if module_name:
|
|
222
|
+
if module_name in MODULE_REQUIREMENTS:
|
|
223
|
+
required, extra, desc = MODULE_REQUIREMENTS[module_name]
|
|
224
|
+
result = check_module_deps(module_name)
|
|
225
|
+
status = "Installed" if result["available"] else "Not installed"
|
|
226
|
+
|
|
227
|
+
print(f"\n{module_name} - {desc}")
|
|
228
|
+
print(f" Status: {status}")
|
|
229
|
+
print(f" Install: pip install scitex[{extra}]")
|
|
230
|
+
if not result["available"]:
|
|
231
|
+
print(f" Missing: {', '.join(result['missing'])}")
|
|
232
|
+
else:
|
|
233
|
+
print(f"\nModule '{module_name}' not found.")
|
|
234
|
+
else:
|
|
235
|
+
print("\nModule-oriented installation (install only what you need):\n")
|
|
236
|
+
|
|
237
|
+
for mod_name, (required, extra, desc) in sorted(MODULE_REQUIREMENTS.items()):
|
|
238
|
+
result = check_module_deps(mod_name)
|
|
239
|
+
status = "[ok]" if result["available"] else "[--]"
|
|
240
|
+
print(f" {status} {mod_name:12} pip install scitex[{extra}]")
|
|
241
|
+
|
|
242
|
+
print("\nConvenience groups:\n")
|
|
243
|
+
print(" pip install scitex[science] # scipy, matplotlib, scikit-learn")
|
|
244
|
+
print(" pip install scitex[dl] # PyTorch, transformers")
|
|
245
|
+
print(" pip install scitex[all] # Everything")
|
|
246
|
+
|
|
247
|
+
print("\n" + "=" * 70 + "\n")
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
# EOF
|
scitex/_optional_deps.py
CHANGED
|
@@ -1,46 +1,150 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
"""
|
|
4
3
|
Utility for handling optional dependencies with helpful error messages.
|
|
4
|
+
|
|
5
|
+
SciTeX uses module-oriented optional dependencies. Install what you need:
|
|
6
|
+
pip install scitex[audio] # Audio/TTS module
|
|
7
|
+
pip install scitex[scholar] # Paper management
|
|
8
|
+
pip install scitex[stats] # Statistical analysis
|
|
9
|
+
pip install scitex[io] # File I/O operations
|
|
10
|
+
pip install scitex[all] # Everything
|
|
11
|
+
|
|
12
|
+
Multiple modules:
|
|
13
|
+
pip install scitex[audio,scholar,stats]
|
|
5
14
|
"""
|
|
6
15
|
|
|
7
|
-
from typing import Optional, Dict, Any
|
|
8
16
|
import importlib
|
|
17
|
+
from typing import Any, Callable, Dict, List, Optional, TypeVar
|
|
9
18
|
|
|
19
|
+
F = TypeVar("F", bound=Callable[..., Any])
|
|
20
|
+
|
|
21
|
+
# Mapping of package imports to their installation extras
|
|
22
|
+
# Format: import_name -> (pip_package, install_extra)
|
|
23
|
+
PACKAGE_TO_EXTRA: Dict[str, tuple] = {
|
|
24
|
+
# AI Module
|
|
25
|
+
"openai": ("openai", "ai"),
|
|
26
|
+
"anthropic": ("anthropic", "ai"),
|
|
27
|
+
"google.generativeai": ("google-genai", "ai"),
|
|
28
|
+
"groq": ("groq", "ai"),
|
|
29
|
+
# Audio Module
|
|
30
|
+
"pyttsx3": ("pyttsx3", "audio"),
|
|
31
|
+
"gtts": ("gTTS", "audio"),
|
|
32
|
+
"pydub": ("pydub", "audio"),
|
|
33
|
+
"elevenlabs": ("elevenlabs", "audio"),
|
|
34
|
+
# Benchmark/Resource Module
|
|
35
|
+
"psutil": ("psutil", "benchmark"),
|
|
36
|
+
# Browser/Capture Module
|
|
37
|
+
"playwright": ("playwright", "browser"),
|
|
38
|
+
"mss": ("mss", "capture"),
|
|
39
|
+
# CLI Module
|
|
40
|
+
"click": ("click", "cli"),
|
|
41
|
+
# DB Module
|
|
42
|
+
"sqlalchemy": ("sqlalchemy", "db"),
|
|
43
|
+
"psycopg2": ("psycopg2-binary", "db"),
|
|
44
|
+
# DSP Module
|
|
45
|
+
"sounddevice": ("sounddevice", "dsp"),
|
|
46
|
+
# Gen Module
|
|
47
|
+
"IPython": ("ipython", "gen"),
|
|
48
|
+
"pyperclip": ("pyperclip", "gen"),
|
|
49
|
+
"readchar": ("readchar", "gen"),
|
|
50
|
+
# Git Module
|
|
51
|
+
"git": ("GitPython", "git"),
|
|
52
|
+
# IO Module
|
|
53
|
+
"h5py": ("h5py", "io"),
|
|
54
|
+
"openpyxl": ("openpyxl", "io"),
|
|
55
|
+
"xlrd": ("xlrd", "io"),
|
|
56
|
+
"ruamel": ("ruamel.yaml", "io"),
|
|
57
|
+
"xarray": ("xarray", "io"),
|
|
58
|
+
"zarr": ("zarr", "io"),
|
|
59
|
+
"PIL": ("Pillow", "io"),
|
|
60
|
+
"piexif": ("piexif", "io"),
|
|
61
|
+
"pypdf": ("pypdf", "io"),
|
|
62
|
+
"qrcode": ("qrcode[pil]", "io"),
|
|
63
|
+
"PyPDF2": ("PyPDF2", "io"),
|
|
64
|
+
"fitz": ("PyMuPDF", "io"),
|
|
65
|
+
"pdfplumber": ("pdfplumber", "io"),
|
|
66
|
+
"docx": ("python-docx", "io"),
|
|
67
|
+
"html2text": ("html2text", "io"),
|
|
68
|
+
"plotly": ("plotly", "io"),
|
|
69
|
+
"pymatreader": ("pymatreader", "io"),
|
|
70
|
+
# Linalg Module
|
|
71
|
+
"sympy": ("sympy", "linalg"),
|
|
72
|
+
"geom_median": ("geom_median", "linalg"),
|
|
73
|
+
# MSWord Module
|
|
74
|
+
"pypandoc": ("pypandoc", "msword"),
|
|
75
|
+
# NN Module
|
|
76
|
+
"torch": ("torch", "nn"),
|
|
77
|
+
"torchaudio": ("torchaudio", "nn"),
|
|
78
|
+
"torchsummary": ("torchsummary", "nn"),
|
|
79
|
+
"julius": ("julius", "nn"),
|
|
80
|
+
# PLT Module
|
|
81
|
+
"matplotlib": ("matplotlib", "plt"),
|
|
82
|
+
"seaborn": ("seaborn", "plt"),
|
|
83
|
+
"termplotlib": ("termplotlib", "plt"),
|
|
84
|
+
# Scholar Module
|
|
85
|
+
"selenium": ("selenium", "scholar"),
|
|
86
|
+
"bs4": ("beautifulsoup4", "scholar"),
|
|
87
|
+
"crawl4ai": ("crawl4ai", "scholar"),
|
|
88
|
+
"scholarly": ("scholarly", "scholar"),
|
|
89
|
+
"pymed": ("pymed", "scholar"),
|
|
90
|
+
"pytesseract": ("pytesseract", "scholar"),
|
|
91
|
+
"bibtexparser": ("bibtexparser", "scholar"),
|
|
92
|
+
"feedparser": ("feedparser", "scholar"),
|
|
93
|
+
"httpx": ("httpx", "scholar"),
|
|
94
|
+
"tenacity": ("tenacity", "scholar"),
|
|
95
|
+
"pydantic": ("pydantic", "scholar"),
|
|
96
|
+
"watchdog": ("watchdog", "scholar"),
|
|
97
|
+
# Stats Module
|
|
98
|
+
"scipy": ("scipy", "stats"),
|
|
99
|
+
"statsmodels": ("statsmodels", "stats"),
|
|
100
|
+
# Web Module
|
|
101
|
+
"aiohttp": ("aiohttp", "web"),
|
|
102
|
+
"requests": ("requests", "web"),
|
|
103
|
+
"readability": ("readability-lxml", "web"),
|
|
104
|
+
# Writer Module
|
|
105
|
+
"yq": ("yq", "writer"),
|
|
106
|
+
# DL Module (convenience group)
|
|
107
|
+
"torchvision": ("torchvision", "dl"),
|
|
108
|
+
"transformers": ("transformers", "dl"),
|
|
109
|
+
"accelerate": ("accelerate", "dl"),
|
|
110
|
+
"bitsandbytes": ("bitsandbytes", "dl"),
|
|
111
|
+
"fairscale": ("fairscale", "dl"),
|
|
112
|
+
"einops": ("einops", "dl"),
|
|
113
|
+
# ML Module (convenience group)
|
|
114
|
+
"sklearn": ("scikit-learn", "ml"),
|
|
115
|
+
"skimage": ("scikit-image", "ml"),
|
|
116
|
+
"imblearn": ("imbalanced-learn", "ml"),
|
|
117
|
+
"umap": ("umap-learn", "ml"),
|
|
118
|
+
"sktime": ("sktime", "ml"),
|
|
119
|
+
"catboost": ("catboost", "ml"),
|
|
120
|
+
"optuna": ("optuna", "ml"),
|
|
121
|
+
"cv2": ("opencv-python", "ml"),
|
|
122
|
+
# Jupyter Module
|
|
123
|
+
"jupyterlab": ("jupyterlab", "jupyter"),
|
|
124
|
+
"ipykernel": ("ipykernel", "jupyter"),
|
|
125
|
+
"ipdb": ("ipdb", "jupyter"),
|
|
126
|
+
"papermill": ("papermill", "jupyter"),
|
|
127
|
+
"jupytext": ("jupytext", "jupyter"),
|
|
128
|
+
# Neuro Module
|
|
129
|
+
"mne": ("mne", "neuro"),
|
|
130
|
+
"obspy": ("obspy", "neuro"),
|
|
131
|
+
"pyedflib": ("pyedflib", "neuro"),
|
|
132
|
+
"pybids": ("pybids", "neuro"),
|
|
133
|
+
"tensorpac": ("tensorpac", "neuro"),
|
|
134
|
+
"ripple_detection": ("ripple_detection", "neuro"),
|
|
135
|
+
# Webdev Module
|
|
136
|
+
"fastapi": ("fastapi", "webdev"),
|
|
137
|
+
"flask": ("flask", "webdev"),
|
|
138
|
+
"streamlit": ("streamlit", "webdev"),
|
|
139
|
+
"celery": ("celery", "webdev"),
|
|
140
|
+
# GUI Module
|
|
141
|
+
"dearpygui": ("dearpygui", "gui"),
|
|
142
|
+
"PyQt6": ("PyQt6", "gui"),
|
|
143
|
+
}
|
|
10
144
|
|
|
11
|
-
#
|
|
145
|
+
# Backwards compatibility: simple mapping
|
|
12
146
|
DEPENDENCY_GROUPS: Dict[str, str] = {
|
|
13
|
-
|
|
14
|
-
"torch": "dl",
|
|
15
|
-
"torchvision": "dl",
|
|
16
|
-
"torchaudio": "dl",
|
|
17
|
-
"transformers": "dl",
|
|
18
|
-
"accelerate": "dl",
|
|
19
|
-
"bitsandbytes": "dl",
|
|
20
|
-
"fairscale": "dl",
|
|
21
|
-
# AI APIs
|
|
22
|
-
"openai": "ai-apis",
|
|
23
|
-
"anthropic": "ai-apis",
|
|
24
|
-
"google.generativeai": "ai-apis",
|
|
25
|
-
"groq": "ai-apis",
|
|
26
|
-
# Scholar
|
|
27
|
-
"selenium": "scholar",
|
|
28
|
-
"playwright": "scholar",
|
|
29
|
-
"crawl4ai": "scholar",
|
|
30
|
-
"bs4": "scholar",
|
|
31
|
-
# Neuroscience
|
|
32
|
-
"mne": "neuro",
|
|
33
|
-
"obspy": "neuro",
|
|
34
|
-
"pyedflib": "neuro",
|
|
35
|
-
"tensorpac": "neuro",
|
|
36
|
-
# Web
|
|
37
|
-
"fastapi": "web",
|
|
38
|
-
"flask": "web",
|
|
39
|
-
"streamlit": "web",
|
|
40
|
-
# Jupyter
|
|
41
|
-
"jupyterlab": "jupyter",
|
|
42
|
-
"IPython": "jupyter",
|
|
43
|
-
"ipykernel": "jupyter",
|
|
147
|
+
module: info[1] for module, info in PACKAGE_TO_EXTRA.items()
|
|
44
148
|
}
|
|
45
149
|
|
|
46
150
|
|
|
@@ -68,14 +172,18 @@ def optional_import(
|
|
|
68
172
|
if not raise_error:
|
|
69
173
|
return None
|
|
70
174
|
|
|
71
|
-
|
|
72
|
-
|
|
175
|
+
pkg_info = PACKAGE_TO_EXTRA.get(module_name)
|
|
176
|
+
if pkg_info:
|
|
177
|
+
pip_pkg, extra = pkg_info
|
|
178
|
+
else:
|
|
179
|
+
pip_pkg = package_name or module_name
|
|
180
|
+
extra = "all"
|
|
73
181
|
|
|
74
182
|
error_msg = (
|
|
75
183
|
f"\n{'=' * 70}\n"
|
|
76
|
-
f"Optional dependency '{
|
|
184
|
+
f"Optional dependency '{pip_pkg}' is not installed.\n\n"
|
|
77
185
|
f"To use this feature, install it with:\n"
|
|
78
|
-
f" pip install scitex[{
|
|
186
|
+
f" pip install scitex[{extra}]\n\n"
|
|
79
187
|
f"Or install all optional dependencies:\n"
|
|
80
188
|
f" pip install scitex[all]\n"
|
|
81
189
|
f"{'=' * 70}\n"
|
|
@@ -108,7 +216,42 @@ def check_optional_deps(*module_names: str) -> Dict[str, bool]:
|
|
|
108
216
|
return result
|
|
109
217
|
|
|
110
218
|
|
|
111
|
-
|
|
219
|
+
def get_install_command(module_name: str) -> str:
|
|
220
|
+
"""
|
|
221
|
+
Get the pip install command for a module.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
module_name: Name of the module
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
pip install command string
|
|
228
|
+
|
|
229
|
+
Example:
|
|
230
|
+
>>> get_install_command('torch')
|
|
231
|
+
'pip install scitex[nn]'
|
|
232
|
+
"""
|
|
233
|
+
pkg_info = PACKAGE_TO_EXTRA.get(module_name)
|
|
234
|
+
if pkg_info:
|
|
235
|
+
return f"pip install scitex[{pkg_info[1]}]"
|
|
236
|
+
return "pip install scitex[all]"
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def list_available_extras() -> List[str]:
|
|
240
|
+
"""
|
|
241
|
+
List all available installation extras.
|
|
242
|
+
|
|
243
|
+
Returns:
|
|
244
|
+
List of extra names (e.g., ['audio', 'scholar', 'stats', ...])
|
|
245
|
+
"""
|
|
246
|
+
extras = set(info[1] for info in PACKAGE_TO_EXTRA.values())
|
|
247
|
+
# Add convenience groups
|
|
248
|
+
extras.update(
|
|
249
|
+
["science", "dl", "ml", "jupyter", "neuro", "webdev", "gui", "dev", "all"]
|
|
250
|
+
)
|
|
251
|
+
return sorted(extras)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
# Convenience functions for common checks
|
|
112
255
|
def has_deep_learning() -> bool:
|
|
113
256
|
"""Check if deep learning dependencies are available."""
|
|
114
257
|
return check_optional_deps("torch")["torch"]
|
|
@@ -130,4 +273,28 @@ def has_jupyter() -> bool:
|
|
|
130
273
|
return check_optional_deps("IPython")["IPython"]
|
|
131
274
|
|
|
132
275
|
|
|
276
|
+
def has_audio() -> bool:
|
|
277
|
+
"""Check if audio/TTS dependencies are available."""
|
|
278
|
+
deps = check_optional_deps("pyttsx3", "gtts")
|
|
279
|
+
return any(deps.values())
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def has_stats() -> bool:
|
|
283
|
+
"""Check if stats dependencies are available."""
|
|
284
|
+
return check_optional_deps("scipy", "statsmodels") == {
|
|
285
|
+
"scipy": True,
|
|
286
|
+
"statsmodels": True,
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def has_io() -> bool:
|
|
291
|
+
"""Check if IO dependencies are available."""
|
|
292
|
+
return check_optional_deps("h5py")["h5py"]
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def has_plotting() -> bool:
|
|
296
|
+
"""Check if plotting dependencies are available."""
|
|
297
|
+
return check_optional_deps("matplotlib")["matplotlib"]
|
|
298
|
+
|
|
299
|
+
|
|
133
300
|
# EOF
|
scitex/ai/_gen_ai/_Groq.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Time-stamp: "2024-11-28 02:47:54 (ywatanabe)"
|
|
4
3
|
# File: ./scitex_repo/src/scitex/ai/_gen_ai/_Groq.py
|
|
5
4
|
|
|
@@ -22,11 +21,9 @@ Prerequisites:
|
|
|
22
21
|
|
|
23
22
|
"""Imports"""
|
|
24
23
|
import os
|
|
25
|
-
import
|
|
26
|
-
from typing import Any, Dict, Generator, List, Optional, Union
|
|
24
|
+
from typing import Any, Dict, Generator, List, Optional
|
|
27
25
|
|
|
28
26
|
from groq import Groq as _Groq
|
|
29
|
-
import matplotlib.pyplot as plt
|
|
30
27
|
|
|
31
28
|
from ._BaseGenAI import BaseGenAI
|
|
32
29
|
|
|
@@ -55,6 +52,7 @@ class Groq(BaseGenAI):
|
|
|
55
52
|
model=model,
|
|
56
53
|
api_key=api_key,
|
|
57
54
|
stream=stream,
|
|
55
|
+
seed=seed,
|
|
58
56
|
n_keep=n_keep,
|
|
59
57
|
temperature=temperature,
|
|
60
58
|
provider="Groq",
|
scitex/ai/_gen_ai/_OpenAI.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
# Timestamp: "2025-01-22 01:21:11 (ywatanabe)"
|
|
4
3
|
# File: _OpenAI.py
|
|
5
4
|
|
|
@@ -8,7 +7,9 @@ THIS_FILE = "/home/ywatanabe/proj/scitex_repo/src/scitex/ai/_gen_ai/_OpenAI.py"
|
|
|
8
7
|
|
|
9
8
|
"""Imports"""
|
|
10
9
|
import os
|
|
10
|
+
|
|
11
11
|
from openai import OpenAI as _OpenAI
|
|
12
|
+
|
|
12
13
|
from ._BaseGenAI import BaseGenAI
|
|
13
14
|
|
|
14
15
|
"""Functions & Classes"""
|
|
@@ -55,6 +56,7 @@ class OpenAI(BaseGenAI):
|
|
|
55
56
|
model=model,
|
|
56
57
|
api_key=api_key,
|
|
57
58
|
stream=stream,
|
|
59
|
+
seed=seed,
|
|
58
60
|
n_keep=n_keep,
|
|
59
61
|
temperature=temperature,
|
|
60
62
|
provider="OpenAI",
|
|
@@ -148,7 +150,7 @@ class OpenAI(BaseGenAI):
|
|
|
148
150
|
if any(char in ".!?\n " for char in current_text):
|
|
149
151
|
yield buffer
|
|
150
152
|
buffer = ""
|
|
151
|
-
except Exception
|
|
153
|
+
except Exception:
|
|
152
154
|
pass
|
|
153
155
|
|
|
154
156
|
# Yield any remaining text
|
|
@@ -216,6 +218,7 @@ if __name__ == "__main__":
|
|
|
216
218
|
import sys
|
|
217
219
|
|
|
218
220
|
import matplotlib.pyplot as plt
|
|
221
|
+
|
|
219
222
|
import scitex
|
|
220
223
|
|
|
221
224
|
CONFIG, sys.stdout, sys.stderr, plt, CC = scitex.session.start(
|