scitex 2.5.0__py3-none-any.whl → 2.7.3__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 +25 -10
- scitex/__main__.py +2 -1
- scitex/__version__.py +1 -1
- scitex/_optional_deps.py +13 -20
- scitex/ai/__init__.py +5 -0
- scitex/ai/_gen_ai/_Anthropic.py +3 -1
- scitex/ai/_gen_ai/_BaseGenAI.py +3 -2
- scitex/ai/_gen_ai/_DeepSeek.py +1 -1
- scitex/ai/_gen_ai/_Google.py +3 -2
- scitex/ai/_gen_ai/_Llama.py +4 -2
- scitex/ai/_gen_ai/_OpenAI.py +3 -1
- scitex/ai/_gen_ai/_PARAMS.py +1 -0
- scitex/ai/_gen_ai/_Perplexity.py +3 -1
- scitex/ai/_gen_ai/__init__.py +1 -0
- scitex/ai/_gen_ai/_format_output_func.py +3 -1
- scitex/ai/classification/CrossValidationExperiment.py +8 -14
- scitex/ai/classification/examples/timeseries_cv_demo.py +128 -112
- scitex/ai/classification/reporters/_BaseClassificationReporter.py +2 -0
- scitex/ai/classification/reporters/_ClassificationReporter.py +30 -45
- scitex/ai/classification/reporters/_MultiClassificationReporter.py +8 -11
- scitex/ai/classification/reporters/_SingleClassificationReporter.py +126 -182
- scitex/ai/classification/reporters/__init__.py +1 -1
- scitex/ai/classification/reporters/reporter_utils/_Plotter.py +213 -119
- scitex/ai/classification/reporters/reporter_utils/__init__.py +28 -36
- scitex/ai/classification/reporters/reporter_utils/aggregation.py +125 -143
- scitex/ai/classification/reporters/reporter_utils/data_models.py +128 -120
- scitex/ai/classification/reporters/reporter_utils/reporting.py +507 -340
- scitex/ai/classification/reporters/reporter_utils/storage.py +4 -1
- scitex/ai/classification/reporters/reporter_utils/validation.py +141 -154
- scitex/ai/classification/timeseries/_TimeSeriesBlockingSplit.py +204 -129
- scitex/ai/classification/timeseries/_TimeSeriesCalendarSplit.py +215 -171
- scitex/ai/classification/timeseries/_TimeSeriesMetadata.py +17 -17
- scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit.py +67 -143
- scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit_v01-not-using-n_splits.py +67 -143
- scitex/ai/classification/timeseries/_TimeSeriesStrategy.py +12 -13
- scitex/ai/classification/timeseries/_TimeSeriesStratifiedSplit.py +231 -144
- scitex/ai/classification/timeseries/__init__.py +2 -4
- scitex/ai/classification/timeseries/_normalize_timestamp.py +3 -0
- scitex/ai/clustering/_pca.py +0 -1
- scitex/ai/clustering/_umap.py +1 -2
- scitex/ai/feature_extraction/__init__.py +10 -8
- scitex/ai/feature_extraction/vit.py +0 -1
- scitex/ai/feature_selection/feature_selection.py +3 -8
- scitex/ai/metrics/_calc_conf_mat.py +2 -0
- scitex/ai/metrics/_calc_feature_importance.py +3 -7
- scitex/ai/metrics/_calc_pre_rec_auc.py +5 -5
- scitex/ai/metrics/_calc_roc_auc.py +4 -2
- scitex/ai/metrics/_calc_seizure_prediction_metrics.py +35 -20
- scitex/ai/metrics/_calc_silhouette_score.py +1 -3
- scitex/ai/optim/Ranger_Deep_Learning_Optimizer/ranger/ranger.py +0 -3
- scitex/ai/optim/Ranger_Deep_Learning_Optimizer/ranger/ranger2020.py +0 -3
- scitex/ai/optim/Ranger_Deep_Learning_Optimizer/ranger/ranger913A.py +0 -3
- scitex/ai/optim/_optimizers.py +1 -1
- scitex/ai/plt/__init__.py +6 -1
- scitex/ai/plt/_plot_feature_importance.py +1 -3
- scitex/ai/plt/_plot_learning_curve.py +9 -24
- scitex/ai/plt/_plot_optuna_study.py +4 -3
- scitex/ai/plt/_plot_pre_rec_curve.py +9 -15
- scitex/ai/plt/_plot_roc_curve.py +6 -8
- scitex/ai/plt/_stx_conf_mat.py +121 -122
- scitex/ai/sampling/undersample.py +3 -2
- scitex/ai/sklearn/__init__.py +2 -2
- scitex/ai/training/_LearningCurveLogger.py +23 -10
- scitex/ai/utils/_check_params.py +0 -1
- scitex/audio/README.md +52 -0
- scitex/audio/__init__.py +384 -0
- scitex/audio/__main__.py +129 -0
- scitex/audio/_tts.py +334 -0
- scitex/audio/engines/__init__.py +44 -0
- scitex/audio/engines/base.py +275 -0
- scitex/audio/engines/elevenlabs_engine.py +143 -0
- scitex/audio/engines/gtts_engine.py +162 -0
- scitex/audio/engines/pyttsx3_engine.py +131 -0
- scitex/audio/mcp_server.py +757 -0
- scitex/benchmark/__init__.py +15 -25
- scitex/benchmark/benchmark.py +124 -117
- scitex/benchmark/monitor.py +117 -107
- scitex/benchmark/profiler.py +61 -58
- scitex/bridge/__init__.py +110 -0
- scitex/bridge/_helpers.py +149 -0
- scitex/bridge/_plt_vis.py +529 -0
- scitex/bridge/_protocol.py +283 -0
- scitex/bridge/_stats_plt.py +261 -0
- scitex/bridge/_stats_vis.py +265 -0
- scitex/browser/__init__.py +0 -2
- scitex/browser/auth/__init__.py +0 -0
- scitex/browser/auth/google.py +16 -11
- scitex/browser/automation/CookieHandler.py +2 -3
- scitex/browser/collaboration/__init__.py +3 -0
- scitex/browser/collaboration/auth_helpers.py +3 -1
- scitex/browser/collaboration/collaborative_agent.py +2 -0
- scitex/browser/collaboration/interactive_panel.py +2 -2
- scitex/browser/collaboration/shared_session.py +20 -11
- scitex/browser/collaboration/standard_interactions.py +1 -0
- scitex/browser/core/BrowserMixin.py +12 -30
- scitex/browser/core/ChromeProfileManager.py +9 -24
- scitex/browser/debugging/_browser_logger.py +15 -25
- scitex/browser/debugging/_failure_capture.py +9 -2
- scitex/browser/debugging/_highlight_element.py +15 -6
- scitex/browser/debugging/_show_grid.py +5 -6
- scitex/browser/debugging/_sync_session.py +4 -3
- scitex/browser/debugging/_test_monitor.py +14 -5
- scitex/browser/debugging/_visual_cursor.py +46 -35
- scitex/browser/interaction/click_center.py +4 -3
- scitex/browser/interaction/click_with_fallbacks.py +7 -10
- scitex/browser/interaction/close_popups.py +79 -66
- scitex/browser/interaction/fill_with_fallbacks.py +8 -8
- scitex/browser/pdf/__init__.py +3 -1
- scitex/browser/pdf/click_download_for_chrome_pdf_viewer.py +11 -10
- scitex/browser/pdf/detect_chrome_pdf_viewer.py +3 -6
- scitex/browser/remote/CaptchaHandler.py +109 -96
- scitex/browser/remote/ZenRowsAPIClient.py +91 -97
- scitex/browser/remote/ZenRowsBrowserManager.py +138 -112
- scitex/browser/stealth/HumanBehavior.py +4 -9
- scitex/browser/stealth/StealthManager.py +11 -26
- scitex/capture/__init__.py +17 -17
- scitex/capture/__main__.py +2 -3
- scitex/capture/capture.py +23 -51
- scitex/capture/cli.py +14 -39
- scitex/capture/gif.py +5 -9
- scitex/capture/mcp_server.py +7 -20
- scitex/capture/session.py +4 -3
- scitex/capture/utils.py +18 -53
- scitex/cli/__init__.py +1 -1
- scitex/cli/cloud.py +158 -116
- scitex/cli/config.py +224 -0
- scitex/cli/main.py +41 -40
- scitex/cli/scholar.py +60 -27
- scitex/cli/security.py +14 -20
- scitex/cli/web.py +87 -90
- scitex/cli/writer.py +51 -45
- scitex/cloud/__init__.py +14 -11
- scitex/cloud/_matplotlib_hook.py +6 -6
- scitex/config/README.md +313 -0
- scitex/config/{PriorityConfig.py → _PriorityConfig.py} +114 -17
- scitex/config/_ScitexConfig.py +319 -0
- scitex/config/__init__.py +41 -9
- scitex/config/_paths.py +325 -0
- scitex/config/default.yaml +81 -0
- scitex/context/_suppress_output.py +2 -3
- scitex/db/_BaseMixins/_BaseBackupMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseBatchMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseBlobMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseImportExportMixin.py +1 -3
- scitex/db/_BaseMixins/_BaseIndexMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseMaintenanceMixin.py +1 -3
- scitex/db/_BaseMixins/_BaseQueryMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseRowMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseTableMixin.py +3 -1
- scitex/db/_BaseMixins/_BaseTransactionMixin.py +1 -3
- scitex/db/_BaseMixins/__init__.py +1 -1
- scitex/db/__init__.py +9 -1
- scitex/db/__main__.py +8 -21
- scitex/db/_check_health.py +15 -31
- scitex/db/_delete_duplicates.py +7 -4
- scitex/db/_inspect.py +22 -38
- scitex/db/_inspect_optimized.py +89 -85
- scitex/db/_postgresql/_PostgreSQL.py +0 -1
- scitex/db/_postgresql/_PostgreSQLMixins/_BlobMixin.py +3 -1
- scitex/db/_postgresql/_PostgreSQLMixins/_ConnectionMixin.py +1 -3
- scitex/db/_postgresql/_PostgreSQLMixins/_ImportExportMixin.py +1 -3
- scitex/db/_postgresql/_PostgreSQLMixins/_MaintenanceMixin.py +1 -4
- scitex/db/_postgresql/_PostgreSQLMixins/_QueryMixin.py +3 -3
- scitex/db/_postgresql/_PostgreSQLMixins/_RowMixin.py +3 -1
- scitex/db/_postgresql/_PostgreSQLMixins/_TransactionMixin.py +1 -3
- scitex/db/_postgresql/__init__.py +1 -1
- scitex/db/_sqlite3/_SQLite3.py +2 -4
- scitex/db/_sqlite3/_SQLite3Mixins/_ArrayMixin.py +11 -12
- scitex/db/_sqlite3/_SQLite3Mixins/_ArrayMixin_v01-need-_hash-col.py +19 -14
- scitex/db/_sqlite3/_SQLite3Mixins/_BatchMixin.py +3 -1
- scitex/db/_sqlite3/_SQLite3Mixins/_BlobMixin.py +7 -7
- scitex/db/_sqlite3/_SQLite3Mixins/_ColumnMixin.py +118 -111
- scitex/db/_sqlite3/_SQLite3Mixins/_ConnectionMixin.py +8 -10
- scitex/db/_sqlite3/_SQLite3Mixins/_GitMixin.py +17 -45
- scitex/db/_sqlite3/_SQLite3Mixins/_ImportExportMixin.py +1 -3
- scitex/db/_sqlite3/_SQLite3Mixins/_IndexMixin.py +3 -1
- scitex/db/_sqlite3/_SQLite3Mixins/_QueryMixin.py +3 -4
- scitex/db/_sqlite3/_SQLite3Mixins/_RowMixin.py +9 -9
- scitex/db/_sqlite3/_SQLite3Mixins/_TableMixin.py +18 -11
- scitex/db/_sqlite3/_SQLite3Mixins/__init__.py +1 -0
- scitex/db/_sqlite3/__init__.py +1 -1
- scitex/db/_sqlite3/_delete_duplicates.py +13 -11
- scitex/decorators/__init__.py +29 -4
- scitex/decorators/_auto_order.py +43 -43
- scitex/decorators/_batch_fn.py +12 -6
- scitex/decorators/_cache_disk.py +8 -9
- scitex/decorators/_cache_disk_async.py +8 -7
- scitex/decorators/_combined.py +19 -13
- scitex/decorators/_converters.py +16 -3
- scitex/decorators/_deprecated.py +32 -22
- scitex/decorators/_numpy_fn.py +18 -4
- scitex/decorators/_pandas_fn.py +17 -5
- scitex/decorators/_signal_fn.py +17 -3
- scitex/decorators/_torch_fn.py +32 -15
- scitex/decorators/_xarray_fn.py +23 -9
- scitex/dev/_analyze_code_flow.py +0 -2
- scitex/dev/plt/__init__.py +272 -0
- scitex/dev/plt/plot_mpl_axhline.py +28 -0
- scitex/dev/plt/plot_mpl_axhspan.py +28 -0
- scitex/dev/plt/plot_mpl_axvline.py +28 -0
- scitex/dev/plt/plot_mpl_axvspan.py +28 -0
- scitex/dev/plt/plot_mpl_bar.py +29 -0
- scitex/dev/plt/plot_mpl_barh.py +29 -0
- scitex/dev/plt/plot_mpl_boxplot.py +28 -0
- scitex/dev/plt/plot_mpl_contour.py +31 -0
- scitex/dev/plt/plot_mpl_contourf.py +31 -0
- scitex/dev/plt/plot_mpl_errorbar.py +30 -0
- scitex/dev/plt/plot_mpl_eventplot.py +28 -0
- scitex/dev/plt/plot_mpl_fill.py +30 -0
- scitex/dev/plt/plot_mpl_fill_between.py +31 -0
- scitex/dev/plt/plot_mpl_hexbin.py +28 -0
- scitex/dev/plt/plot_mpl_hist.py +28 -0
- scitex/dev/plt/plot_mpl_hist2d.py +28 -0
- scitex/dev/plt/plot_mpl_imshow.py +29 -0
- scitex/dev/plt/plot_mpl_pcolormesh.py +31 -0
- scitex/dev/plt/plot_mpl_pie.py +29 -0
- scitex/dev/plt/plot_mpl_plot.py +29 -0
- scitex/dev/plt/plot_mpl_quiver.py +31 -0
- scitex/dev/plt/plot_mpl_scatter.py +28 -0
- scitex/dev/plt/plot_mpl_stackplot.py +31 -0
- scitex/dev/plt/plot_mpl_stem.py +29 -0
- scitex/dev/plt/plot_mpl_step.py +29 -0
- scitex/dev/plt/plot_mpl_violinplot.py +28 -0
- scitex/dev/plt/plot_sns_barplot.py +29 -0
- scitex/dev/plt/plot_sns_boxplot.py +29 -0
- scitex/dev/plt/plot_sns_heatmap.py +28 -0
- scitex/dev/plt/plot_sns_histplot.py +29 -0
- scitex/dev/plt/plot_sns_kdeplot.py +29 -0
- scitex/dev/plt/plot_sns_lineplot.py +31 -0
- scitex/dev/plt/plot_sns_scatterplot.py +29 -0
- scitex/dev/plt/plot_sns_stripplot.py +29 -0
- scitex/dev/plt/plot_sns_swarmplot.py +29 -0
- scitex/dev/plt/plot_sns_violinplot.py +29 -0
- scitex/dev/plt/plot_stx_bar.py +29 -0
- scitex/dev/plt/plot_stx_barh.py +29 -0
- scitex/dev/plt/plot_stx_box.py +28 -0
- scitex/dev/plt/plot_stx_boxplot.py +28 -0
- scitex/dev/plt/plot_stx_conf_mat.py +28 -0
- scitex/dev/plt/plot_stx_contour.py +31 -0
- scitex/dev/plt/plot_stx_ecdf.py +28 -0
- scitex/dev/plt/plot_stx_errorbar.py +30 -0
- scitex/dev/plt/plot_stx_fill_between.py +31 -0
- scitex/dev/plt/plot_stx_fillv.py +28 -0
- scitex/dev/plt/plot_stx_heatmap.py +28 -0
- scitex/dev/plt/plot_stx_image.py +28 -0
- scitex/dev/plt/plot_stx_imshow.py +28 -0
- scitex/dev/plt/plot_stx_joyplot.py +28 -0
- scitex/dev/plt/plot_stx_kde.py +28 -0
- scitex/dev/plt/plot_stx_line.py +28 -0
- scitex/dev/plt/plot_stx_mean_ci.py +28 -0
- scitex/dev/plt/plot_stx_mean_std.py +28 -0
- scitex/dev/plt/plot_stx_median_iqr.py +28 -0
- scitex/dev/plt/plot_stx_raster.py +28 -0
- scitex/dev/plt/plot_stx_rectangle.py +28 -0
- scitex/dev/plt/plot_stx_scatter.py +29 -0
- scitex/dev/plt/plot_stx_shaded_line.py +29 -0
- scitex/dev/plt/plot_stx_violin.py +28 -0
- scitex/dev/plt/plot_stx_violinplot.py +28 -0
- scitex/dict/_DotDict.py +15 -19
- scitex/dict/_flatten.py +1 -0
- scitex/dict/_listed_dict.py +1 -0
- scitex/dict/_pop_keys.py +1 -0
- scitex/dict/_replace.py +1 -0
- scitex/dict/_safe_merge.py +1 -0
- scitex/dict/_to_str.py +2 -3
- scitex/dsp/__init__.py +13 -4
- scitex/dsp/_crop.py +3 -1
- scitex/dsp/_detect_ripples.py +3 -1
- scitex/dsp/_modulation_index.py +3 -1
- scitex/dsp/_time.py +3 -1
- scitex/dsp/_wavelet.py +0 -1
- scitex/dsp/example.py +0 -5
- scitex/dsp/filt.py +4 -0
- scitex/dsp/utils/__init__.py +4 -1
- scitex/dsp/utils/pac.py +3 -3
- scitex/dt/_normalize_timestamp.py +4 -1
- scitex/errors.py +3 -6
- scitex/etc/__init__.py +1 -1
- scitex/fig/__init__.py +352 -0
- scitex/{vis → fig}/backend/__init__.py +3 -3
- scitex/{vis/backend/export.py → fig/backend/_export.py} +1 -1
- scitex/{vis/backend/parser.py → fig/backend/_parser.py} +2 -4
- scitex/{vis/backend/render.py → fig/backend/_render.py} +1 -1
- scitex/{vis → fig}/canvas.py +16 -4
- scitex/{vis → fig}/editor/__init__.py +0 -0
- scitex/{vis → fig}/editor/_dearpygui_editor.py +450 -304
- scitex/fig/editor/_defaults.py +300 -0
- scitex/fig/editor/_edit.py +751 -0
- scitex/{vis → fig}/editor/_flask_editor.py +8 -8
- scitex/{vis → fig}/editor/_mpl_editor.py +63 -48
- scitex/{vis → fig}/editor/_qt_editor.py +391 -160
- scitex/{vis → fig}/editor/_tkinter_editor.py +146 -89
- scitex/fig/editor/flask_editor/__init__.py +21 -0
- scitex/fig/editor/flask_editor/_bbox.py +1276 -0
- scitex/fig/editor/flask_editor/_core.py +624 -0
- scitex/fig/editor/flask_editor/_plotter.py +601 -0
- scitex/fig/editor/flask_editor/_renderer.py +739 -0
- scitex/{vis/editor/flask_editor/utils.py → fig/editor/flask_editor/_utils.py} +13 -14
- scitex/{vis → fig}/editor/flask_editor/templates/__init__.py +6 -6
- scitex/fig/editor/flask_editor/templates/_html.py +834 -0
- scitex/fig/editor/flask_editor/templates/_scripts.py +3136 -0
- scitex/fig/editor/flask_editor/templates/_styles.py +1346 -0
- scitex/{vis → fig}/io/__init__.py +18 -6
- scitex/fig/io/_bundle.py +973 -0
- scitex/{vis/io/canvas.py → fig/io/_canvas.py} +9 -5
- scitex/{vis/io/data.py → fig/io/_data.py} +14 -10
- scitex/{vis/io/directory.py → fig/io/_directory.py} +7 -4
- scitex/{vis/io/export.py → fig/io/_export.py} +16 -13
- scitex/{vis/io/load.py → fig/io/_load.py} +2 -2
- scitex/{vis/io/panel.py → fig/io/_panel.py} +22 -14
- scitex/{vis/io/save.py → fig/io/_save.py} +1 -1
- scitex/{vis → fig}/model/__init__.py +8 -8
- scitex/{vis/model/annotations.py → fig/model/_annotations.py} +3 -5
- scitex/{vis/model/axes.py → fig/model/_axes.py} +2 -2
- scitex/{vis/model/figure.py → fig/model/_figure.py} +1 -1
- scitex/{vis/model/guides.py → fig/model/_guides.py} +2 -2
- scitex/{vis/model/plot.py → fig/model/_plot.py} +3 -5
- scitex/{vis/model/plot_types.py → fig/model/_plot_types.py} +0 -0
- scitex/{vis/model/styles.py → fig/model/_styles.py} +1 -1
- scitex/{vis → fig}/utils/__init__.py +3 -3
- scitex/{vis/utils/defaults.py → fig/utils/_defaults.py} +1 -2
- scitex/{vis/utils/validate.py → fig/utils/_validate.py} +3 -9
- scitex/gen/_DimHandler.py +6 -6
- scitex/gen/__init__.py +5 -1
- scitex/gen/_deprecated_close.py +1 -0
- scitex/gen/_deprecated_start.py +5 -3
- scitex/gen/_detect_environment.py +44 -41
- scitex/gen/_detect_notebook_path.py +51 -47
- scitex/gen/_embed.py +1 -1
- scitex/gen/_get_notebook_path.py +81 -62
- scitex/gen/_inspect_module.py +0 -1
- scitex/gen/_norm.py +16 -7
- scitex/gen/_norm_cache.py +78 -65
- scitex/gen/_print_config.py +0 -3
- scitex/gen/_src.py +2 -3
- scitex/gen/_title_case.py +3 -2
- scitex/gen/_to_even.py +8 -8
- scitex/gen/_transpose.py +3 -3
- scitex/gen/misc.py +0 -3
- scitex/gists/_SigMacro_processFigure_S.py +2 -2
- scitex/gists/_SigMacro_toBlue.py +2 -2
- scitex/gists/__init__.py +4 -1
- scitex/git/_branch.py +19 -11
- scitex/git/_clone.py +23 -15
- scitex/git/_commit.py +10 -12
- scitex/git/_init.py +15 -38
- scitex/git/_remote.py +9 -3
- scitex/git/_result.py +3 -0
- scitex/git/_retry.py +2 -5
- scitex/git/_types.py +4 -0
- scitex/git/_validation.py +8 -8
- scitex/git/_workflow.py +4 -4
- scitex/io/__init__.py +12 -27
- scitex/io/_bundle.py +434 -0
- scitex/io/_flush.py +5 -2
- scitex/io/_glob.py +2 -2
- scitex/io/_json2md.py +3 -3
- scitex/io/_load.py +104 -8
- scitex/io/_load_cache.py +71 -71
- scitex/io/_load_configs.py +2 -3
- scitex/io/_load_modules/_H5Explorer.py +11 -14
- scitex/io/_load_modules/_ZarrExplorer.py +3 -3
- scitex/io/_load_modules/_bibtex.py +62 -63
- scitex/io/_load_modules/_canvas.py +6 -11
- scitex/io/_load_modules/_catboost.py +7 -2
- scitex/io/_load_modules/_hdf5.py +2 -0
- scitex/io/_load_modules/_image.py +7 -4
- scitex/io/_load_modules/_matlab.py +3 -1
- scitex/io/_load_modules/_optuna.py +0 -1
- scitex/io/_load_modules/_pdf.py +38 -29
- scitex/io/_load_modules/_sqlite3.py +1 -0
- scitex/io/_load_modules/_txt.py +6 -2
- scitex/io/_load_modules/_xml.py +9 -9
- scitex/io/_load_modules/_zarr.py +12 -10
- scitex/io/_metadata.py +34 -285
- scitex/io/_metadata_modules/__init__.py +46 -0
- scitex/io/_metadata_modules/_embed.py +70 -0
- scitex/io/_metadata_modules/_read.py +64 -0
- scitex/io/_metadata_modules/_utils.py +79 -0
- scitex/io/_metadata_modules/embed_metadata_jpeg.py +74 -0
- scitex/io/_metadata_modules/embed_metadata_pdf.py +53 -0
- scitex/io/_metadata_modules/embed_metadata_png.py +26 -0
- scitex/io/_metadata_modules/embed_metadata_svg.py +62 -0
- scitex/io/_metadata_modules/read_metadata_jpeg.py +57 -0
- scitex/io/_metadata_modules/read_metadata_pdf.py +51 -0
- scitex/io/_metadata_modules/read_metadata_png.py +39 -0
- scitex/io/_metadata_modules/read_metadata_svg.py +44 -0
- scitex/io/_qr_utils.py +21 -14
- scitex/io/_save.py +755 -80
- scitex/io/_save_modules/__init__.py +7 -2
- scitex/io/_save_modules/_bibtex.py +66 -61
- scitex/io/_save_modules/_canvas.py +8 -9
- scitex/io/_save_modules/_catboost.py +2 -2
- scitex/io/_save_modules/_csv.py +4 -4
- scitex/io/_save_modules/_excel.py +5 -9
- scitex/io/_save_modules/_hdf5.py +9 -21
- scitex/io/_save_modules/_html.py +5 -5
- scitex/io/_save_modules/_image.py +107 -14
- scitex/io/_save_modules/_joblib.py +2 -2
- scitex/io/_save_modules/_json.py +51 -6
- scitex/io/_save_modules/_listed_dfs_as_csv.py +2 -1
- scitex/io/_save_modules/_listed_scalars_as_csv.py +2 -1
- scitex/io/_save_modules/_matlab.py +2 -2
- scitex/io/_save_modules/_numpy.py +6 -8
- scitex/io/_save_modules/_pickle.py +4 -4
- scitex/io/_save_modules/_plotly.py +3 -3
- scitex/io/_save_modules/_tex.py +30 -29
- scitex/io/_save_modules/_text.py +2 -2
- scitex/io/_save_modules/_yaml.py +9 -9
- scitex/io/_save_modules/_zarr.py +15 -15
- scitex/io/utils/__init__.py +2 -1
- scitex/io/utils/h5_to_zarr.py +183 -163
- scitex/linalg/__init__.py +1 -1
- scitex/linalg/_geometric_median.py +4 -3
- scitex/logging/_Tee.py +5 -7
- scitex/logging/__init__.py +18 -19
- scitex/logging/_config.py +4 -1
- scitex/logging/_context.py +6 -5
- scitex/logging/_formatters.py +2 -3
- scitex/logging/_handlers.py +19 -20
- scitex/logging/_levels.py +9 -17
- scitex/logging/_logger.py +74 -15
- scitex/logging/_print_capture.py +17 -17
- scitex/msword/__init__.py +255 -0
- scitex/msword/profiles.py +357 -0
- scitex/msword/reader.py +753 -0
- scitex/msword/utils.py +289 -0
- scitex/msword/writer.py +362 -0
- scitex/nn/_BNet.py +1 -3
- scitex/nn/_Filters.py +6 -2
- scitex/nn/_ModulationIndex.py +3 -1
- scitex/nn/_PAC.py +3 -2
- scitex/nn/_PSD.py +0 -1
- scitex/nn/__init__.py +16 -3
- scitex/path/_clean.py +10 -8
- scitex/path/_find.py +1 -1
- scitex/path/_get_spath.py +1 -2
- scitex/path/_mk_spath.py +1 -1
- scitex/path/_symlink.py +5 -10
- scitex/pd/__init__.py +4 -1
- scitex/pd/_force_df.py +24 -24
- scitex/pd/_get_unique.py +1 -0
- scitex/pd/_merge_columns.py +1 -1
- scitex/pd/_round.py +11 -7
- scitex/pd/_to_xy.py +0 -1
- scitex/plt/__init__.py +190 -89
- scitex/plt/_subplots/_AxesWrapper.py +28 -12
- scitex/plt/_subplots/_AxisWrapper.py +114 -47
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +36 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +264 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +213 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +128 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +59 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +34 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +593 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +654 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +527 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +321 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +33 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +152 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +600 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_TrackingMixin.py +26 -14
- scitex/plt/_subplots/_AxisWrapperMixins/_UnitAwareMixin.py +80 -73
- scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +79 -5
- scitex/plt/_subplots/_FigWrapper.py +97 -64
- scitex/plt/_subplots/_SubplotsWrapper.py +161 -84
- scitex/plt/_subplots/__init__.py +10 -0
- scitex/plt/_subplots/_export_as_csv.py +124 -52
- scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +9 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_annotate.py +14 -23
- scitex/plt/_subplots/_export_as_csv_formatters/_format_bar.py +88 -38
- scitex/plt/_subplots/_export_as_csv_formatters/_format_barh.py +25 -31
- scitex/plt/_subplots/_export_as_csv_formatters/_format_boxplot.py +53 -23
- scitex/plt/_subplots/_export_as_csv_formatters/_format_contour.py +38 -25
- scitex/plt/_subplots/_export_as_csv_formatters/_format_contourf.py +17 -9
- scitex/plt/_subplots/_export_as_csv_formatters/_format_errorbar.py +70 -124
- scitex/plt/_subplots/_export_as_csv_formatters/_format_eventplot.py +30 -17
- scitex/plt/_subplots/_export_as_csv_formatters/_format_fill.py +31 -17
- scitex/plt/_subplots/_export_as_csv_formatters/_format_fill_between.py +33 -21
- scitex/plt/_subplots/_export_as_csv_formatters/_format_hexbin.py +14 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_hist.py +43 -29
- scitex/plt/_subplots/_export_as_csv_formatters/_format_hist2d.py +14 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow.py +27 -11
- scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py +34 -16
- scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py +16 -8
- scitex/plt/_subplots/_export_as_csv_formatters/_format_pie.py +15 -6
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot.py +85 -46
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_box.py +52 -27
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_imshow.py +14 -1
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_kde.py +27 -18
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_scatter.py +14 -5
- scitex/plt/_subplots/_export_as_csv_formatters/_format_quiver.py +16 -8
- scitex/plt/_subplots/_export_as_csv_formatters/_format_scatter.py +17 -6
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_barplot.py +43 -26
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_boxplot.py +68 -47
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_heatmap.py +52 -64
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_histplot.py +55 -50
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_jointplot.py +23 -10
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_kdeplot.py +63 -29
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_lineplot.py +48 -40
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_pairplot.py +20 -6
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_scatterplot.py +44 -40
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_stripplot.py +46 -39
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_swarmplot.py +46 -39
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_violinplot.py +75 -94
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stem.py +12 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_step.py +12 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_streamplot.py +17 -9
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +84 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +85 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_conf_mat.py +31 -18
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_contour.py +54 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_ecdf.py +24 -11
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +120 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_fillv.py +35 -31
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_heatmap.py +33 -23
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_image.py +44 -28
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_imshow.py +63 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_joyplot.py +31 -12
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_line.py +34 -23
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py +32 -26
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py +29 -23
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py +32 -26
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_raster.py +21 -11
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_rectangle.py +84 -56
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +51 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter_hist.py +46 -34
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_shaded_line.py +46 -30
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_violin.py +51 -51
- scitex/plt/_subplots/_export_as_csv_formatters/_format_text.py +32 -31
- scitex/plt/_subplots/_export_as_csv_formatters/_format_violin.py +34 -31
- scitex/plt/_subplots/_export_as_csv_formatters/_format_violinplot.py +44 -37
- scitex/plt/_subplots/_export_as_csv_formatters/verify_formatters.py +91 -74
- scitex/plt/_tpl.py +6 -5
- scitex/plt/ax/_plot/__init__.py +24 -0
- scitex/plt/ax/_plot/_add_fitted_line.py +12 -11
- scitex/plt/ax/_plot/_plot_circular_hist.py +3 -1
- scitex/plt/ax/_plot/_plot_statistical_shaded_line.py +25 -19
- scitex/plt/ax/_plot/_stx_conf_mat.py +6 -3
- scitex/plt/ax/_plot/_stx_ecdf.py +9 -5
- scitex/plt/ax/_plot/_stx_fillv.py +4 -2
- scitex/plt/ax/_plot/_stx_heatmap.py +7 -4
- scitex/plt/ax/_plot/_stx_image.py +7 -5
- scitex/plt/ax/_plot/_stx_joyplot.py +32 -10
- scitex/plt/ax/_plot/_stx_raster.py +26 -11
- scitex/plt/ax/_plot/_stx_rectangle.py +2 -2
- scitex/plt/ax/_plot/_stx_shaded_line.py +15 -11
- scitex/plt/ax/_plot/_stx_violin.py +3 -1
- scitex/plt/ax/_style/_add_marginal_ax.py +6 -4
- scitex/plt/ax/_style/_auto_scale_axis.py +14 -10
- scitex/plt/ax/_style/_extend.py +3 -1
- scitex/plt/ax/_style/_force_aspect.py +5 -3
- scitex/plt/ax/_style/_format_units.py +2 -2
- scitex/plt/ax/_style/_hide_spines.py +5 -1
- scitex/plt/ax/_style/_map_ticks.py +5 -3
- scitex/plt/ax/_style/_rotate_labels.py +5 -4
- scitex/plt/ax/_style/_rotate_labels_v01.py +73 -63
- scitex/plt/ax/_style/_set_log_scale.py +120 -85
- scitex/plt/ax/_style/_set_meta.py +99 -76
- scitex/plt/ax/_style/_set_supxyt.py +33 -16
- scitex/plt/ax/_style/_set_xyt.py +27 -18
- scitex/plt/ax/_style/_share_axes.py +15 -5
- scitex/plt/ax/_style/_show_spines.py +58 -57
- scitex/plt/ax/_style/_style_barplot.py +1 -1
- scitex/plt/ax/_style/_style_boxplot.py +25 -14
- scitex/plt/ax/_style/_style_errorbar.py +0 -0
- scitex/plt/ax/_style/_style_scatter.py +1 -1
- scitex/plt/ax/_style/_style_suptitles.py +3 -3
- scitex/plt/ax/_style/_style_violinplot.py +8 -2
- scitex/plt/color/__init__.py +34 -2
- scitex/plt/color/_add_hue_col.py +1 -0
- scitex/plt/color/_colors.py +0 -1
- scitex/plt/color/_get_colors_from_conf_matap.py +3 -1
- scitex/plt/color/_vizualize_colors.py +0 -1
- scitex/plt/docs/FIGURE_ARCHITECTURE.md +155 -97
- scitex/plt/gallery/README.md +75 -0
- scitex/plt/gallery/__init__.py +29 -0
- scitex/plt/gallery/_generate.py +560 -0
- scitex/plt/gallery/_plots.py +594 -0
- scitex/plt/gallery/_registry.py +153 -0
- scitex/plt/io/__init__.py +53 -0
- scitex/plt/io/_bundle.py +490 -0
- scitex/plt/io/_layered_bundle.py +1343 -0
- scitex/plt/styles/SCITEX_STYLE.yaml +26 -0
- scitex/plt/styles/__init__.py +23 -9
- scitex/plt/styles/_plot_defaults.py +62 -61
- scitex/plt/styles/_plot_postprocess.py +126 -77
- scitex/plt/styles/_style_loader.py +0 -0
- scitex/plt/styles/presets.py +121 -18
- scitex/plt/utils/__init__.py +42 -3
- scitex/plt/utils/_close.py +8 -3
- scitex/plt/utils/_collect_figure_metadata.py +3033 -271
- scitex/plt/utils/_colorbar.py +15 -17
- scitex/plt/utils/_configure_mpl.py +26 -30
- scitex/plt/utils/_crop.py +87 -36
- scitex/plt/utils/_csv_column_naming.py +177 -72
- scitex/plt/utils/_dimension_viewer.py +7 -19
- scitex/plt/utils/_figure_from_axes_mm.py +70 -16
- scitex/plt/utils/_figure_mm.py +119 -3
- scitex/plt/utils/_get_actual_font.py +5 -4
- scitex/plt/utils/_histogram_utils.py +52 -48
- scitex/plt/utils/_hitmap.py +1643 -0
- scitex/plt/utils/_is_valid_axis.py +19 -13
- scitex/plt/utils/_mk_colorbar.py +3 -3
- scitex/plt/utils/_scientific_captions.py +202 -139
- scitex/plt/utils/_scitex_config.py +98 -98
- scitex/plt/utils/_units.py +0 -0
- scitex/plt/utils/metadata/__init__.py +61 -0
- scitex/plt/utils/metadata/_artist_extraction.py +119 -0
- scitex/plt/utils/metadata/_axes_metadata.py +93 -0
- scitex/plt/utils/metadata/_collection_artists.py +292 -0
- scitex/plt/utils/metadata/_core.py +207 -0
- scitex/plt/utils/metadata/_csv_column_extraction.py +186 -0
- scitex/plt/utils/metadata/_csv_hash.py +115 -0
- scitex/plt/utils/metadata/_csv_verification.py +95 -0
- scitex/plt/utils/metadata/_data_linkage.py +263 -0
- scitex/plt/utils/metadata/_dimensions.py +242 -0
- scitex/plt/utils/metadata/_editable_export.py +405 -0
- scitex/plt/utils/metadata/_figure_metadata.py +58 -0
- scitex/plt/utils/metadata/_geometry_extraction.py +570 -0
- scitex/plt/utils/metadata/_image_text_artists.py +168 -0
- scitex/plt/utils/metadata/_label_parsing.py +82 -0
- scitex/plt/utils/metadata/_legend_extraction.py +120 -0
- scitex/plt/utils/metadata/_line_artists.py +367 -0
- scitex/plt/utils/metadata/_line_semantic_handling.py +173 -0
- scitex/plt/utils/metadata/_patch_artists.py +211 -0
- scitex/plt/utils/metadata/_plot_content.py +26 -0
- scitex/plt/utils/metadata/_plot_type_detection.py +184 -0
- scitex/plt/utils/metadata/_precision.py +134 -0
- scitex/plt/utils/metadata/_precision_config.py +68 -0
- scitex/plt/utils/metadata/_precision_sections.py +211 -0
- scitex/plt/utils/metadata/_recipe_extraction.py +267 -0
- scitex/plt/utils/metadata/_style_parsing.py +174 -0
- scitex/repro/_RandomStateManager.py +33 -38
- scitex/repro/__init__.py +16 -7
- scitex/repro/_gen_ID.py +7 -9
- scitex/repro/_gen_timestamp.py +7 -6
- scitex/repro/_hash_array.py +8 -12
- scitex/reproduce/__init__.py +1 -1
- scitex/resource/_get_processor_usages.py +3 -1
- scitex/resource/_log_processor_usages.py +3 -1
- scitex/rng/__init__.py +1 -1
- scitex/schema/README.md +178 -0
- scitex/schema/__init__.py +237 -0
- scitex/schema/_canvas.py +444 -0
- scitex/schema/_plot.py +1015 -0
- scitex/schema/_stats.py +762 -0
- scitex/schema/_validation.py +590 -0
- scitex/scholar/.legacy/Scholar.py +5 -12
- scitex/scholar/.legacy/_Scholar.py +66 -99
- scitex/scholar/.legacy/_ScholarAPI.py +75 -66
- scitex/scholar/.legacy/_tmp/search_engine/_BaseSearchEngine.py +3 -3
- scitex/scholar/.legacy/_tmp/search_engine/_UnifiedSearcher.py +4 -9
- scitex/scholar/.legacy/_tmp/search_engine/__init__.py +14 -21
- scitex/scholar/.legacy/_tmp/search_engine/local/_LocalSearchEngine.py +40 -37
- scitex/scholar/.legacy/_tmp/search_engine/local/_VectorSearchEngine.py +31 -28
- scitex/scholar/.legacy/_tmp/search_engine/web/_ArxivSearchEngine.py +74 -65
- scitex/scholar/.legacy/_tmp/search_engine/web/_CrossRefSearchEngine.py +122 -116
- scitex/scholar/.legacy/_tmp/search_engine/web/_GoogleScholarSearchEngine.py +65 -59
- scitex/scholar/.legacy/_tmp/search_engine/web/_PubMedSearchEngine.py +121 -107
- scitex/scholar/.legacy/_tmp/search_engine/web/_SemanticScholarSearchEngine.py +5 -12
- scitex/scholar/.legacy/database/_DatabaseEntry.py +49 -45
- scitex/scholar/.legacy/database/_DatabaseIndex.py +131 -94
- scitex/scholar/.legacy/database/_LibraryManager.py +65 -63
- scitex/scholar/.legacy/database/_PaperDatabase.py +138 -124
- scitex/scholar/.legacy/database/_ScholarDatabaseIntegration.py +14 -36
- scitex/scholar/.legacy/database/_StorageIntegratedDB.py +192 -156
- scitex/scholar/.legacy/database/_ZoteroCompatibleDB.py +300 -237
- scitex/scholar/.legacy/database/__init__.py +2 -1
- scitex/scholar/.legacy/database/manage.py +92 -84
- scitex/scholar/.legacy/lookup/_LookupIndex.py +157 -101
- scitex/scholar/.legacy/lookup/__init__.py +2 -1
- scitex/scholar/.legacy/metadata/doi/batch/_MetadataHandlerForBatchDOIResolution.py +4 -9
- scitex/scholar/.legacy/metadata/doi/batch/_ProgressManagerForBatchDOIResolution.py +10 -23
- scitex/scholar/.legacy/metadata/doi/batch/_SourceStatsManagerForBatchDOIResolution.py +4 -9
- scitex/scholar/.legacy/metadata/doi/batch/__init__.py +3 -1
- scitex/scholar/.legacy/metadata/doi/resolvers/_BatchDOIResolver.py +10 -25
- scitex/scholar/.legacy/metadata/doi/resolvers/_BibTeXDOIResolver.py +19 -49
- scitex/scholar/.legacy/metadata/doi/resolvers/_DOIResolver.py +1 -0
- scitex/scholar/.legacy/metadata/doi/resolvers/_SingleDOIResolver.py +8 -20
- scitex/scholar/.legacy/metadata/doi/sources/.combined-SemanticScholarSource/_SemanticScholarSource.py +37 -35
- scitex/scholar/.legacy/metadata/doi/sources/.combined-SemanticScholarSource/_SemanticScholarSourceEnhanced.py +49 -37
- scitex/scholar/.legacy/metadata/doi/sources/_ArXivSource.py +11 -30
- scitex/scholar/.legacy/metadata/doi/sources/_BaseDOISource.py +19 -47
- scitex/scholar/.legacy/metadata/doi/sources/_CrossRefLocalSource.py +1 -0
- scitex/scholar/.legacy/metadata/doi/sources/_CrossRefSource.py +12 -33
- scitex/scholar/.legacy/metadata/doi/sources/_OpenAlexSource.py +8 -20
- scitex/scholar/.legacy/metadata/doi/sources/_PubMedSource.py +10 -27
- scitex/scholar/.legacy/metadata/doi/sources/_SemanticScholarSource.py +11 -29
- scitex/scholar/.legacy/metadata/doi/sources/_SourceManager.py +8 -21
- scitex/scholar/.legacy/metadata/doi/sources/_SourceResolutionStrategy.py +24 -55
- scitex/scholar/.legacy/metadata/doi/sources/_SourceRotationManager.py +8 -21
- scitex/scholar/.legacy/metadata/doi/sources/_URLDOISource.py +9 -16
- scitex/scholar/.legacy/metadata/doi/sources/_UnifiedSource.py +8 -22
- scitex/scholar/.legacy/metadata/doi/sources/__init__.py +1 -0
- scitex/scholar/.legacy/metadata/doi/utils/_PubMedConverter.py +4 -8
- scitex/scholar/.legacy/metadata/doi/utils/_RateLimitHandler.py +17 -43
- scitex/scholar/.legacy/metadata/doi/utils/_TextNormalizer.py +8 -18
- scitex/scholar/.legacy/metadata/doi/utils/_URLDOIExtractor.py +4 -8
- scitex/scholar/.legacy/metadata/doi/utils/__init__.py +1 -0
- scitex/scholar/.legacy/metadata/doi/utils/_to_complete_metadata_structure.py +1 -0
- scitex/scholar/.legacy/metadata/enrichment/_LibraryEnricher.py +2 -3
- scitex/scholar/.legacy/metadata/enrichment/enrichers/_ImpactFactorEnricher.py +6 -12
- scitex/scholar/.legacy/metadata/enrichment/enrichers/_SmartEnricher.py +5 -10
- scitex/scholar/.legacy/metadata/enrichment/sources/_UnifiedMetadataSource.py +4 -5
- scitex/scholar/.legacy/metadata/query_to_full_meta_json.py +8 -12
- scitex/scholar/.legacy/metadata/urls/_URLMetadataHandler.py +3 -3
- scitex/scholar/.legacy/metadata/urls/_ZoteroTranslatorRunner.py +15 -21
- scitex/scholar/.legacy/metadata/urls/__init__.py +3 -3
- scitex/scholar/.legacy/metadata/urls/_finder.py +4 -6
- scitex/scholar/.legacy/metadata/urls/_handler.py +7 -15
- scitex/scholar/.legacy/metadata/urls/_resolver.py +6 -12
- scitex/scholar/.legacy/search/_Embedder.py +74 -69
- scitex/scholar/.legacy/search/_SemanticSearch.py +91 -90
- scitex/scholar/.legacy/search/_SemanticSearchEngine.py +104 -109
- scitex/scholar/.legacy/search/_UnifiedSearcher.py +530 -471
- scitex/scholar/.legacy/search/_VectorDatabase.py +111 -92
- scitex/scholar/.legacy/search/__init__.py +1 -0
- scitex/scholar/.legacy/storage/_EnhancedStorageManager.py +182 -154
- scitex/scholar/.legacy/storage/__init__.py +2 -1
- scitex/scholar/__init__.py +0 -2
- scitex/scholar/__main__.py +1 -3
- scitex/scholar/auth/ScholarAuthManager.py +13 -36
- scitex/scholar/auth/core/AuthenticationGateway.py +15 -29
- scitex/scholar/auth/core/BrowserAuthenticator.py +22 -57
- scitex/scholar/auth/core/StrategyResolver.py +10 -27
- scitex/scholar/auth/core/__init__.py +5 -1
- scitex/scholar/auth/gateway/_OpenURLLinkFinder.py +11 -21
- scitex/scholar/auth/gateway/_OpenURLResolver.py +10 -18
- scitex/scholar/auth/gateway/_resolve_functions.py +3 -3
- scitex/scholar/auth/providers/BaseAuthenticator.py +1 -0
- scitex/scholar/auth/providers/EZProxyAuthenticator.py +7 -14
- scitex/scholar/auth/providers/OpenAthensAuthenticator.py +29 -57
- scitex/scholar/auth/providers/ShibbolethAuthenticator.py +87 -73
- scitex/scholar/auth/session/AuthCacheManager.py +12 -22
- scitex/scholar/auth/session/SessionManager.py +4 -6
- scitex/scholar/auth/sso/BaseSSOAutomator.py +13 -19
- scitex/scholar/auth/sso/OpenAthensSSOAutomator.py +16 -45
- scitex/scholar/auth/sso/SSOAutomator.py +8 -15
- scitex/scholar/auth/sso/UniversityOfMelbourneSSOAutomator.py +13 -23
- scitex/scholar/browser/ScholarBrowserManager.py +31 -56
- scitex/scholar/browser/__init__.py +1 -0
- scitex/scholar/browser/utils/click_and_wait.py +3 -4
- scitex/scholar/browser/utils/close_unwanted_pages.py +4 -7
- scitex/scholar/browser/utils/wait_redirects.py +15 -40
- scitex/scholar/citation_graph/__init__.py +0 -0
- scitex/scholar/citation_graph/builder.py +3 -7
- scitex/scholar/citation_graph/database.py +4 -11
- scitex/scholar/citation_graph/example.py +5 -10
- scitex/scholar/citation_graph/models.py +0 -0
- scitex/scholar/cli/_url_utils.py +1 -1
- scitex/scholar/cli/chrome.py +5 -3
- scitex/scholar/cli/download_pdf.py +13 -14
- scitex/scholar/cli/handlers/bibtex_handler.py +4 -12
- scitex/scholar/cli/handlers/doi_handler.py +1 -3
- scitex/scholar/cli/handlers/project_handler.py +6 -20
- scitex/scholar/cli/open_browser.py +41 -39
- scitex/scholar/cli/open_browser_auto.py +31 -39
- scitex/scholar/cli/open_browser_monitored.py +27 -24
- scitex/scholar/config/ScholarConfig.py +5 -8
- scitex/scholar/config/__init__.py +1 -0
- scitex/scholar/config/core/_CascadeConfig.py +3 -3
- scitex/scholar/config/core/_PathManager.py +16 -28
- scitex/scholar/core/Paper.py +79 -78
- scitex/scholar/core/Papers.py +16 -27
- scitex/scholar/core/Scholar.py +98 -229
- scitex/scholar/core/journal_normalizer.py +52 -49
- scitex/scholar/core/oa_cache.py +27 -23
- scitex/scholar/core/open_access.py +17 -8
- scitex/scholar/docs/template.py +4 -3
- scitex/scholar/docs/to_claude/examples/example-python-project-scitex/scripts/mnist/clf_svm.py +0 -0
- scitex/scholar/docs/to_claude/examples/example-python-project-scitex/scripts/mnist/download.py +0 -0
- scitex/scholar/docs/to_claude/examples/example-python-project-scitex/scripts/mnist/plot_conf_mat.py +0 -0
- scitex/scholar/docs/to_claude/examples/example-python-project-scitex/scripts/mnist/plot_digits.py +0 -0
- scitex/scholar/docs/to_claude/examples/example-python-project-scitex/scripts/mnist/plot_umap_space.py +0 -0
- scitex/scholar/examples/00_config.py +10 -9
- scitex/scholar/examples/01_auth.py +3 -0
- scitex/scholar/examples/02_browser.py +14 -10
- scitex/scholar/examples/03_01-engine.py +3 -0
- scitex/scholar/examples/03_02-engine-for-bibtex.py +4 -3
- scitex/scholar/examples/04_01-url.py +9 -9
- scitex/scholar/examples/04_02-url-for-bibtex.py +7 -3
- scitex/scholar/examples/04_02-url-for-dois.py +87 -97
- scitex/scholar/examples/05_download_pdf.py +10 -4
- scitex/scholar/examples/06_find_and_download.py +6 -6
- scitex/scholar/examples/06_parse_bibtex.py +17 -17
- scitex/scholar/examples/07_storage_integration.py +6 -9
- scitex/scholar/examples/99_fullpipeline-for-bibtex.py +14 -15
- scitex/scholar/examples/99_fullpipeline-for-one-entry.py +31 -23
- scitex/scholar/examples/99_maintenance.py +3 -0
- scitex/scholar/examples/dev.py +2 -3
- scitex/scholar/examples/zotero_integration.py +11 -18
- scitex/scholar/impact_factor/ImpactFactorEngine.py +7 -9
- scitex/scholar/impact_factor/estimation/__init__.py +4 -4
- scitex/scholar/impact_factor/estimation/core/__init__.py +3 -7
- scitex/scholar/impact_factor/estimation/core/cache_manager.py +223 -211
- scitex/scholar/impact_factor/estimation/core/calculator.py +165 -131
- scitex/scholar/impact_factor/estimation/core/journal_matcher.py +217 -172
- scitex/scholar/impact_factor/jcr/ImpactFactorJCREngine.py +6 -14
- scitex/scholar/impact_factor/jcr/build_database.py +4 -3
- scitex/scholar/integration/base.py +9 -17
- scitex/scholar/integration/mendeley/exporter.py +2 -4
- scitex/scholar/integration/mendeley/importer.py +3 -3
- scitex/scholar/integration/mendeley/linker.py +3 -3
- scitex/scholar/integration/mendeley/mapper.py +9 -6
- scitex/scholar/integration/zotero/__main__.py +26 -43
- scitex/scholar/integration/zotero/exporter.py +15 -11
- scitex/scholar/integration/zotero/importer.py +12 -10
- scitex/scholar/integration/zotero/linker.py +8 -12
- scitex/scholar/integration/zotero/mapper.py +17 -12
- scitex/scholar/metadata_engines/.combined-SemanticScholarSource/_SemanticScholarSource.py +37 -35
- scitex/scholar/metadata_engines/.combined-SemanticScholarSource/_SemanticScholarSourceEnhanced.py +47 -35
- scitex/scholar/metadata_engines/ScholarEngine.py +21 -43
- scitex/scholar/metadata_engines/__init__.py +1 -0
- scitex/scholar/metadata_engines/individual/ArXivEngine.py +15 -37
- scitex/scholar/metadata_engines/individual/CrossRefEngine.py +15 -42
- scitex/scholar/metadata_engines/individual/CrossRefLocalEngine.py +24 -45
- scitex/scholar/metadata_engines/individual/OpenAlexEngine.py +11 -21
- scitex/scholar/metadata_engines/individual/PubMedEngine.py +10 -27
- scitex/scholar/metadata_engines/individual/SemanticScholarEngine.py +28 -35
- scitex/scholar/metadata_engines/individual/URLDOIEngine.py +11 -22
- scitex/scholar/metadata_engines/individual/_BaseDOIEngine.py +20 -49
- scitex/scholar/metadata_engines/utils/_PubMedConverter.py +4 -8
- scitex/scholar/metadata_engines/utils/_URLDOIExtractor.py +5 -10
- scitex/scholar/metadata_engines/utils/__init__.py +2 -0
- scitex/scholar/metadata_engines/utils/_metadata2bibtex.py +3 -0
- scitex/scholar/metadata_engines/utils/_standardize_metadata.py +2 -3
- scitex/scholar/pdf_download/ScholarPDFDownloader.py +25 -37
- scitex/scholar/pdf_download/strategies/chrome_pdf_viewer.py +11 -19
- scitex/scholar/pdf_download/strategies/direct_download.py +5 -9
- scitex/scholar/pdf_download/strategies/manual_download_fallback.py +3 -3
- scitex/scholar/pdf_download/strategies/manual_download_utils.py +6 -13
- scitex/scholar/pdf_download/strategies/open_access_download.py +49 -31
- scitex/scholar/pdf_download/strategies/response_body.py +8 -19
- scitex/scholar/pipelines/ScholarPipelineBibTeX.py +9 -18
- scitex/scholar/pipelines/ScholarPipelineMetadataParallel.py +25 -26
- scitex/scholar/pipelines/ScholarPipelineMetadataSingle.py +62 -23
- scitex/scholar/pipelines/ScholarPipelineParallel.py +13 -30
- scitex/scholar/pipelines/ScholarPipelineSearchParallel.py +299 -220
- scitex/scholar/pipelines/ScholarPipelineSearchSingle.py +202 -165
- scitex/scholar/pipelines/ScholarPipelineSingle.py +25 -51
- scitex/scholar/pipelines/SearchQueryParser.py +55 -55
- scitex/scholar/search_engines/ScholarSearchEngine.py +31 -27
- scitex/scholar/search_engines/_BaseSearchEngine.py +20 -23
- scitex/scholar/search_engines/individual/ArXivSearchEngine.py +53 -35
- scitex/scholar/search_engines/individual/CrossRefSearchEngine.py +47 -40
- scitex/scholar/search_engines/individual/OpenAlexSearchEngine.py +55 -50
- scitex/scholar/search_engines/individual/PubMedSearchEngine.py +8 -10
- scitex/scholar/search_engines/individual/SemanticScholarSearchEngine.py +55 -49
- scitex/scholar/storage/BibTeXHandler.py +150 -95
- scitex/scholar/storage/PaperIO.py +3 -6
- scitex/scholar/storage/ScholarLibrary.py +70 -49
- scitex/scholar/storage/_DeduplicationManager.py +52 -25
- scitex/scholar/storage/_LibraryCacheManager.py +19 -46
- scitex/scholar/storage/_LibraryManager.py +65 -175
- scitex/scholar/url_finder/ScholarURLFinder.py +9 -25
- scitex/scholar/url_finder/strategies/find_pdf_urls_by_direct_links.py +1 -1
- scitex/scholar/url_finder/strategies/find_pdf_urls_by_href.py +6 -10
- scitex/scholar/url_finder/strategies/find_pdf_urls_by_navigation.py +4 -6
- scitex/scholar/url_finder/strategies/find_pdf_urls_by_publisher_patterns.py +8 -15
- scitex/scholar/url_finder/strategies/find_pdf_urls_by_zotero_translators.py +3 -3
- scitex/scholar/url_finder/strategies/find_supplementary_urls_by_href.py +3 -3
- scitex/scholar/url_finder/translators/core/patterns.py +6 -4
- scitex/scholar/url_finder/translators/core/registry.py +6 -9
- scitex/scholar/url_finder/translators/individual/BOFiP_Impots.py +60 -52
- scitex/scholar/url_finder/translators/individual/Baidu_Scholar.py +54 -62
- scitex/scholar/url_finder/translators/individual/Bangkok_Post.py +38 -44
- scitex/scholar/url_finder/translators/individual/Baruch_Foundation.py +43 -47
- scitex/scholar/url_finder/translators/individual/Beobachter.py +46 -50
- scitex/scholar/url_finder/translators/individual/Bezneng_Gajit.py +37 -41
- scitex/scholar/url_finder/translators/individual/BibLaTeX.py +59 -52
- scitex/scholar/url_finder/translators/individual/BibTeX.py +83 -79
- scitex/scholar/url_finder/translators/individual/Biblio_com.py +48 -51
- scitex/scholar/url_finder/translators/individual/Bibliontology_RDF.py +58 -56
- scitex/scholar/url_finder/translators/individual/Camara_Brasileira_do_Livro_ISBN.py +102 -99
- scitex/scholar/url_finder/translators/individual/CanLII.py +49 -43
- scitex/scholar/url_finder/translators/individual/Canada_com.py +36 -40
- scitex/scholar/url_finder/translators/individual/Canadian_Letters_and_Images.py +43 -43
- scitex/scholar/url_finder/translators/individual/Canadiana_ca.py +77 -66
- scitex/scholar/url_finder/translators/individual/Cascadilla_Proceedings_Project.py +68 -62
- scitex/scholar/url_finder/translators/individual/Central_and_Eastern_European_Online_Library_Journals.py +60 -60
- scitex/scholar/url_finder/translators/individual/Champlain_Society_Collection.py +63 -61
- scitex/scholar/url_finder/translators/individual/Chicago_Journal_of_Theoretical_Computer_Science.py +74 -58
- scitex/scholar/url_finder/translators/individual/Christian_Science_Monitor.py +32 -38
- scitex/scholar/url_finder/translators/individual/Columbia_University_Press.py +51 -47
- scitex/scholar/url_finder/translators/individual/Common_Place.py +66 -57
- scitex/scholar/url_finder/translators/individual/Cornell_LII.py +66 -62
- scitex/scholar/url_finder/translators/individual/Cornell_University_Press.py +38 -45
- scitex/scholar/url_finder/translators/individual/CourtListener.py +52 -56
- scitex/scholar/url_finder/translators/individual/DAI_Zenon.py +53 -54
- scitex/scholar/url_finder/translators/individual/access_medicine.py +27 -33
- scitex/scholar/url_finder/translators/individual/acm.py +1 -1
- scitex/scholar/url_finder/translators/individual/acm_digital_library.py +93 -63
- scitex/scholar/url_finder/translators/individual/airiti.py +3 -1
- scitex/scholar/url_finder/translators/individual/aosic.py +3 -1
- scitex/scholar/url_finder/translators/individual/archive_ouverte_aosic.py +3 -1
- scitex/scholar/url_finder/translators/individual/archive_ouverte_en_sciences_de_l_information_et_de_la_communication___aosic_.py +6 -2
- scitex/scholar/url_finder/translators/individual/artforum.py +35 -27
- scitex/scholar/url_finder/translators/individual/arxiv.py +1 -1
- scitex/scholar/url_finder/translators/individual/arxiv_org.py +8 -4
- scitex/scholar/url_finder/translators/individual/atlanta_journal_constitution.py +22 -18
- scitex/scholar/url_finder/translators/individual/atypon_journals.py +19 -11
- scitex/scholar/url_finder/translators/individual/austlii_and_nzlii.py +48 -44
- scitex/scholar/url_finder/translators/individual/australian_dictionary_of_biography.py +21 -17
- scitex/scholar/url_finder/translators/individual/bailii.py +22 -19
- scitex/scholar/url_finder/translators/individual/bbc.py +46 -42
- scitex/scholar/url_finder/translators/individual/bbc_genome.py +37 -25
- scitex/scholar/url_finder/translators/individual/biblioteca_nacional_de_maestros.py +24 -20
- scitex/scholar/url_finder/translators/individual/bibliotheque_archives_nationale_quebec_pistard.py +42 -43
- scitex/scholar/url_finder/translators/individual/bibliotheque_archives_nationales_quebec.py +87 -81
- scitex/scholar/url_finder/translators/individual/bibliotheque_nationale_france.py +39 -37
- scitex/scholar/url_finder/translators/individual/bibsys.py +32 -28
- scitex/scholar/url_finder/translators/individual/bioconductor.py +58 -52
- scitex/scholar/url_finder/translators/individual/biomed_central.py +23 -15
- scitex/scholar/url_finder/translators/individual/biorxiv.py +26 -13
- scitex/scholar/url_finder/translators/individual/blogger.py +39 -43
- scitex/scholar/url_finder/translators/individual/bloomberg.py +48 -52
- scitex/scholar/url_finder/translators/individual/bloomsbury_food_library.py +37 -37
- scitex/scholar/url_finder/translators/individual/bluesky.py +30 -28
- scitex/scholar/url_finder/translators/individual/bnf_isbn.py +1 -1
- scitex/scholar/url_finder/translators/individual/bocc.py +66 -60
- scitex/scholar/url_finder/translators/individual/boe.py +52 -52
- scitex/scholar/url_finder/translators/individual/brill.py +3 -1
- scitex/scholar/url_finder/translators/individual/business_standard.py +36 -38
- scitex/scholar/url_finder/translators/individual/cabi_cab_abstracts.py +39 -41
- scitex/scholar/url_finder/translators/individual/cambridge.py +3 -1
- scitex/scholar/url_finder/translators/individual/cambridge_core.py +30 -24
- scitex/scholar/url_finder/translators/individual/caod.py +50 -46
- scitex/scholar/url_finder/translators/individual/cbc.py +91 -67
- scitex/scholar/url_finder/translators/individual/ccfr_bnf.py +49 -53
- scitex/scholar/url_finder/translators/individual/cia_world_factbook.py +43 -33
- scitex/scholar/url_finder/translators/individual/crossref_rest.py +208 -174
- scitex/scholar/url_finder/translators/individual/current_affairs.py +29 -35
- scitex/scholar/url_finder/translators/individual/dabi.py +70 -66
- scitex/scholar/url_finder/translators/individual/dagens_nyheter.py +3 -1
- scitex/scholar/url_finder/translators/individual/dagstuhl.py +10 -15
- scitex/scholar/url_finder/translators/individual/dar_almandumah.py +13 -9
- scitex/scholar/url_finder/translators/individual/dart_europe.py +19 -22
- scitex/scholar/url_finder/translators/individual/data_gov.py +2 -2
- scitex/scholar/url_finder/translators/individual/databrary.py +27 -28
- scitex/scholar/url_finder/translators/individual/datacite_json.py +152 -137
- scitex/scholar/url_finder/translators/individual/dataverse.py +68 -64
- scitex/scholar/url_finder/translators/individual/daum_news.py +38 -38
- scitex/scholar/url_finder/translators/individual/dblp.py +4 -8
- scitex/scholar/url_finder/translators/individual/dblp_computer_science_bibliography.py +8 -3
- scitex/scholar/url_finder/translators/individual/dbpia.py +5 -3
- scitex/scholar/url_finder/translators/individual/defense_technical_information_center.py +30 -28
- scitex/scholar/url_finder/translators/individual/delpher.py +102 -79
- scitex/scholar/url_finder/translators/individual/demographic_research.py +35 -31
- scitex/scholar/url_finder/translators/individual/denik_cz.py +58 -54
- scitex/scholar/url_finder/translators/individual/depatisnet.py +7 -10
- scitex/scholar/url_finder/translators/individual/der_freitag.py +81 -66
- scitex/scholar/url_finder/translators/individual/der_spiegel.py +56 -54
- scitex/scholar/url_finder/translators/individual/digibib_net.py +3 -1
- scitex/scholar/url_finder/translators/individual/digizeitschriften.py +3 -1
- scitex/scholar/url_finder/translators/individual/dpla.py +13 -14
- scitex/scholar/url_finder/translators/individual/dspace.py +2 -2
- scitex/scholar/url_finder/translators/individual/ebrary.py +3 -1
- scitex/scholar/url_finder/translators/individual/ebscohost.py +3 -1
- scitex/scholar/url_finder/translators/individual/electronic_colloquium_on_computational_complexity.py +3 -1
- scitex/scholar/url_finder/translators/individual/elife.py +3 -1
- scitex/scholar/url_finder/translators/individual/elsevier_health_journals.py +3 -1
- scitex/scholar/url_finder/translators/individual/emerald.py +3 -1
- scitex/scholar/url_finder/translators/individual/emerald_insight.py +3 -1
- scitex/scholar/url_finder/translators/individual/epicurious.py +3 -1
- scitex/scholar/url_finder/translators/individual/eurogamerusgamer.py +3 -1
- scitex/scholar/url_finder/translators/individual/fachportal_padagogik.py +3 -1
- scitex/scholar/url_finder/translators/individual/frontiers.py +1 -1
- scitex/scholar/url_finder/translators/individual/gale_databases.py +3 -1
- scitex/scholar/url_finder/translators/individual/gms_german_medical_science.py +6 -2
- scitex/scholar/url_finder/translators/individual/ieee_computer_society.py +6 -2
- scitex/scholar/url_finder/translators/individual/ieee_xplore.py +41 -35
- scitex/scholar/url_finder/translators/individual/inter_research_science_center.py +6 -2
- scitex/scholar/url_finder/translators/individual/jisc_historical_texts.py +3 -1
- scitex/scholar/url_finder/translators/individual/jstor.py +14 -12
- scitex/scholar/url_finder/translators/individual/korean_national_library.py +3 -1
- scitex/scholar/url_finder/translators/individual/la_times.py +3 -1
- scitex/scholar/url_finder/translators/individual/landesbibliographie_baden_wurttemberg.py +3 -1
- scitex/scholar/url_finder/translators/individual/legislative_insight.py +3 -1
- scitex/scholar/url_finder/translators/individual/libraries_tasmania.py +3 -1
- scitex/scholar/url_finder/translators/individual/library_catalog__koha_.py +3 -1
- scitex/scholar/url_finder/translators/individual/lingbuzz.py +2 -2
- scitex/scholar/url_finder/translators/individual/max_planck_institute_for_the_history_of_science_virtual_laboratory_library.py +3 -1
- scitex/scholar/url_finder/translators/individual/mdpi.py +12 -6
- scitex/scholar/url_finder/translators/individual/microbiology_society_journals.py +3 -1
- scitex/scholar/url_finder/translators/individual/midas_journals.py +3 -1
- scitex/scholar/url_finder/translators/individual/nagoya_university_opac.py +3 -1
- scitex/scholar/url_finder/translators/individual/nature_publishing_group.py +32 -19
- scitex/scholar/url_finder/translators/individual/ntsb_accident_reports.py +3 -1
- scitex/scholar/url_finder/translators/individual/openedition_journals.py +8 -4
- scitex/scholar/url_finder/translators/individual/orcid.py +16 -15
- scitex/scholar/url_finder/translators/individual/oxford.py +25 -19
- scitex/scholar/url_finder/translators/individual/oxford_dictionaries_premium.py +3 -1
- scitex/scholar/url_finder/translators/individual/ozon_ru.py +3 -1
- scitex/scholar/url_finder/translators/individual/plos.py +9 -12
- scitex/scholar/url_finder/translators/individual/polygon.py +3 -1
- scitex/scholar/url_finder/translators/individual/primo.py +3 -1
- scitex/scholar/url_finder/translators/individual/project_muse.py +3 -1
- scitex/scholar/url_finder/translators/individual/pubfactory_journals.py +3 -1
- scitex/scholar/url_finder/translators/individual/pubmed.py +71 -65
- scitex/scholar/url_finder/translators/individual/pubmed_central.py +8 -6
- scitex/scholar/url_finder/translators/individual/rechtspraak_nl.py +3 -1
- scitex/scholar/url_finder/translators/individual/sage_journals.py +25 -17
- scitex/scholar/url_finder/translators/individual/sciencedirect.py +36 -17
- scitex/scholar/url_finder/translators/individual/semantics_visual_library.py +3 -1
- scitex/scholar/url_finder/translators/individual/silverchair.py +70 -52
- scitex/scholar/url_finder/translators/individual/sora.py +3 -1
- scitex/scholar/url_finder/translators/individual/springer.py +15 -11
- scitex/scholar/url_finder/translators/individual/ssrn.py +3 -3
- scitex/scholar/url_finder/translators/individual/stanford_encyclopedia_of_philosophy.py +3 -1
- scitex/scholar/url_finder/translators/individual/superlib.py +3 -1
- scitex/scholar/url_finder/translators/individual/treesearch.py +3 -1
- scitex/scholar/url_finder/translators/individual/university_of_chicago_press_books.py +3 -1
- scitex/scholar/url_finder/translators/individual/vlex.py +3 -1
- scitex/scholar/url_finder/translators/individual/web_of_science.py +3 -1
- scitex/scholar/url_finder/translators/individual/web_of_science_nextgen.py +3 -1
- scitex/scholar/url_finder/translators/individual/wiley.py +31 -25
- scitex/scholar/url_finder/translators/individual/wilson_center_digital_archive.py +3 -1
- scitex/scholar/utils/bibtex/_parse_bibtex.py +3 -3
- scitex/scholar/utils/cleanup/_cleanup_scholar_processes.py +5 -9
- scitex/scholar/utils/text/_TextNormalizer.py +249 -176
- scitex/scholar/utils/validation/DOIValidator.py +31 -28
- scitex/scholar/utils/validation/__init__.py +0 -0
- scitex/scholar/utils/validation/validate_library_dois.py +61 -57
- scitex/scholar/zotero/__init__.py +1 -1
- scitex/security/cli.py +7 -20
- scitex/security/github.py +45 -32
- scitex/session/__init__.py +8 -9
- scitex/session/_decorator.py +49 -42
- scitex/session/_lifecycle.py +39 -39
- scitex/session/_manager.py +24 -20
- scitex/sh/__init__.py +4 -3
- scitex/sh/_execute.py +10 -7
- scitex/sh/_security.py +3 -3
- scitex/sh/_types.py +2 -3
- scitex/stats/__init__.py +174 -6
- scitex/stats/_schema.py +42 -569
- scitex/stats/auto/__init__.py +188 -0
- scitex/stats/auto/_context.py +331 -0
- scitex/stats/auto/_formatting.py +679 -0
- scitex/stats/auto/_rules.py +901 -0
- scitex/stats/auto/_selector.py +554 -0
- scitex/stats/auto/_styles.py +721 -0
- scitex/stats/correct/__init__.py +4 -4
- scitex/stats/correct/_correct_bonferroni.py +43 -34
- scitex/stats/correct/_correct_fdr.py +14 -40
- scitex/stats/correct/_correct_fdr_.py +39 -46
- scitex/stats/correct/_correct_holm.py +14 -32
- scitex/stats/correct/_correct_sidak.py +36 -21
- scitex/stats/descriptive/_circular.py +20 -21
- scitex/stats/descriptive/_describe.py +19 -5
- scitex/stats/descriptive/_nan.py +5 -7
- scitex/stats/descriptive/_real.py +4 -3
- scitex/stats/effect_sizes/__init__.py +10 -11
- scitex/stats/effect_sizes/_cliffs_delta.py +35 -32
- scitex/stats/effect_sizes/_cohens_d.py +30 -31
- scitex/stats/effect_sizes/_epsilon_squared.py +19 -22
- scitex/stats/effect_sizes/_eta_squared.py +23 -27
- scitex/stats/effect_sizes/_prob_superiority.py +18 -21
- scitex/stats/io/__init__.py +29 -0
- scitex/stats/io/_bundle.py +156 -0
- scitex/stats/posthoc/__init__.py +3 -3
- scitex/stats/posthoc/_dunnett.py +75 -55
- scitex/stats/posthoc/_games_howell.py +61 -43
- scitex/stats/posthoc/_tukey_hsd.py +42 -34
- scitex/stats/power/__init__.py +2 -2
- scitex/stats/power/_power.py +56 -56
- scitex/stats/tests/__init__.py +1 -1
- scitex/stats/tests/correlation/__init__.py +1 -1
- scitex/stats/tests/correlation/_test_pearson.py +28 -38
- scitex/stats/utils/__init__.py +14 -17
- scitex/stats/utils/_effect_size.py +85 -78
- scitex/stats/utils/_formatters.py +49 -43
- scitex/stats/utils/_normalizers.py +7 -14
- scitex/stats/utils/_power.py +56 -56
- scitex/str/__init__.py +1 -0
- scitex/str/_clean_path.py +3 -3
- scitex/str/_factor_out_digits.py +86 -58
- scitex/str/_format_plot_text.py +180 -111
- scitex/str/_latex.py +19 -19
- scitex/str/_latex_fallback.py +9 -10
- scitex/str/_parse.py +3 -6
- scitex/str/_print_debug.py +13 -13
- scitex/str/_printc.py +2 -0
- scitex/str/_search.py +3 -3
- scitex/template/.legacy/_clone_project.py +9 -13
- scitex/template/__init__.py +10 -2
- scitex/template/_clone_project.py +7 -2
- scitex/template/_copy.py +1 -0
- scitex/template/_customize.py +3 -6
- scitex/template/_git_strategy.py +2 -3
- scitex/template/_rename.py +1 -0
- scitex/template/clone_pip_project.py +6 -7
- scitex/template/clone_research.py +7 -10
- scitex/template/clone_singularity.py +6 -7
- scitex/template/clone_writer_directory.py +6 -7
- scitex/tex/__init__.py +4 -0
- scitex/tex/_export.py +890 -0
- scitex/tex/_preview.py +26 -11
- scitex/tex/_to_vec.py +10 -7
- scitex/torch/__init__.py +11 -1
- scitex/types/_ArrayLike.py +2 -0
- scitex/types/_is_listed_X.py +3 -3
- scitex/units.py +110 -77
- scitex/utils/_compress_hdf5.py +3 -3
- scitex/utils/_email.py +8 -4
- scitex/utils/_notify.py +14 -8
- scitex/utils/_search.py +6 -6
- scitex/utils/_verify_scitex_format.py +17 -42
- scitex/utils/_verify_scitex_format_v01.py +12 -34
- scitex/utils/template.py +4 -3
- scitex/web/__init__.py +7 -1
- scitex/web/_scraping.py +54 -38
- scitex/web/_search_pubmed.py +30 -14
- scitex/writer/.legacy/Writer_v01-refactored.py +4 -4
- scitex/writer/.legacy/_compile.py +18 -28
- scitex/writer/Writer.py +8 -21
- scitex/writer/__init__.py +11 -11
- scitex/writer/_clone_writer_project.py +2 -6
- scitex/writer/_compile/__init__.py +1 -0
- scitex/writer/_compile/_parser.py +1 -0
- scitex/writer/_compile/_runner.py +35 -38
- scitex/writer/_compile/_validator.py +1 -0
- scitex/writer/_compile/manuscript.py +1 -0
- scitex/writer/_compile/revision.py +1 -0
- scitex/writer/_compile/supplementary.py +1 -0
- scitex/writer/_compile_async.py +5 -12
- scitex/writer/_project/__init__.py +1 -0
- scitex/writer/_project/_create.py +10 -25
- scitex/writer/_project/_trees.py +4 -9
- scitex/writer/_project/_validate.py +2 -3
- scitex/writer/_validate_tree_structures.py +7 -18
- scitex/writer/dataclasses/__init__.py +8 -10
- scitex/writer/dataclasses/config/_CONSTANTS.py +2 -3
- scitex/writer/dataclasses/config/_WriterConfig.py +4 -9
- scitex/writer/dataclasses/contents/_ManuscriptContents.py +14 -25
- scitex/writer/dataclasses/contents/_RevisionContents.py +21 -16
- scitex/writer/dataclasses/contents/_SupplementaryContents.py +21 -24
- scitex/writer/dataclasses/core/_Document.py +2 -3
- scitex/writer/dataclasses/core/_DocumentSection.py +8 -23
- scitex/writer/dataclasses/results/_CompilationResult.py +2 -3
- scitex/writer/dataclasses/results/_LaTeXIssue.py +3 -6
- scitex/writer/dataclasses/results/_SaveSectionsResponse.py +20 -9
- scitex/writer/dataclasses/results/_SectionReadResponse.py +24 -10
- scitex/writer/dataclasses/tree/_ConfigTree.py +7 -4
- scitex/writer/dataclasses/tree/_ManuscriptTree.py +10 -13
- scitex/writer/dataclasses/tree/_RevisionTree.py +16 -17
- scitex/writer/dataclasses/tree/_ScriptsTree.py +10 -5
- scitex/writer/dataclasses/tree/_SharedTree.py +10 -13
- scitex/writer/dataclasses/tree/_SupplementaryTree.py +15 -14
- scitex/writer/utils/.legacy_git_retry.py +3 -8
- scitex/writer/utils/_parse_latex_logs.py +2 -3
- scitex/writer/utils/_parse_script_args.py +20 -23
- scitex/writer/utils/_watch.py +5 -5
- {scitex-2.5.0.dist-info → scitex-2.7.3.dist-info}/METADATA +14 -10
- {scitex-2.5.0.dist-info → scitex-2.7.3.dist-info}/RECORD +1149 -985
- scitex/db/_sqlite3/_SQLite3Mixins/_ColumnMixin_v01-indentation-issues.py +0 -583
- scitex/io/memo.md +0 -2827
- scitex/plt/_subplots/TODO.md +0 -53
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin.py +0 -537
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py +0 -1499
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin.py +0 -431
- scitex/plt/_subplots/_export_as_csv_formatters.py +0 -112
- scitex/vis/__init__.py +0 -177
- scitex/vis/editor/_defaults.py +0 -244
- scitex/vis/editor/_edit.py +0 -378
- scitex/vis/editor/flask_editor/__init__.py +0 -21
- scitex/vis/editor/flask_editor/bbox.py +0 -216
- scitex/vis/editor/flask_editor/core.py +0 -152
- scitex/vis/editor/flask_editor/plotter.py +0 -130
- scitex/vis/editor/flask_editor/renderer.py +0 -184
- scitex/vis/editor/flask_editor/templates/html.py +0 -295
- scitex/vis/editor/flask_editor/templates/scripts.py +0 -614
- scitex/vis/editor/flask_editor/templates/styles.py +0 -549
- /scitex/{vis → fig}/README.md +0 -0
- /scitex/{vis → fig}/docs/CANVAS_ARCHITECTURE.md +0 -0
- {scitex-2.5.0.dist-info → scitex-2.7.3.dist-info}/WHEEL +0 -0
- {scitex-2.5.0.dist-info → scitex-2.7.3.dist-info}/entry_points.txt +0 -0
- {scitex-2.5.0.dist-info → scitex-2.7.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,1499 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
# Timestamp: "2025-12-01 12:00:00 (ywatanabe)"
|
|
4
|
-
# File: /home/ywatanabe/proj/scitex-code/src/scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py
|
|
5
|
-
# ----------------------------------------
|
|
6
|
-
import os
|
|
7
|
-
|
|
8
|
-
__FILE__ = __file__
|
|
9
|
-
__DIR__ = os.path.dirname(__FILE__)
|
|
10
|
-
# ----------------------------------------
|
|
11
|
-
|
|
12
|
-
from functools import wraps
|
|
13
|
-
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
14
|
-
|
|
15
|
-
import matplotlib
|
|
16
|
-
import numpy as np
|
|
17
|
-
import pandas as pd
|
|
18
|
-
from scipy.stats import gaussian_kde
|
|
19
|
-
|
|
20
|
-
from scitex.pd import to_xyz
|
|
21
|
-
from scitex.types import ArrayLike
|
|
22
|
-
from scitex.plt.utils import mm_to_pt
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# ============================================================================
|
|
26
|
-
# Constants for default styling (same as styles/_plot_defaults.py)
|
|
27
|
-
# ============================================================================
|
|
28
|
-
DEFAULT_LINE_WIDTH_MM = 0.2
|
|
29
|
-
DEFAULT_MARKER_SIZE_MM = 0.8
|
|
30
|
-
DEFAULT_FILL_ALPHA = 0.3
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class MatplotlibPlotMixin:
|
|
34
|
-
"""Mixin class for basic plotting operations."""
|
|
35
|
-
|
|
36
|
-
def _get_ax_module(self):
|
|
37
|
-
"""Lazy import ax module to avoid circular imports."""
|
|
38
|
-
from ....plt import ax as ax_module
|
|
39
|
-
return ax_module
|
|
40
|
-
|
|
41
|
-
def _apply_scitex_postprocess(self, method_name, result=None, kwargs=None, args=None):
|
|
42
|
-
"""Apply scitex post-processing styling after plotting.
|
|
43
|
-
|
|
44
|
-
This ensures all scitex wrapper methods get the same styling
|
|
45
|
-
as matplotlib methods going through __getattr__ (tick locator, spines, etc.).
|
|
46
|
-
"""
|
|
47
|
-
from scitex.plt.styles import apply_plot_postprocess
|
|
48
|
-
apply_plot_postprocess(
|
|
49
|
-
method_name, result, self._axis_mpl, kwargs or {}, args
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
def stx_image(
|
|
53
|
-
self,
|
|
54
|
-
arr_2d: ArrayLike,
|
|
55
|
-
track: bool = True,
|
|
56
|
-
id: Optional[str] = None,
|
|
57
|
-
**kwargs,
|
|
58
|
-
) -> None:
|
|
59
|
-
# Method Name for downstream csv exporting
|
|
60
|
-
method_name = "stx_image"
|
|
61
|
-
|
|
62
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
63
|
-
with self._no_tracking():
|
|
64
|
-
self._axis_mpl = self._get_ax_module().stx_image(self._axis_mpl, arr_2d, **kwargs)
|
|
65
|
-
|
|
66
|
-
# Tracking
|
|
67
|
-
tracked_dict = {"image_df": pd.DataFrame(arr_2d)}
|
|
68
|
-
if kwargs.get("xyz", False):
|
|
69
|
-
tracked_dict["image_df"] = to_xyz(tracked_dict["image_df"])
|
|
70
|
-
self._track(
|
|
71
|
-
track,
|
|
72
|
-
id,
|
|
73
|
-
method_name,
|
|
74
|
-
tracked_dict,
|
|
75
|
-
None,
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
79
|
-
self._apply_scitex_postprocess(method_name)
|
|
80
|
-
|
|
81
|
-
return self._axis_mpl
|
|
82
|
-
|
|
83
|
-
def stx_kde(
|
|
84
|
-
self,
|
|
85
|
-
values_1d: ArrayLike,
|
|
86
|
-
cumulative=False,
|
|
87
|
-
fill=False,
|
|
88
|
-
track: bool = True,
|
|
89
|
-
id: Optional[str] = None,
|
|
90
|
-
**kwargs,
|
|
91
|
-
) -> None:
|
|
92
|
-
# Method Name for downstream csv exporting
|
|
93
|
-
method_name = "stx_kde"
|
|
94
|
-
|
|
95
|
-
# Sample count as label
|
|
96
|
-
n_samples = (~np.isnan(values_1d)).sum()
|
|
97
|
-
if kwargs.get("label"):
|
|
98
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
99
|
-
|
|
100
|
-
# Xlim (kwargs["xlim"] is not accepted in downstream plotters)
|
|
101
|
-
xlim = kwargs.pop("xlim", None)
|
|
102
|
-
if not xlim:
|
|
103
|
-
xlim = (np.nanmin(values_1d), np.nanmax(values_1d))
|
|
104
|
-
|
|
105
|
-
# X
|
|
106
|
-
xx = np.linspace(xlim[0], xlim[1], int(1e3))
|
|
107
|
-
|
|
108
|
-
# Y
|
|
109
|
-
density = gaussian_kde(values_1d)(xx)
|
|
110
|
-
density /= density.sum()
|
|
111
|
-
|
|
112
|
-
# Cumulative
|
|
113
|
-
if cumulative:
|
|
114
|
-
density = np.cumsum(density)
|
|
115
|
-
|
|
116
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
117
|
-
with self._no_tracking():
|
|
118
|
-
# Get line width from kwargs or use default (0.2mm for KDE)
|
|
119
|
-
from scitex.plt.utils import mm_to_pt
|
|
120
|
-
if 'linewidth' not in kwargs and 'lw' not in kwargs:
|
|
121
|
-
kwargs['linewidth'] = mm_to_pt(0.2) # Default 0.2mm for KDE
|
|
122
|
-
|
|
123
|
-
# Set default color to black (customizable via color kwarg)
|
|
124
|
-
if 'color' not in kwargs and 'c' not in kwargs:
|
|
125
|
-
kwargs['color'] = 'black'
|
|
126
|
-
|
|
127
|
-
# Set default linestyle to dashed (customizable via linestyle kwarg)
|
|
128
|
-
if 'linestyle' not in kwargs and 'ls' not in kwargs:
|
|
129
|
-
kwargs['linestyle'] = '--'
|
|
130
|
-
|
|
131
|
-
# Filled Line
|
|
132
|
-
if fill:
|
|
133
|
-
self._axis_mpl.fill_between(
|
|
134
|
-
xx,
|
|
135
|
-
density,
|
|
136
|
-
**kwargs,
|
|
137
|
-
)
|
|
138
|
-
# Simple Line
|
|
139
|
-
else:
|
|
140
|
-
self._axis_mpl.plot(xx, density, **kwargs)
|
|
141
|
-
|
|
142
|
-
# Tracking
|
|
143
|
-
tracked_dict = {
|
|
144
|
-
"x": xx,
|
|
145
|
-
"kde": density,
|
|
146
|
-
"n": n_samples,
|
|
147
|
-
}
|
|
148
|
-
self._track(
|
|
149
|
-
track,
|
|
150
|
-
id,
|
|
151
|
-
method_name,
|
|
152
|
-
tracked_dict,
|
|
153
|
-
None,
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
157
|
-
self._apply_scitex_postprocess(method_name)
|
|
158
|
-
|
|
159
|
-
return self._axis_mpl
|
|
160
|
-
|
|
161
|
-
def stx_conf_mat(
|
|
162
|
-
self,
|
|
163
|
-
conf_mat_2d: ArrayLike,
|
|
164
|
-
x_labels: Optional[List[str]] = None,
|
|
165
|
-
y_labels: Optional[List[str]] = None,
|
|
166
|
-
title: str = "Confusion Matrix",
|
|
167
|
-
cmap: str = "Blues",
|
|
168
|
-
cbar: bool = True,
|
|
169
|
-
cbar_kw: Dict[str, Any] = {},
|
|
170
|
-
label_rotation_xy: Tuple[float, float] = (15, 15),
|
|
171
|
-
x_extend_ratio: float = 1.0,
|
|
172
|
-
y_extend_ratio: float = 1.0,
|
|
173
|
-
calc_bacc: bool = False,
|
|
174
|
-
track: bool = True,
|
|
175
|
-
id: Optional[str] = None,
|
|
176
|
-
**kwargs,
|
|
177
|
-
) -> None:
|
|
178
|
-
# Method Name for downstream csv exporting
|
|
179
|
-
method_name = "stx_conf_mat"
|
|
180
|
-
|
|
181
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
182
|
-
with self._no_tracking():
|
|
183
|
-
self._axis_mpl, bacc_val = self._get_ax_module().stx_conf_mat(
|
|
184
|
-
self._axis_mpl,
|
|
185
|
-
conf_mat_2d,
|
|
186
|
-
x_labels=x_labels,
|
|
187
|
-
y_labels=y_labels,
|
|
188
|
-
title=title,
|
|
189
|
-
cmap=cmap,
|
|
190
|
-
cbar=cbar,
|
|
191
|
-
cbar_kw=cbar_kw,
|
|
192
|
-
label_rotation_xy=label_rotation_xy,
|
|
193
|
-
x_extend_ratio=x_extend_ratio,
|
|
194
|
-
y_extend_ratio=y_extend_ratio,
|
|
195
|
-
calc_bacc=calc_bacc,
|
|
196
|
-
**kwargs,
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
tracked_dict = {"balanced_accuracy": bacc_val}
|
|
200
|
-
# Tracking
|
|
201
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
202
|
-
|
|
203
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
204
|
-
self._apply_scitex_postprocess(method_name)
|
|
205
|
-
|
|
206
|
-
return self._axis_mpl, bacc_val
|
|
207
|
-
|
|
208
|
-
# @wraps removed to avoid circular import
|
|
209
|
-
def stx_rectangle(
|
|
210
|
-
self,
|
|
211
|
-
xx: float,
|
|
212
|
-
yy: float,
|
|
213
|
-
width: float,
|
|
214
|
-
height: float,
|
|
215
|
-
track: bool = True,
|
|
216
|
-
id: Optional[str] = None,
|
|
217
|
-
**kwargs,
|
|
218
|
-
) -> None:
|
|
219
|
-
# Method Name for downstream csv exporting
|
|
220
|
-
method_name = "stx_rectangle"
|
|
221
|
-
|
|
222
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
223
|
-
with self._no_tracking():
|
|
224
|
-
self._axis_mpl = self._get_ax_module().stx_rectangle(
|
|
225
|
-
self._axis_mpl, xx, yy, width, height, **kwargs
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
# Tracking
|
|
229
|
-
tracked_dict = {"xx": xx, "yy": yy, "width": width, "height": height}
|
|
230
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
231
|
-
|
|
232
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
233
|
-
self._apply_scitex_postprocess(method_name)
|
|
234
|
-
|
|
235
|
-
return self._axis_mpl
|
|
236
|
-
|
|
237
|
-
# @wraps removed to avoid circular import
|
|
238
|
-
def stx_fillv(
|
|
239
|
-
self,
|
|
240
|
-
starts_1d: ArrayLike,
|
|
241
|
-
ends_1d: ArrayLike,
|
|
242
|
-
color: str = "red",
|
|
243
|
-
alpha: float = 0.2,
|
|
244
|
-
track: bool = True,
|
|
245
|
-
id: Optional[str] = None,
|
|
246
|
-
**kwargs,
|
|
247
|
-
) -> None:
|
|
248
|
-
# Method Name for downstream csv exporting
|
|
249
|
-
method_name = "stx_fillv"
|
|
250
|
-
|
|
251
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
252
|
-
with self._no_tracking():
|
|
253
|
-
self._axis_mpl = self._get_ax_module().stx_fillv(
|
|
254
|
-
self._axis_mpl, starts_1d, ends_1d, color=color, alpha=alpha
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
# Tracking
|
|
258
|
-
tracked_dict = {"starts": starts_1d, "ends": ends_1d}
|
|
259
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
260
|
-
|
|
261
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
262
|
-
self._apply_scitex_postprocess(method_name)
|
|
263
|
-
|
|
264
|
-
return self._axis_mpl
|
|
265
|
-
|
|
266
|
-
def stx_box(
|
|
267
|
-
self,
|
|
268
|
-
values_list: ArrayLike,
|
|
269
|
-
colors: Optional[List] = None,
|
|
270
|
-
track: bool = True,
|
|
271
|
-
id: Optional[str] = None,
|
|
272
|
-
**kwargs,
|
|
273
|
-
) -> dict:
|
|
274
|
-
# Method Name for downstream csv exporting
|
|
275
|
-
method_name = "stx_box"
|
|
276
|
-
|
|
277
|
-
# Copy data
|
|
278
|
-
_data = values_list.copy()
|
|
279
|
-
|
|
280
|
-
# Sample count per group as label (show range if variable)
|
|
281
|
-
if kwargs.get("label"):
|
|
282
|
-
n_per_group = [len(g) for g in values_list]
|
|
283
|
-
n_min, n_max = min(n_per_group), max(n_per_group)
|
|
284
|
-
n_str = str(n_min) if n_min == n_max else f"{n_min}-{n_max}"
|
|
285
|
-
kwargs["label"] = kwargs["label"] + f" ($n$={n_str})"
|
|
286
|
-
|
|
287
|
-
# Enable patch_artist for styling (fill colors, edges)
|
|
288
|
-
if "patch_artist" not in kwargs:
|
|
289
|
-
kwargs["patch_artist"] = True
|
|
290
|
-
|
|
291
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
292
|
-
with self._no_tracking():
|
|
293
|
-
result = self._axis_mpl.boxplot(values_list, **kwargs)
|
|
294
|
-
|
|
295
|
-
# Tracking - calculate sample size per group
|
|
296
|
-
n_per_group = [len(g) for g in values_list]
|
|
297
|
-
tracked_dict = {
|
|
298
|
-
"data": _data,
|
|
299
|
-
"n": n_per_group,
|
|
300
|
-
}
|
|
301
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
302
|
-
|
|
303
|
-
# Apply style_boxplot automatically for publication quality
|
|
304
|
-
# Uses scitex palette by default, or custom colors if provided
|
|
305
|
-
from scitex.plt.ax import style_boxplot
|
|
306
|
-
style_boxplot(result, colors=colors)
|
|
307
|
-
|
|
308
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
309
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
310
|
-
|
|
311
|
-
return result
|
|
312
|
-
|
|
313
|
-
def hist(
|
|
314
|
-
self,
|
|
315
|
-
x: ArrayLike,
|
|
316
|
-
bins: Union[int, str, ArrayLike] = 10,
|
|
317
|
-
range: Optional[Tuple[float, float]] = None,
|
|
318
|
-
align_bins: bool = True,
|
|
319
|
-
track: bool = True,
|
|
320
|
-
id: Optional[str] = None,
|
|
321
|
-
**kwargs,
|
|
322
|
-
) -> None:
|
|
323
|
-
"""
|
|
324
|
-
Plot a histogram.
|
|
325
|
-
|
|
326
|
-
This is an override of the standard matplotlib hist function to ensure
|
|
327
|
-
that histogram bin data is properly tracked for CSV export and bins are
|
|
328
|
-
aligned for histograms on the same axis.
|
|
329
|
-
|
|
330
|
-
Args:
|
|
331
|
-
x: Input data
|
|
332
|
-
bins: Bin specification (count, edges, or algorithm)
|
|
333
|
-
range: Optional histogram range (min, max)
|
|
334
|
-
align_bins: Whether to align bins with other histograms on this axis
|
|
335
|
-
track: Whether to track this operation
|
|
336
|
-
id: Identifier for tracking
|
|
337
|
-
**kwargs: Additional keywords passed to matplotlib hist
|
|
338
|
-
|
|
339
|
-
Returns:
|
|
340
|
-
Histogram output
|
|
341
|
-
"""
|
|
342
|
-
# Method Name for downstream csv exporting
|
|
343
|
-
method_name = "hist"
|
|
344
|
-
|
|
345
|
-
# Get the axis ID for bin alignment
|
|
346
|
-
axis_id = str(hash(self._axis_mpl))
|
|
347
|
-
hist_id = id if id is not None else str(self.id)
|
|
348
|
-
|
|
349
|
-
# Align bins if requested and not the first histogram on this axis
|
|
350
|
-
if align_bins:
|
|
351
|
-
from ....plt.utils import histogram_bin_manager
|
|
352
|
-
bins, range = histogram_bin_manager.register_histogram(
|
|
353
|
-
axis_id, hist_id, x, bins, range
|
|
354
|
-
)
|
|
355
|
-
|
|
356
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
357
|
-
with self._no_tracking():
|
|
358
|
-
hist_data = self._axis_mpl.hist(x, bins=bins, range=range, **kwargs)
|
|
359
|
-
|
|
360
|
-
# Save histogram result for CSV export
|
|
361
|
-
# hist_data[0] = counts, hist_data[1] = bin_edges
|
|
362
|
-
tracked_dict = {
|
|
363
|
-
"args": (x,),
|
|
364
|
-
"hist_result": (hist_data[0], hist_data[1]),
|
|
365
|
-
"bins": bins,
|
|
366
|
-
"range": range,
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
self._track(track, id, method_name, tracked_dict, kwargs)
|
|
370
|
-
|
|
371
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
372
|
-
self._apply_scitex_postprocess(method_name, hist_data)
|
|
373
|
-
|
|
374
|
-
return hist_data
|
|
375
|
-
|
|
376
|
-
# @wraps removed to avoid circular import
|
|
377
|
-
def stx_raster(
|
|
378
|
-
self,
|
|
379
|
-
spike_times_list: List[ArrayLike],
|
|
380
|
-
time: Optional[ArrayLike] = None,
|
|
381
|
-
labels: Optional[List[str]] = None,
|
|
382
|
-
colors: Optional[List[str]] = None,
|
|
383
|
-
track: bool = True,
|
|
384
|
-
id: Optional[str] = None,
|
|
385
|
-
**kwargs,
|
|
386
|
-
) -> None:
|
|
387
|
-
# Method Name for downstream csv exporting
|
|
388
|
-
method_name = "stx_raster"
|
|
389
|
-
|
|
390
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
391
|
-
with self._no_tracking():
|
|
392
|
-
self._axis_mpl, raster_digit_df = self._get_ax_module().stx_raster(
|
|
393
|
-
self._axis_mpl, spike_times_list, time=time
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
# Tracking
|
|
397
|
-
tracked_dict = {"raster_digit_df": raster_digit_df}
|
|
398
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
399
|
-
|
|
400
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
401
|
-
self._apply_scitex_postprocess(method_name)
|
|
402
|
-
|
|
403
|
-
return self._axis_mpl, raster_digit_df
|
|
404
|
-
|
|
405
|
-
# @wraps removed to avoid circular import
|
|
406
|
-
def stx_ecdf(
|
|
407
|
-
self,
|
|
408
|
-
values_1d: ArrayLike,
|
|
409
|
-
track: bool = True,
|
|
410
|
-
id: Optional[str] = None,
|
|
411
|
-
**kwargs,
|
|
412
|
-
) -> None:
|
|
413
|
-
# Method Name for downstream csv exporting
|
|
414
|
-
method_name = "stx_ecdf"
|
|
415
|
-
|
|
416
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
417
|
-
with self._no_tracking():
|
|
418
|
-
self._axis_mpl, ecdf_df = self._get_ax_module().stx_ecdf(
|
|
419
|
-
self._axis_mpl, values_1d, **kwargs
|
|
420
|
-
)
|
|
421
|
-
|
|
422
|
-
# Tracking
|
|
423
|
-
tracked_dict = {"ecdf_df": ecdf_df}
|
|
424
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
425
|
-
|
|
426
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
427
|
-
self._apply_scitex_postprocess(method_name)
|
|
428
|
-
|
|
429
|
-
return self._axis_mpl, ecdf_df
|
|
430
|
-
|
|
431
|
-
# @wraps removed to avoid circular import
|
|
432
|
-
def stx_joyplot(
|
|
433
|
-
self,
|
|
434
|
-
arrays: ArrayLike,
|
|
435
|
-
track: bool = True,
|
|
436
|
-
id: Optional[str] = None,
|
|
437
|
-
**kwargs,
|
|
438
|
-
) -> None:
|
|
439
|
-
# Method Name for downstream csv exporting
|
|
440
|
-
method_name = "stx_joyplot"
|
|
441
|
-
|
|
442
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
443
|
-
with self._no_tracking():
|
|
444
|
-
self._axis_mpl = self._get_ax_module().stx_joyplot(
|
|
445
|
-
self._axis_mpl, arrays, **kwargs
|
|
446
|
-
)
|
|
447
|
-
|
|
448
|
-
# Tracking
|
|
449
|
-
tracked_dict = {"joyplot_arrays": arrays}
|
|
450
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
451
|
-
|
|
452
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
453
|
-
self._apply_scitex_postprocess(method_name)
|
|
454
|
-
|
|
455
|
-
return self._axis_mpl
|
|
456
|
-
|
|
457
|
-
# @wraps removed to avoid circular import
|
|
458
|
-
def stx_scatter_hist(
|
|
459
|
-
self,
|
|
460
|
-
x: ArrayLike,
|
|
461
|
-
y: ArrayLike,
|
|
462
|
-
hist_bins: int = 20,
|
|
463
|
-
scatter_alpha: float = 0.6,
|
|
464
|
-
scatter_size: float = 20,
|
|
465
|
-
scatter_color: str = "blue",
|
|
466
|
-
hist_color_x: str = "blue",
|
|
467
|
-
hist_color_y: str = "red",
|
|
468
|
-
hist_alpha: float = 0.5,
|
|
469
|
-
scatter_ratio: float = 0.8,
|
|
470
|
-
track: bool = True,
|
|
471
|
-
id: Optional[str] = None,
|
|
472
|
-
**kwargs,
|
|
473
|
-
) -> None:
|
|
474
|
-
"""Plot a scatter plot with marginal histograms."""
|
|
475
|
-
# Method Name for downstream csv exporting
|
|
476
|
-
method_name = "stx_scatter_hist"
|
|
477
|
-
|
|
478
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
479
|
-
with self._no_tracking():
|
|
480
|
-
self._axis_mpl, ax_histx, ax_histy, hist_data = self._get_ax_module().stx_scatter_hist(
|
|
481
|
-
self._axis_mpl,
|
|
482
|
-
x,
|
|
483
|
-
y,
|
|
484
|
-
hist_bins=hist_bins,
|
|
485
|
-
scatter_alpha=scatter_alpha,
|
|
486
|
-
scatter_size=scatter_size,
|
|
487
|
-
scatter_color=scatter_color,
|
|
488
|
-
hist_color_x=hist_color_x,
|
|
489
|
-
hist_color_y=hist_color_y,
|
|
490
|
-
hist_alpha=hist_alpha,
|
|
491
|
-
scatter_ratio=scatter_ratio,
|
|
492
|
-
**kwargs,
|
|
493
|
-
)
|
|
494
|
-
|
|
495
|
-
# Tracking
|
|
496
|
-
tracked_dict = {
|
|
497
|
-
"x": x,
|
|
498
|
-
"y": y,
|
|
499
|
-
"hist_x": hist_data["hist_x"],
|
|
500
|
-
"hist_y": hist_data["hist_y"],
|
|
501
|
-
"bin_edges_x": hist_data["bin_edges_x"],
|
|
502
|
-
"bin_edges_y": hist_data["bin_edges_y"],
|
|
503
|
-
}
|
|
504
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
505
|
-
|
|
506
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
507
|
-
self._apply_scitex_postprocess(method_name)
|
|
508
|
-
|
|
509
|
-
return self._axis_mpl, ax_histx, ax_histy, hist_data
|
|
510
|
-
|
|
511
|
-
# @wraps removed to avoid circular import
|
|
512
|
-
def stx_heatmap(
|
|
513
|
-
self,
|
|
514
|
-
values_2d: ArrayLike,
|
|
515
|
-
x_labels: Optional[List[str]] = None,
|
|
516
|
-
y_labels: Optional[List[str]] = None,
|
|
517
|
-
cmap: str = "viridis",
|
|
518
|
-
cbar_label: str = "ColorBar Label",
|
|
519
|
-
value_format: str = "{x:.1f}",
|
|
520
|
-
show_annot: bool = True,
|
|
521
|
-
annot_color_lighter: str = "white",
|
|
522
|
-
annot_color_darker: str = "black",
|
|
523
|
-
track: bool = True,
|
|
524
|
-
id: Optional[str] = None,
|
|
525
|
-
**kwargs,
|
|
526
|
-
) -> Tuple[matplotlib.image.AxesImage, matplotlib.colorbar.Colorbar]:
|
|
527
|
-
"""Plot a heatmap on the axes."""
|
|
528
|
-
# Method Name for downstream csv exporting
|
|
529
|
-
method_name = "stx_heatmap"
|
|
530
|
-
|
|
531
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
532
|
-
with self._no_tracking():
|
|
533
|
-
ax, im, cbar = self._get_ax_module().stx_heatmap(
|
|
534
|
-
self._axis_mpl,
|
|
535
|
-
values_2d,
|
|
536
|
-
x_labels=x_labels,
|
|
537
|
-
y_labels=y_labels,
|
|
538
|
-
cmap=cmap,
|
|
539
|
-
cbar_label=cbar_label,
|
|
540
|
-
value_format=value_format,
|
|
541
|
-
show_annot=show_annot,
|
|
542
|
-
annot_color_lighter=annot_color_lighter,
|
|
543
|
-
annot_color_darker=annot_color_darker,
|
|
544
|
-
**kwargs,
|
|
545
|
-
)
|
|
546
|
-
|
|
547
|
-
# Tracking
|
|
548
|
-
tracked_dict = {
|
|
549
|
-
"data": values_2d,
|
|
550
|
-
"x_labels": x_labels,
|
|
551
|
-
"y_labels": y_labels,
|
|
552
|
-
}
|
|
553
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
554
|
-
|
|
555
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
556
|
-
self._apply_scitex_postprocess(method_name)
|
|
557
|
-
|
|
558
|
-
return ax, im, cbar
|
|
559
|
-
|
|
560
|
-
# @wraps removed to avoid circular import
|
|
561
|
-
def stx_violin(
|
|
562
|
-
self,
|
|
563
|
-
values_list: Union[pd.DataFrame, List, ArrayLike],
|
|
564
|
-
x=None,
|
|
565
|
-
y=None,
|
|
566
|
-
hue=None,
|
|
567
|
-
labels=None,
|
|
568
|
-
colors=None,
|
|
569
|
-
half=False,
|
|
570
|
-
track: bool = True,
|
|
571
|
-
id: Optional[str] = None,
|
|
572
|
-
**kwargs,
|
|
573
|
-
) -> None:
|
|
574
|
-
"""Plot a violin plot."""
|
|
575
|
-
# Method Name for downstream csv exporting
|
|
576
|
-
method_name = "stx_violin"
|
|
577
|
-
|
|
578
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
579
|
-
with self._no_tracking():
|
|
580
|
-
# Handle the list-style input case
|
|
581
|
-
if isinstance(values_list, list) and all(
|
|
582
|
-
isinstance(item, (list, np.ndarray)) for item in values_list
|
|
583
|
-
):
|
|
584
|
-
self._axis_mpl = self._get_ax_module().stx_violin(
|
|
585
|
-
self._axis_mpl,
|
|
586
|
-
values_list=values_list,
|
|
587
|
-
labels=labels,
|
|
588
|
-
colors=colors,
|
|
589
|
-
half=half,
|
|
590
|
-
**kwargs,
|
|
591
|
-
)
|
|
592
|
-
# Handle DataFrame or other inputs
|
|
593
|
-
else:
|
|
594
|
-
self._axis_mpl = self._get_ax_module().stx_violin(
|
|
595
|
-
self._axis_mpl,
|
|
596
|
-
data=values_list,
|
|
597
|
-
x=x,
|
|
598
|
-
y=y,
|
|
599
|
-
hue=hue,
|
|
600
|
-
half=half,
|
|
601
|
-
**kwargs,
|
|
602
|
-
)
|
|
603
|
-
|
|
604
|
-
# Tracking
|
|
605
|
-
tracked_dict = {
|
|
606
|
-
"data": values_list,
|
|
607
|
-
"x": x,
|
|
608
|
-
"y": y,
|
|
609
|
-
"hue": hue,
|
|
610
|
-
"half": half,
|
|
611
|
-
"labels": labels,
|
|
612
|
-
"colors": colors,
|
|
613
|
-
}
|
|
614
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
615
|
-
|
|
616
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
617
|
-
self._apply_scitex_postprocess(method_name)
|
|
618
|
-
|
|
619
|
-
return self._axis_mpl
|
|
620
|
-
|
|
621
|
-
# def plot_area(
|
|
622
|
-
# self,
|
|
623
|
-
# x: ArrayLike,
|
|
624
|
-
# y: ArrayLike,
|
|
625
|
-
# stacked: bool = False,
|
|
626
|
-
# fill: bool = True,
|
|
627
|
-
# alpha: float = 0.5,
|
|
628
|
-
# track: bool = True,
|
|
629
|
-
# id: Optional[str] = None,
|
|
630
|
-
# **kwargs,
|
|
631
|
-
# ) -> None:
|
|
632
|
-
# """Plot an area plot."""
|
|
633
|
-
# # Method Name for downstream csv exporting
|
|
634
|
-
# method_name = "plot_area"
|
|
635
|
-
|
|
636
|
-
# # Plotting with pure matplotlib methods under non-tracking context
|
|
637
|
-
# with self._no_tracking():
|
|
638
|
-
# self._axis_mpl = self._get_ax_module().plot_area(
|
|
639
|
-
# self._axis_mpl,
|
|
640
|
-
# x,
|
|
641
|
-
# y,
|
|
642
|
-
# stacked=stacked,
|
|
643
|
-
# fill=fill,
|
|
644
|
-
# alpha=alpha,
|
|
645
|
-
# **kwargs,
|
|
646
|
-
# )
|
|
647
|
-
|
|
648
|
-
# # Tracking
|
|
649
|
-
# tracked_dict = {"x": x, "y": y}
|
|
650
|
-
# self._track(track, id, method_name, tracked_dict, None)
|
|
651
|
-
|
|
652
|
-
# return self._axis_mpl
|
|
653
|
-
|
|
654
|
-
# def plot_radar(
|
|
655
|
-
# self,
|
|
656
|
-
# data: ArrayLike,
|
|
657
|
-
# categories: List[str],
|
|
658
|
-
# groups: Optional[List[str]] = None,
|
|
659
|
-
# fill: bool = True,
|
|
660
|
-
# alpha: float = 0.2,
|
|
661
|
-
# grid_step: int = 5,
|
|
662
|
-
# track: bool = True,
|
|
663
|
-
# id: Optional[str] = None,
|
|
664
|
-
# **kwargs,
|
|
665
|
-
# ) -> None:
|
|
666
|
-
# """Plot a radar/spider chart."""
|
|
667
|
-
# # Method Name for downstream csv exporting
|
|
668
|
-
# method_name = "plot_radar"
|
|
669
|
-
|
|
670
|
-
# # Convert data to DataFrame if not already
|
|
671
|
-
# if not isinstance(data, pd.DataFrame):
|
|
672
|
-
# if groups is not None:
|
|
673
|
-
# data = pd.DataFrame(data, columns=categories, index=groups)
|
|
674
|
-
# else:
|
|
675
|
-
# data = pd.DataFrame(data, columns=categories)
|
|
676
|
-
|
|
677
|
-
# # Plotting with pure matplotlib methods under non-tracking context
|
|
678
|
-
# with self._no_tracking():
|
|
679
|
-
# self._axis_mpl = self._get_ax_module().plot_radar(
|
|
680
|
-
# self._axis_mpl,
|
|
681
|
-
# data,
|
|
682
|
-
# categories=categories,
|
|
683
|
-
# fill=fill,
|
|
684
|
-
# alpha=alpha,
|
|
685
|
-
# grid_step=grid_step,
|
|
686
|
-
# **kwargs,
|
|
687
|
-
# )
|
|
688
|
-
|
|
689
|
-
# # Tracking
|
|
690
|
-
# tracked_dict = {"radar_data": data}
|
|
691
|
-
# self._track(track, id, method_name, tracked_dict, None)
|
|
692
|
-
|
|
693
|
-
# return self._axis_mpl
|
|
694
|
-
|
|
695
|
-
# def plot_bubble(
|
|
696
|
-
# self,
|
|
697
|
-
# x: ArrayLike,
|
|
698
|
-
# y: ArrayLike,
|
|
699
|
-
# size: ArrayLike,
|
|
700
|
-
# color: Optional[ArrayLike] = None,
|
|
701
|
-
# size_scale: float = 1000.0,
|
|
702
|
-
# alpha: float = 0.6,
|
|
703
|
-
# colormap: str = "viridis",
|
|
704
|
-
# show_colorbar: bool = True,
|
|
705
|
-
# colorbar_label: str = "",
|
|
706
|
-
# track: bool = True,
|
|
707
|
-
# id: Optional[str] = None,
|
|
708
|
-
# **kwargs,
|
|
709
|
-
# ) -> None:
|
|
710
|
-
# """Plot a bubble chart."""
|
|
711
|
-
# # Method Name for downstream csv exporting
|
|
712
|
-
# method_name = "plot_bubble"
|
|
713
|
-
|
|
714
|
-
# # Plotting with pure matplotlib methods under non-tracking context
|
|
715
|
-
# with self._no_tracking():
|
|
716
|
-
# self._axis_mpl = self._get_ax_module().plot_bubble(
|
|
717
|
-
# self._axis_mpl,
|
|
718
|
-
# x,
|
|
719
|
-
# y,
|
|
720
|
-
# size,
|
|
721
|
-
# color=color,
|
|
722
|
-
# size_scale=size_scale,
|
|
723
|
-
# alpha=alpha,
|
|
724
|
-
# colormap=colormap,
|
|
725
|
-
# show_colorbar=show_colorbar,
|
|
726
|
-
# colorbar_label=colorbar_label,
|
|
727
|
-
# **kwargs,
|
|
728
|
-
# )
|
|
729
|
-
|
|
730
|
-
# # Tracking
|
|
731
|
-
# tracked_dict = {"x": x, "y": y, "size": size}
|
|
732
|
-
# if color is not None:
|
|
733
|
-
# tracked_dict["color"] = color
|
|
734
|
-
|
|
735
|
-
# self._track(track, id, method_name, tracked_dict, None)
|
|
736
|
-
|
|
737
|
-
# return self._axis_mpl
|
|
738
|
-
|
|
739
|
-
# def plot_ridgeline(
|
|
740
|
-
# self,
|
|
741
|
-
# data: ArrayLike,
|
|
742
|
-
# labels: Optional[List[str]] = None,
|
|
743
|
-
# overlap: float = 0.8,
|
|
744
|
-
# fill: bool = True,
|
|
745
|
-
# alpha: float = 0.6,
|
|
746
|
-
# colormap: str = "viridis",
|
|
747
|
-
# bandwidth: Optional[float] = None,
|
|
748
|
-
# track: bool = True,
|
|
749
|
-
# id: Optional[str] = None,
|
|
750
|
-
# **kwargs,
|
|
751
|
-
# ) -> None:
|
|
752
|
-
# """Plot a ridgeline plot (similar to joyplot but with KDE)."""
|
|
753
|
-
# # Method Name for downstream csv exporting
|
|
754
|
-
# method_name = "plot_ridgeline"
|
|
755
|
-
|
|
756
|
-
# # Ensure data is in correct format
|
|
757
|
-
# if isinstance(data, pd.DataFrame):
|
|
758
|
-
# _data = [data[col].dropna().values for col in data.columns]
|
|
759
|
-
# if labels is None:
|
|
760
|
-
# labels = list(data.columns)
|
|
761
|
-
# elif isinstance(data, list):
|
|
762
|
-
# _data = data
|
|
763
|
-
# else:
|
|
764
|
-
# _data = [data]
|
|
765
|
-
|
|
766
|
-
# # Plotting with pure matplotlib methods under non-tracking context
|
|
767
|
-
# with self._no_tracking():
|
|
768
|
-
# self._axis_mpl, ridge_data = self._get_ax_module().plot_ridgeline(
|
|
769
|
-
# self._axis_mpl,
|
|
770
|
-
# _data,
|
|
771
|
-
# labels=labels,
|
|
772
|
-
# overlap=overlap,
|
|
773
|
-
# fill=fill,
|
|
774
|
-
# alpha=alpha,
|
|
775
|
-
# colormap=colormap,
|
|
776
|
-
# bandwidth=bandwidth,
|
|
777
|
-
# **kwargs,
|
|
778
|
-
# )
|
|
779
|
-
|
|
780
|
-
# # Tracking
|
|
781
|
-
# tracked_dict = {
|
|
782
|
-
# "ridgeline_data": _data,
|
|
783
|
-
# "kde_x": ridge_data["kde_x"],
|
|
784
|
-
# "kde_y": ridge_data["kde_y"],
|
|
785
|
-
# }
|
|
786
|
-
# if labels is not None:
|
|
787
|
-
# tracked_dict["labels"] = labels
|
|
788
|
-
# self._track(track, id, method_name, tracked_dict, None)
|
|
789
|
-
|
|
790
|
-
# return self._axis_mpl, ridge_data
|
|
791
|
-
|
|
792
|
-
# def plot_parallel_coordinates(
|
|
793
|
-
# self,
|
|
794
|
-
# data: pd.DataFrame,
|
|
795
|
-
# class_column: Optional[str] = None,
|
|
796
|
-
# colormap: str = "viridis",
|
|
797
|
-
# alpha: float = 0.5,
|
|
798
|
-
# track: bool = True,
|
|
799
|
-
# id: Optional[str] = None,
|
|
800
|
-
# **kwargs,
|
|
801
|
-
# ) -> None:
|
|
802
|
-
# """Plot parallel coordinates."""
|
|
803
|
-
# # Method Name for downstream csv exporting
|
|
804
|
-
# method_name = "plot_parallel_coordinates"
|
|
805
|
-
|
|
806
|
-
# # Plotting with pure matplotlib methods under non-tracking context
|
|
807
|
-
# with self._no_tracking():
|
|
808
|
-
# self._axis_mpl = self._get_ax_module().plot_parallel_coordinates(
|
|
809
|
-
# self._axis_mpl,
|
|
810
|
-
# data,
|
|
811
|
-
# class_column=class_column,
|
|
812
|
-
# colormap=colormap,
|
|
813
|
-
# alpha=alpha,
|
|
814
|
-
# **kwargs,
|
|
815
|
-
# )
|
|
816
|
-
|
|
817
|
-
# # Tracking
|
|
818
|
-
# tracked_dict = {"parallel_data": data}
|
|
819
|
-
# self._track(track, id, method_name, tracked_dict, None)
|
|
820
|
-
|
|
821
|
-
# return self._axis_mpl
|
|
822
|
-
|
|
823
|
-
# @wraps removed to avoid circular import
|
|
824
|
-
def stx_line(
|
|
825
|
-
self,
|
|
826
|
-
values_1d: ArrayLike,
|
|
827
|
-
xx: Optional[ArrayLike] = None,
|
|
828
|
-
track: bool = True,
|
|
829
|
-
id: Optional[str] = None,
|
|
830
|
-
**kwargs,
|
|
831
|
-
) -> None:
|
|
832
|
-
"""Plot a simple line."""
|
|
833
|
-
# Method Name for downstream csv exporting
|
|
834
|
-
method_name = "stx_line"
|
|
835
|
-
|
|
836
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
837
|
-
with self._no_tracking():
|
|
838
|
-
self._axis_mpl, plot_df = self._get_ax_module().stx_line(
|
|
839
|
-
self._axis_mpl, values_1d, xx=xx, **kwargs
|
|
840
|
-
)
|
|
841
|
-
|
|
842
|
-
# Tracking
|
|
843
|
-
tracked_dict = {"plot_df": plot_df}
|
|
844
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
845
|
-
|
|
846
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
847
|
-
self._apply_scitex_postprocess(method_name)
|
|
848
|
-
|
|
849
|
-
return self._axis_mpl, plot_df
|
|
850
|
-
|
|
851
|
-
# @wraps removed to avoid circular import
|
|
852
|
-
def stx_mean_std(
|
|
853
|
-
self,
|
|
854
|
-
values_2d: ArrayLike,
|
|
855
|
-
xx: Optional[ArrayLike] = None,
|
|
856
|
-
sd: float = 1,
|
|
857
|
-
track: bool = True,
|
|
858
|
-
id: Optional[str] = None,
|
|
859
|
-
**kwargs,
|
|
860
|
-
) -> None:
|
|
861
|
-
"""Plot mean line with standard deviation shading."""
|
|
862
|
-
# Method Name for downstream csv exporting
|
|
863
|
-
method_name = "stx_mean_std"
|
|
864
|
-
|
|
865
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
866
|
-
with self._no_tracking():
|
|
867
|
-
self._axis_mpl, plot_df = self._get_ax_module().stx_mean_std(
|
|
868
|
-
self._axis_mpl, values_2d, xx=xx, sd=sd, **kwargs
|
|
869
|
-
)
|
|
870
|
-
|
|
871
|
-
# Tracking
|
|
872
|
-
tracked_dict = {"plot_df": plot_df}
|
|
873
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
874
|
-
|
|
875
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
876
|
-
self._apply_scitex_postprocess(method_name)
|
|
877
|
-
|
|
878
|
-
return self._axis_mpl, plot_df
|
|
879
|
-
|
|
880
|
-
# @wraps removed to avoid circular import
|
|
881
|
-
def stx_mean_ci(
|
|
882
|
-
self,
|
|
883
|
-
values_2d: ArrayLike,
|
|
884
|
-
xx: Optional[ArrayLike] = None,
|
|
885
|
-
perc: float = 95,
|
|
886
|
-
track: bool = True,
|
|
887
|
-
id: Optional[str] = None,
|
|
888
|
-
**kwargs,
|
|
889
|
-
) -> None:
|
|
890
|
-
"""Plot mean line with confidence interval shading."""
|
|
891
|
-
# Method Name for downstream csv exporting
|
|
892
|
-
method_name = "stx_mean_ci"
|
|
893
|
-
|
|
894
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
895
|
-
with self._no_tracking():
|
|
896
|
-
self._axis_mpl, plot_df = self._get_ax_module().stx_mean_ci(
|
|
897
|
-
self._axis_mpl, values_2d, xx=xx, perc=perc, **kwargs
|
|
898
|
-
)
|
|
899
|
-
|
|
900
|
-
# Tracking
|
|
901
|
-
tracked_dict = {"plot_df": plot_df}
|
|
902
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
903
|
-
|
|
904
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
905
|
-
self._apply_scitex_postprocess(method_name)
|
|
906
|
-
|
|
907
|
-
return self._axis_mpl, plot_df
|
|
908
|
-
|
|
909
|
-
# @wraps removed to avoid circular import
|
|
910
|
-
def stx_median_iqr(
|
|
911
|
-
self,
|
|
912
|
-
values_2d: ArrayLike,
|
|
913
|
-
xx: Optional[ArrayLike] = None,
|
|
914
|
-
track: bool = True,
|
|
915
|
-
id: Optional[str] = None,
|
|
916
|
-
**kwargs,
|
|
917
|
-
) -> None:
|
|
918
|
-
"""Plot median line with interquartile range shading."""
|
|
919
|
-
# Method Name for downstream csv exporting
|
|
920
|
-
method_name = "stx_median_iqr"
|
|
921
|
-
|
|
922
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
923
|
-
with self._no_tracking():
|
|
924
|
-
self._axis_mpl, plot_df = self._get_ax_module().stx_median_iqr(
|
|
925
|
-
self._axis_mpl, values_2d, xx=xx, **kwargs
|
|
926
|
-
)
|
|
927
|
-
|
|
928
|
-
# Tracking
|
|
929
|
-
tracked_dict = {"plot_df": plot_df}
|
|
930
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
931
|
-
|
|
932
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
933
|
-
self._apply_scitex_postprocess(method_name)
|
|
934
|
-
|
|
935
|
-
return self._axis_mpl, plot_df
|
|
936
|
-
|
|
937
|
-
# @wraps removed to avoid circular import
|
|
938
|
-
def stx_shaded_line(
|
|
939
|
-
self,
|
|
940
|
-
xs: ArrayLike,
|
|
941
|
-
ys_lower: ArrayLike,
|
|
942
|
-
ys_middle: ArrayLike,
|
|
943
|
-
ys_upper: ArrayLike,
|
|
944
|
-
color: str or Optional[Union[str, List[str]]] = None,
|
|
945
|
-
label: str or Optional[Union[str, List[str]]] = None,
|
|
946
|
-
track: bool = True,
|
|
947
|
-
id: Optional[str] = None,
|
|
948
|
-
**kwargs,
|
|
949
|
-
) -> None:
|
|
950
|
-
"""Plot a line with shaded area between lower and upper bounds."""
|
|
951
|
-
# Method Name for downstream csv exporting
|
|
952
|
-
method_name = "stx_shaded_line"
|
|
953
|
-
|
|
954
|
-
# Plotting with pure matplotlib methods under non-tracking context
|
|
955
|
-
with self._no_tracking():
|
|
956
|
-
self._axis_mpl, plot_df = self._get_ax_module().stx_shaded_line(
|
|
957
|
-
self._axis_mpl,
|
|
958
|
-
xs,
|
|
959
|
-
ys_lower,
|
|
960
|
-
ys_middle,
|
|
961
|
-
ys_upper,
|
|
962
|
-
color=color,
|
|
963
|
-
label=label,
|
|
964
|
-
**kwargs,
|
|
965
|
-
)
|
|
966
|
-
|
|
967
|
-
# Tracking
|
|
968
|
-
tracked_dict = {"plot_df": plot_df}
|
|
969
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
970
|
-
|
|
971
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
972
|
-
self._apply_scitex_postprocess(method_name)
|
|
973
|
-
|
|
974
|
-
return self._axis_mpl, plot_df
|
|
975
|
-
|
|
976
|
-
# =========================================================================
|
|
977
|
-
# stx_ aliases for standard matplotlib methods
|
|
978
|
-
# These provide a consistent stx_ prefix for all scitex wrapper methods
|
|
979
|
-
# =========================================================================
|
|
980
|
-
|
|
981
|
-
def stx_bar(self, x, height, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
982
|
-
"""Bar plot with scitex styling and tracking.
|
|
983
|
-
|
|
984
|
-
Parameters
|
|
985
|
-
----------
|
|
986
|
-
x : array-like
|
|
987
|
-
The x coordinates of the bars
|
|
988
|
-
height : array-like
|
|
989
|
-
The heights of the bars
|
|
990
|
-
track : bool
|
|
991
|
-
Whether to track data for CSV export
|
|
992
|
-
id : str, optional
|
|
993
|
-
Identifier for tracking
|
|
994
|
-
**kwargs
|
|
995
|
-
Additional arguments passed to matplotlib bar
|
|
996
|
-
"""
|
|
997
|
-
method_name = "stx_bar"
|
|
998
|
-
|
|
999
|
-
# Add sample size to label if provided
|
|
1000
|
-
if kwargs.get("label"):
|
|
1001
|
-
n_samples = len(x)
|
|
1002
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
1003
|
-
|
|
1004
|
-
with self._no_tracking():
|
|
1005
|
-
result = self._axis_mpl.bar(x, height, **kwargs)
|
|
1006
|
-
|
|
1007
|
-
# Track bar data
|
|
1008
|
-
tracked_dict = {"bar_df": pd.DataFrame({"x": x, "height": height})}
|
|
1009
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1010
|
-
|
|
1011
|
-
# Apply style_barplot automatically for publication quality
|
|
1012
|
-
from scitex.plt.ax import style_barplot
|
|
1013
|
-
style_barplot(result)
|
|
1014
|
-
|
|
1015
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1016
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1017
|
-
|
|
1018
|
-
return result
|
|
1019
|
-
|
|
1020
|
-
def stx_barh(self, y, width, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1021
|
-
"""Horizontal bar plot with scitex styling and tracking.
|
|
1022
|
-
|
|
1023
|
-
Parameters
|
|
1024
|
-
----------
|
|
1025
|
-
y : array-like
|
|
1026
|
-
The y coordinates of the bars
|
|
1027
|
-
width : array-like
|
|
1028
|
-
The widths of the bars
|
|
1029
|
-
track : bool
|
|
1030
|
-
Whether to track data for CSV export
|
|
1031
|
-
id : str, optional
|
|
1032
|
-
Identifier for tracking
|
|
1033
|
-
**kwargs
|
|
1034
|
-
Additional arguments passed to matplotlib barh
|
|
1035
|
-
"""
|
|
1036
|
-
method_name = "stx_barh"
|
|
1037
|
-
|
|
1038
|
-
# Add sample size to label if provided
|
|
1039
|
-
if kwargs.get("label"):
|
|
1040
|
-
n_samples = len(y)
|
|
1041
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
1042
|
-
|
|
1043
|
-
with self._no_tracking():
|
|
1044
|
-
result = self._axis_mpl.barh(y, width, **kwargs)
|
|
1045
|
-
|
|
1046
|
-
# Track bar data
|
|
1047
|
-
tracked_dict = {"barh_df": pd.DataFrame({"y": y, "width": width})}
|
|
1048
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1049
|
-
|
|
1050
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1051
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1052
|
-
|
|
1053
|
-
return result
|
|
1054
|
-
|
|
1055
|
-
def stx_scatter(self, x, y, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1056
|
-
"""Scatter plot with scitex styling and tracking.
|
|
1057
|
-
|
|
1058
|
-
Parameters
|
|
1059
|
-
----------
|
|
1060
|
-
x : array-like
|
|
1061
|
-
The x coordinates of the points
|
|
1062
|
-
y : array-like
|
|
1063
|
-
The y coordinates of the points
|
|
1064
|
-
track : bool
|
|
1065
|
-
Whether to track data for CSV export
|
|
1066
|
-
id : str, optional
|
|
1067
|
-
Identifier for tracking
|
|
1068
|
-
**kwargs
|
|
1069
|
-
Additional arguments passed to matplotlib scatter
|
|
1070
|
-
"""
|
|
1071
|
-
method_name = "stx_scatter"
|
|
1072
|
-
|
|
1073
|
-
# Add sample size to label if provided
|
|
1074
|
-
if kwargs.get("label"):
|
|
1075
|
-
n_samples = len(x)
|
|
1076
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
1077
|
-
|
|
1078
|
-
with self._no_tracking():
|
|
1079
|
-
result = self._axis_mpl.scatter(x, y, **kwargs)
|
|
1080
|
-
|
|
1081
|
-
# Track scatter data
|
|
1082
|
-
tracked_dict = {"scatter_df": pd.DataFrame({"x": x, "y": y})}
|
|
1083
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1084
|
-
|
|
1085
|
-
# Apply style_scatter automatically for publication quality
|
|
1086
|
-
from scitex.plt.ax import style_scatter
|
|
1087
|
-
style_scatter(result)
|
|
1088
|
-
|
|
1089
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1090
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1091
|
-
|
|
1092
|
-
return result
|
|
1093
|
-
|
|
1094
|
-
def stx_errorbar(self, x, y, yerr=None, xerr=None, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1095
|
-
"""Error bar plot with scitex styling and tracking.
|
|
1096
|
-
|
|
1097
|
-
Parameters
|
|
1098
|
-
----------
|
|
1099
|
-
x : array-like
|
|
1100
|
-
The x coordinates of the data points
|
|
1101
|
-
y : array-like
|
|
1102
|
-
The y coordinates of the data points
|
|
1103
|
-
yerr : array-like, optional
|
|
1104
|
-
The y error values
|
|
1105
|
-
xerr : array-like, optional
|
|
1106
|
-
The x error values
|
|
1107
|
-
track : bool
|
|
1108
|
-
Whether to track data for CSV export
|
|
1109
|
-
id : str, optional
|
|
1110
|
-
Identifier for tracking
|
|
1111
|
-
**kwargs
|
|
1112
|
-
Additional arguments passed to matplotlib errorbar
|
|
1113
|
-
"""
|
|
1114
|
-
method_name = "stx_errorbar"
|
|
1115
|
-
|
|
1116
|
-
# Add sample size to label if provided
|
|
1117
|
-
if kwargs.get("label"):
|
|
1118
|
-
n_samples = len(x)
|
|
1119
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
1120
|
-
|
|
1121
|
-
with self._no_tracking():
|
|
1122
|
-
result = self._axis_mpl.errorbar(x, y, yerr=yerr, xerr=xerr, **kwargs)
|
|
1123
|
-
|
|
1124
|
-
# Track errorbar data
|
|
1125
|
-
df_dict = {"x": x, "y": y}
|
|
1126
|
-
if yerr is not None:
|
|
1127
|
-
df_dict["yerr"] = yerr
|
|
1128
|
-
if xerr is not None:
|
|
1129
|
-
df_dict["xerr"] = xerr
|
|
1130
|
-
tracked_dict = {"errorbar_df": pd.DataFrame(df_dict)}
|
|
1131
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1132
|
-
|
|
1133
|
-
# Apply style_errorbar automatically for publication quality
|
|
1134
|
-
from scitex.plt.ax import style_errorbar
|
|
1135
|
-
style_errorbar(result)
|
|
1136
|
-
|
|
1137
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1138
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1139
|
-
|
|
1140
|
-
return result
|
|
1141
|
-
|
|
1142
|
-
def stx_fill_between(self, x, y1, y2=0, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1143
|
-
"""Fill between plot with scitex styling and tracking.
|
|
1144
|
-
|
|
1145
|
-
Parameters
|
|
1146
|
-
----------
|
|
1147
|
-
x : array-like
|
|
1148
|
-
The x coordinates
|
|
1149
|
-
y1 : array-like
|
|
1150
|
-
The first y boundary
|
|
1151
|
-
y2 : array-like or scalar, optional
|
|
1152
|
-
The second y boundary (default 0)
|
|
1153
|
-
track : bool
|
|
1154
|
-
Whether to track data for CSV export
|
|
1155
|
-
id : str, optional
|
|
1156
|
-
Identifier for tracking
|
|
1157
|
-
**kwargs
|
|
1158
|
-
Additional arguments passed to matplotlib fill_between
|
|
1159
|
-
"""
|
|
1160
|
-
method_name = "stx_fill_between"
|
|
1161
|
-
|
|
1162
|
-
with self._no_tracking():
|
|
1163
|
-
result = self._axis_mpl.fill_between(x, y1, y2, **kwargs)
|
|
1164
|
-
|
|
1165
|
-
# Track fill_between data
|
|
1166
|
-
tracked_dict = {"fill_between_df": pd.DataFrame({
|
|
1167
|
-
"x": x,
|
|
1168
|
-
"y1": y1,
|
|
1169
|
-
"y2": y2 if hasattr(y2, '__len__') else [y2] * len(x)
|
|
1170
|
-
})}
|
|
1171
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1172
|
-
|
|
1173
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1174
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1175
|
-
|
|
1176
|
-
return result
|
|
1177
|
-
|
|
1178
|
-
def stx_contour(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1179
|
-
"""Contour plot with scitex styling and tracking.
|
|
1180
|
-
|
|
1181
|
-
Parameters
|
|
1182
|
-
----------
|
|
1183
|
-
*args
|
|
1184
|
-
Positional arguments passed to matplotlib contour (X, Y, Z)
|
|
1185
|
-
track : bool
|
|
1186
|
-
Whether to track data for CSV export
|
|
1187
|
-
id : str, optional
|
|
1188
|
-
Identifier for tracking
|
|
1189
|
-
**kwargs
|
|
1190
|
-
Additional arguments passed to matplotlib contour
|
|
1191
|
-
"""
|
|
1192
|
-
method_name = "stx_contour"
|
|
1193
|
-
|
|
1194
|
-
with self._no_tracking():
|
|
1195
|
-
result = self._axis_mpl.contour(*args, **kwargs)
|
|
1196
|
-
|
|
1197
|
-
# Track contour data
|
|
1198
|
-
if len(args) >= 3:
|
|
1199
|
-
X, Y, Z = args[0], args[1], args[2]
|
|
1200
|
-
tracked_dict = {"contour_df": pd.DataFrame({
|
|
1201
|
-
"X": np.ravel(X),
|
|
1202
|
-
"Y": np.ravel(Y),
|
|
1203
|
-
"Z": np.ravel(Z)
|
|
1204
|
-
})}
|
|
1205
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1206
|
-
|
|
1207
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1208
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1209
|
-
|
|
1210
|
-
return result
|
|
1211
|
-
|
|
1212
|
-
def stx_imshow(self, data, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1213
|
-
"""Image display with scitex styling and tracking.
|
|
1214
|
-
|
|
1215
|
-
Parameters
|
|
1216
|
-
----------
|
|
1217
|
-
data : array-like
|
|
1218
|
-
2D array of image data
|
|
1219
|
-
track : bool
|
|
1220
|
-
Whether to track data for CSV export
|
|
1221
|
-
id : str, optional
|
|
1222
|
-
Identifier for tracking
|
|
1223
|
-
**kwargs
|
|
1224
|
-
Additional arguments passed to matplotlib imshow
|
|
1225
|
-
"""
|
|
1226
|
-
method_name = "stx_imshow"
|
|
1227
|
-
|
|
1228
|
-
with self._no_tracking():
|
|
1229
|
-
result = self._axis_mpl.imshow(data, **kwargs)
|
|
1230
|
-
|
|
1231
|
-
# Track image data
|
|
1232
|
-
if hasattr(data, 'shape') and len(data.shape) == 2:
|
|
1233
|
-
n_rows, n_cols = data.shape
|
|
1234
|
-
df = pd.DataFrame(data, columns=[f"col_{i}" for i in range(n_cols)])
|
|
1235
|
-
else:
|
|
1236
|
-
df = pd.DataFrame(data)
|
|
1237
|
-
tracked_dict = {"imshow_df": df}
|
|
1238
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1239
|
-
|
|
1240
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1241
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1242
|
-
|
|
1243
|
-
return result
|
|
1244
|
-
|
|
1245
|
-
def stx_boxplot(self, data, colors: Optional[List] = None, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1246
|
-
"""Boxplot with scitex styling and tracking (alias for stx_box).
|
|
1247
|
-
|
|
1248
|
-
Parameters
|
|
1249
|
-
----------
|
|
1250
|
-
data : list of array-like
|
|
1251
|
-
List of data arrays for each box
|
|
1252
|
-
colors : list, optional
|
|
1253
|
-
Colors for each box
|
|
1254
|
-
track : bool
|
|
1255
|
-
Whether to track data for CSV export
|
|
1256
|
-
id : str, optional
|
|
1257
|
-
Identifier for tracking
|
|
1258
|
-
**kwargs
|
|
1259
|
-
Additional arguments passed to matplotlib boxplot
|
|
1260
|
-
"""
|
|
1261
|
-
return self.stx_box(data, colors=colors, track=track, id=id, **kwargs)
|
|
1262
|
-
|
|
1263
|
-
def stx_violinplot(self, data, colors: Optional[List] = None, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1264
|
-
"""Violinplot with scitex styling and tracking (alias for stx_violin).
|
|
1265
|
-
|
|
1266
|
-
Parameters
|
|
1267
|
-
----------
|
|
1268
|
-
data : list of array-like or DataFrame
|
|
1269
|
-
Data for violin plot
|
|
1270
|
-
colors : list, optional
|
|
1271
|
-
Colors for each violin
|
|
1272
|
-
track : bool
|
|
1273
|
-
Whether to track data for CSV export
|
|
1274
|
-
id : str, optional
|
|
1275
|
-
Identifier for tracking
|
|
1276
|
-
**kwargs
|
|
1277
|
-
Additional arguments passed to stx_violin
|
|
1278
|
-
"""
|
|
1279
|
-
return self.stx_violin(data, colors=colors, track=track, id=id, **kwargs)
|
|
1280
|
-
|
|
1281
|
-
# Standard matplotlib plot methods with plot_ prefix
|
|
1282
|
-
def plot_bar(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1283
|
-
"""Wrapper for matplotlib bar plot with tracking support."""
|
|
1284
|
-
method_name = "plot_bar"
|
|
1285
|
-
|
|
1286
|
-
with self._no_tracking():
|
|
1287
|
-
result = self._axis_mpl.bar(*args, **kwargs)
|
|
1288
|
-
|
|
1289
|
-
# Track bar data
|
|
1290
|
-
if len(args) >= 2:
|
|
1291
|
-
tracked_dict = {"bar_df": pd.DataFrame({"x": args[0], "height": args[1]})}
|
|
1292
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1293
|
-
|
|
1294
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1295
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1296
|
-
|
|
1297
|
-
return result
|
|
1298
|
-
|
|
1299
|
-
def plot_barh(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1300
|
-
"""Wrapper for matplotlib horizontal bar plot with tracking support."""
|
|
1301
|
-
method_name = "plot_barh"
|
|
1302
|
-
|
|
1303
|
-
with self._no_tracking():
|
|
1304
|
-
result = self._axis_mpl.barh(*args, **kwargs)
|
|
1305
|
-
|
|
1306
|
-
# Track bar data
|
|
1307
|
-
if len(args) >= 2:
|
|
1308
|
-
tracked_dict = {"barh_df": pd.DataFrame({"y": args[0], "width": args[1]})}
|
|
1309
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1310
|
-
|
|
1311
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1312
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1313
|
-
|
|
1314
|
-
return result
|
|
1315
|
-
|
|
1316
|
-
def plot_scatter(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1317
|
-
"""Wrapper for matplotlib scatter plot with tracking support."""
|
|
1318
|
-
method_name = "plot_scatter"
|
|
1319
|
-
|
|
1320
|
-
# Add sample size to label if provided
|
|
1321
|
-
if kwargs.get("label") and len(args) >= 1:
|
|
1322
|
-
n_samples = len(args[0])
|
|
1323
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
1324
|
-
|
|
1325
|
-
with self._no_tracking():
|
|
1326
|
-
result = self._axis_mpl.scatter(*args, **kwargs)
|
|
1327
|
-
|
|
1328
|
-
# Track scatter data
|
|
1329
|
-
if len(args) >= 2:
|
|
1330
|
-
tracked_dict = {"scatter_df": pd.DataFrame({"x": args[0], "y": args[1]})}
|
|
1331
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1332
|
-
|
|
1333
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1334
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1335
|
-
|
|
1336
|
-
return result
|
|
1337
|
-
|
|
1338
|
-
def plot_errorbar(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1339
|
-
"""Wrapper for matplotlib errorbar plot with tracking support."""
|
|
1340
|
-
method_name = "plot_errorbar"
|
|
1341
|
-
|
|
1342
|
-
with self._no_tracking():
|
|
1343
|
-
result = self._axis_mpl.errorbar(*args, **kwargs)
|
|
1344
|
-
|
|
1345
|
-
# Track errorbar data
|
|
1346
|
-
if len(args) >= 2:
|
|
1347
|
-
df_dict = {"x": args[0], "y": args[1]}
|
|
1348
|
-
if "yerr" in kwargs:
|
|
1349
|
-
df_dict["yerr"] = kwargs["yerr"]
|
|
1350
|
-
if "xerr" in kwargs:
|
|
1351
|
-
df_dict["xerr"] = kwargs["xerr"]
|
|
1352
|
-
tracked_dict = {"errorbar_df": pd.DataFrame(df_dict)}
|
|
1353
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1354
|
-
|
|
1355
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1356
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1357
|
-
|
|
1358
|
-
return result
|
|
1359
|
-
|
|
1360
|
-
def plot_fill_between(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1361
|
-
"""Wrapper for matplotlib fill_between with tracking support."""
|
|
1362
|
-
method_name = "plot_fill_between"
|
|
1363
|
-
|
|
1364
|
-
with self._no_tracking():
|
|
1365
|
-
result = self._axis_mpl.fill_between(*args, **kwargs)
|
|
1366
|
-
|
|
1367
|
-
# Track fill_between data
|
|
1368
|
-
if len(args) >= 3:
|
|
1369
|
-
tracked_dict = {"fill_between_df": pd.DataFrame({
|
|
1370
|
-
"x": args[0],
|
|
1371
|
-
"y1": args[1],
|
|
1372
|
-
"y2": args[2] if len(args) > 2 else 0
|
|
1373
|
-
})}
|
|
1374
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1375
|
-
|
|
1376
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1377
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1378
|
-
|
|
1379
|
-
return result
|
|
1380
|
-
|
|
1381
|
-
def plot_contour(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1382
|
-
"""Wrapper for matplotlib contour plot with tracking support."""
|
|
1383
|
-
method_name = "plot_contour"
|
|
1384
|
-
|
|
1385
|
-
with self._no_tracking():
|
|
1386
|
-
result = self._axis_mpl.contour(*args, **kwargs)
|
|
1387
|
-
|
|
1388
|
-
# Track contour data
|
|
1389
|
-
if len(args) >= 3:
|
|
1390
|
-
# Flatten 2D arrays for CSV export
|
|
1391
|
-
X, Y, Z = args[0], args[1], args[2]
|
|
1392
|
-
tracked_dict = {"contour_df": pd.DataFrame({
|
|
1393
|
-
"X": np.ravel(X),
|
|
1394
|
-
"Y": np.ravel(Y),
|
|
1395
|
-
"Z": np.ravel(Z)
|
|
1396
|
-
})}
|
|
1397
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1398
|
-
|
|
1399
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1400
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1401
|
-
|
|
1402
|
-
return result
|
|
1403
|
-
|
|
1404
|
-
def plot_imshow(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1405
|
-
"""Wrapper for matplotlib imshow with tracking support."""
|
|
1406
|
-
method_name = "plot_imshow"
|
|
1407
|
-
|
|
1408
|
-
with self._no_tracking():
|
|
1409
|
-
result = self._axis_mpl.imshow(*args, **kwargs)
|
|
1410
|
-
|
|
1411
|
-
# Track image data
|
|
1412
|
-
if len(args) >= 1:
|
|
1413
|
-
# Create DataFrame with unique column names to avoid duplicates
|
|
1414
|
-
img_data = args[0]
|
|
1415
|
-
if hasattr(img_data, 'shape') and len(img_data.shape) == 2:
|
|
1416
|
-
n_rows, n_cols = img_data.shape
|
|
1417
|
-
# Use column names like "col_0", "col_1", etc. instead of just integers
|
|
1418
|
-
df = pd.DataFrame(img_data, columns=[f"col_{i}" for i in range(n_cols)])
|
|
1419
|
-
else:
|
|
1420
|
-
df = pd.DataFrame(args[0])
|
|
1421
|
-
tracked_dict = {"imshow_df": df}
|
|
1422
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1423
|
-
|
|
1424
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1425
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1426
|
-
|
|
1427
|
-
return result
|
|
1428
|
-
|
|
1429
|
-
def plot_boxplot(self, *args, colors: Optional[List] = None, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1430
|
-
"""Wrapper for matplotlib boxplot with tracking support and auto-styling."""
|
|
1431
|
-
method_name = "plot_boxplot"
|
|
1432
|
-
|
|
1433
|
-
# Add sample size per group to label if provided (show range if variable)
|
|
1434
|
-
if kwargs.get("label") and len(args) >= 1:
|
|
1435
|
-
data = args[0]
|
|
1436
|
-
if isinstance(data, list):
|
|
1437
|
-
n_per_group = [len(g) for g in data]
|
|
1438
|
-
n_min, n_max = min(n_per_group), max(n_per_group)
|
|
1439
|
-
n_str = str(n_min) if n_min == n_max else f"{n_min}-{n_max}"
|
|
1440
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_str})"
|
|
1441
|
-
|
|
1442
|
-
# Enable patch_artist for styling (fill colors, edges)
|
|
1443
|
-
if "patch_artist" not in kwargs:
|
|
1444
|
-
kwargs["patch_artist"] = True
|
|
1445
|
-
|
|
1446
|
-
with self._no_tracking():
|
|
1447
|
-
result = self._axis_mpl.boxplot(*args, **kwargs)
|
|
1448
|
-
|
|
1449
|
-
# Track boxplot data
|
|
1450
|
-
if len(args) >= 1:
|
|
1451
|
-
data = args[0]
|
|
1452
|
-
if isinstance(data, list):
|
|
1453
|
-
tracked_dict = {"boxplot_df": pd.DataFrame(data)}
|
|
1454
|
-
else:
|
|
1455
|
-
tracked_dict = {"boxplot_df": pd.DataFrame({"data": data})}
|
|
1456
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1457
|
-
|
|
1458
|
-
# Apply style_boxplot automatically for publication quality
|
|
1459
|
-
# Uses scitex palette by default, or custom colors if provided
|
|
1460
|
-
from scitex.plt.ax import style_boxplot
|
|
1461
|
-
style_boxplot(result, colors=colors)
|
|
1462
|
-
|
|
1463
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1464
|
-
self._apply_scitex_postprocess(method_name, result)
|
|
1465
|
-
|
|
1466
|
-
return result
|
|
1467
|
-
|
|
1468
|
-
def plot_violinplot(self, *args, track: bool = True, id: Optional[str] = None, **kwargs):
|
|
1469
|
-
"""Wrapper for matplotlib violinplot with tracking support."""
|
|
1470
|
-
method_name = "plot_violinplot"
|
|
1471
|
-
|
|
1472
|
-
# Add sample size per group to label if provided (show range if variable)
|
|
1473
|
-
if kwargs.get("label") and len(args) >= 1:
|
|
1474
|
-
data = args[0]
|
|
1475
|
-
if isinstance(data, list):
|
|
1476
|
-
n_per_group = [len(g) for g in data]
|
|
1477
|
-
n_min, n_max = min(n_per_group), max(n_per_group)
|
|
1478
|
-
n_str = str(n_min) if n_min == n_max else f"{n_min}-{n_max}"
|
|
1479
|
-
kwargs["label"] = f"{kwargs['label']} ($n$={n_str})"
|
|
1480
|
-
|
|
1481
|
-
with self._no_tracking():
|
|
1482
|
-
result = self._axis_mpl.violinplot(*args, **kwargs)
|
|
1483
|
-
|
|
1484
|
-
# Track violin data
|
|
1485
|
-
if len(args) >= 1:
|
|
1486
|
-
data = args[0]
|
|
1487
|
-
if isinstance(data, list):
|
|
1488
|
-
tracked_dict = {"violinplot_df": pd.DataFrame(data)}
|
|
1489
|
-
else:
|
|
1490
|
-
tracked_dict = {"violinplot_df": pd.DataFrame({"data": data})}
|
|
1491
|
-
self._track(track, id, method_name, tracked_dict, None)
|
|
1492
|
-
|
|
1493
|
-
# Apply post-processing (tick locator, spines, etc.)
|
|
1494
|
-
self._apply_scitex_postprocess(method_name, result, kwargs, args)
|
|
1495
|
-
|
|
1496
|
-
return result
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
# EOF
|