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
|
@@ -13,24 +13,28 @@ def _get_qt():
|
|
|
13
13
|
"""Get Qt bindings (PyQt6, PyQt5, PySide6, or PySide2)."""
|
|
14
14
|
try:
|
|
15
15
|
from PyQt6 import QtWidgets, QtCore, QtGui
|
|
16
|
+
|
|
16
17
|
return QtWidgets, QtCore, QtGui, "PyQt6"
|
|
17
18
|
except ImportError:
|
|
18
19
|
pass
|
|
19
20
|
|
|
20
21
|
try:
|
|
21
22
|
from PyQt5 import QtWidgets, QtCore, QtGui
|
|
23
|
+
|
|
22
24
|
return QtWidgets, QtCore, QtGui, "PyQt5"
|
|
23
25
|
except ImportError:
|
|
24
26
|
pass
|
|
25
27
|
|
|
26
28
|
try:
|
|
27
29
|
from PySide6 import QtWidgets, QtCore, QtGui
|
|
30
|
+
|
|
28
31
|
return QtWidgets, QtCore, QtGui, "PySide6"
|
|
29
32
|
except ImportError:
|
|
30
33
|
pass
|
|
31
34
|
|
|
32
35
|
try:
|
|
33
36
|
from PySide2 import QtWidgets, QtCore, QtGui
|
|
37
|
+
|
|
34
38
|
return QtWidgets, QtCore, QtGui, "PySide2"
|
|
35
39
|
except ImportError:
|
|
36
40
|
pass
|
|
@@ -52,6 +56,7 @@ class QtEditor:
|
|
|
52
56
|
- Real-time preview updates
|
|
53
57
|
- Save to .manual.json
|
|
54
58
|
- SciTeX style defaults pre-filled
|
|
59
|
+
- Hitmap-based element selection (when available)
|
|
55
60
|
"""
|
|
56
61
|
|
|
57
62
|
def __init__(
|
|
@@ -61,15 +66,36 @@ class QtEditor:
|
|
|
61
66
|
csv_data: Optional[Any] = None,
|
|
62
67
|
png_path: Optional[Path] = None,
|
|
63
68
|
manual_overrides: Optional[Dict[str, Any]] = None,
|
|
69
|
+
hitmap_path: Optional[Path] = None,
|
|
70
|
+
bundle_spec: Optional[Dict[str, Any]] = None,
|
|
64
71
|
):
|
|
65
72
|
self.json_path = Path(json_path)
|
|
66
73
|
self.metadata = metadata
|
|
67
74
|
self.csv_data = csv_data
|
|
68
75
|
self.png_path = Path(png_path) if png_path else None
|
|
69
76
|
self.manual_overrides = manual_overrides or {}
|
|
77
|
+
self.hitmap_path = Path(hitmap_path) if hitmap_path else None
|
|
78
|
+
self.bundle_spec = bundle_spec or {}
|
|
79
|
+
|
|
80
|
+
# Load hitmap image if available
|
|
81
|
+
self.hitmap_array = None
|
|
82
|
+
if self.hitmap_path and self.hitmap_path.exists():
|
|
83
|
+
try:
|
|
84
|
+
from PIL import Image
|
|
85
|
+
import numpy as np
|
|
86
|
+
hitmap_img = Image.open(self.hitmap_path).convert('RGB')
|
|
87
|
+
self.hitmap_array = np.array(hitmap_img)
|
|
88
|
+
except Exception:
|
|
89
|
+
pass
|
|
90
|
+
|
|
91
|
+
# Extract hit_regions and selectable_regions from spec
|
|
92
|
+
self.hit_regions = self.bundle_spec.get('hit_regions', {})
|
|
93
|
+
self.selectable_regions = self.bundle_spec.get('selectable_regions', {})
|
|
94
|
+
self.color_map = self.hit_regions.get('color_map', {})
|
|
70
95
|
|
|
71
96
|
# Get SciTeX defaults and merge with metadata
|
|
72
97
|
from ._defaults import get_scitex_defaults, extract_defaults_from_metadata
|
|
98
|
+
|
|
73
99
|
self.scitex_defaults = get_scitex_defaults()
|
|
74
100
|
self.metadata_defaults = extract_defaults_from_metadata(metadata)
|
|
75
101
|
|
|
@@ -99,13 +125,11 @@ class QtEditor:
|
|
|
99
125
|
self.app = QtWidgets.QApplication([])
|
|
100
126
|
|
|
101
127
|
# Create main window
|
|
102
|
-
self.main_window = QtEditorWindow(
|
|
103
|
-
self, QtWidgets, QtCore, QtGui, qt_version
|
|
104
|
-
)
|
|
128
|
+
self.main_window = QtEditorWindow(self, QtWidgets, QtCore, QtGui, qt_version)
|
|
105
129
|
self.main_window.show()
|
|
106
130
|
|
|
107
131
|
# Start event loop
|
|
108
|
-
self.app.exec() if hasattr(self.app,
|
|
132
|
+
self.app.exec() if hasattr(self.app, "exec") else self.app.exec_()
|
|
109
133
|
|
|
110
134
|
|
|
111
135
|
class QtEditorWindow:
|
|
@@ -130,9 +154,11 @@ class QtEditorWindow:
|
|
|
130
154
|
layout = QtWidgets.QHBoxLayout(central_widget)
|
|
131
155
|
|
|
132
156
|
# Splitter for resizable panels
|
|
133
|
-
splitter = QtWidgets.QSplitter(
|
|
134
|
-
|
|
135
|
-
|
|
157
|
+
splitter = QtWidgets.QSplitter(
|
|
158
|
+
QtCore.Qt.Orientation.Horizontal
|
|
159
|
+
if hasattr(QtCore.Qt, "Orientation")
|
|
160
|
+
else QtCore.Qt.Horizontal
|
|
161
|
+
)
|
|
136
162
|
layout.addWidget(splitter)
|
|
137
163
|
|
|
138
164
|
# Left panel: Canvas
|
|
@@ -159,7 +185,7 @@ class QtEditorWindow:
|
|
|
159
185
|
self.window.show()
|
|
160
186
|
|
|
161
187
|
def _create_canvas_panel(self, parent):
|
|
162
|
-
"""Create the matplotlib canvas panel."""
|
|
188
|
+
"""Create the matplotlib canvas panel with hitmap-based selection."""
|
|
163
189
|
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
|
|
164
190
|
from matplotlib.backends.backend_qtagg import NavigationToolbar2QT
|
|
165
191
|
from matplotlib.figure import Figure
|
|
@@ -179,8 +205,167 @@ class QtEditorWindow:
|
|
|
179
205
|
toolbar = NavigationToolbar2QT(self.canvas, canvas_widget)
|
|
180
206
|
canvas_layout.addWidget(toolbar)
|
|
181
207
|
|
|
208
|
+
# Connect click event for hitmap-based selection
|
|
209
|
+
self.canvas.mpl_connect('button_press_event', self._on_canvas_click)
|
|
210
|
+
|
|
211
|
+
# Selection info label
|
|
212
|
+
self.selection_label = self.QtWidgets.QLabel("Click on figure to select element")
|
|
213
|
+
self.selection_label.setStyleSheet("padding: 5px; background: #f0f0f0; border-radius: 3px;")
|
|
214
|
+
canvas_layout.addWidget(self.selection_label)
|
|
215
|
+
|
|
182
216
|
parent.addWidget(canvas_widget)
|
|
183
217
|
|
|
218
|
+
def _on_canvas_click(self, event):
|
|
219
|
+
"""Handle canvas click - use hitmap to identify clicked element."""
|
|
220
|
+
if event.inaxes is None:
|
|
221
|
+
return
|
|
222
|
+
|
|
223
|
+
# Get pixel coordinates
|
|
224
|
+
x_px = int(event.x)
|
|
225
|
+
y_px = int(self.canvas.get_width_height()[1] - event.y) # Flip Y
|
|
226
|
+
|
|
227
|
+
# First check selectable_regions (bounding boxes for axis elements)
|
|
228
|
+
selection_info = self._check_selectable_regions(x_px, y_px)
|
|
229
|
+
|
|
230
|
+
# If no selectable_region hit, try hitmap for data elements
|
|
231
|
+
if selection_info is None and self.editor.hitmap_array is not None:
|
|
232
|
+
selection_info = self._check_hitmap(x_px, y_px)
|
|
233
|
+
|
|
234
|
+
# Update selection display
|
|
235
|
+
if selection_info:
|
|
236
|
+
self._show_selection(selection_info)
|
|
237
|
+
else:
|
|
238
|
+
self.selection_label.setText(f"No element at ({x_px}, {y_px})")
|
|
239
|
+
self.status_bar.showMessage(f"Click at ({x_px}, {y_px}) - no element found")
|
|
240
|
+
|
|
241
|
+
def _check_selectable_regions(self, x_px: int, y_px: int) -> Optional[Dict[str, Any]]:
|
|
242
|
+
"""Check if click is within any selectable_region bounding box."""
|
|
243
|
+
regions = self.editor.selectable_regions
|
|
244
|
+
if not regions or 'axes' not in regions:
|
|
245
|
+
return None
|
|
246
|
+
|
|
247
|
+
for ax_info in regions['axes']:
|
|
248
|
+
ax_idx = ax_info.get('index', 0)
|
|
249
|
+
|
|
250
|
+
# Check title
|
|
251
|
+
if 'title' in ax_info:
|
|
252
|
+
bbox = ax_info['title'].get('bbox_px', [])
|
|
253
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
254
|
+
return {
|
|
255
|
+
'type': 'title',
|
|
256
|
+
'axes_index': ax_idx,
|
|
257
|
+
'text': ax_info['title'].get('text', ''),
|
|
258
|
+
'element': 'title',
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
# Check xlabel
|
|
262
|
+
if 'xlabel' in ax_info:
|
|
263
|
+
bbox = ax_info['xlabel'].get('bbox_px', [])
|
|
264
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
265
|
+
return {
|
|
266
|
+
'type': 'xlabel',
|
|
267
|
+
'axes_index': ax_idx,
|
|
268
|
+
'text': ax_info['xlabel'].get('text', ''),
|
|
269
|
+
'element': 'xlabel',
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
# Check ylabel
|
|
273
|
+
if 'ylabel' in ax_info:
|
|
274
|
+
bbox = ax_info['ylabel'].get('bbox_px', [])
|
|
275
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
276
|
+
return {
|
|
277
|
+
'type': 'ylabel',
|
|
278
|
+
'axes_index': ax_idx,
|
|
279
|
+
'text': ax_info['ylabel'].get('text', ''),
|
|
280
|
+
'element': 'ylabel',
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
# Check legend
|
|
284
|
+
if 'legend' in ax_info:
|
|
285
|
+
bbox = ax_info['legend'].get('bbox_px', [])
|
|
286
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
287
|
+
return {
|
|
288
|
+
'type': 'legend',
|
|
289
|
+
'axes_index': ax_idx,
|
|
290
|
+
'element': 'legend',
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
# Check xaxis elements
|
|
294
|
+
if 'xaxis' in ax_info:
|
|
295
|
+
xaxis = ax_info['xaxis']
|
|
296
|
+
if 'spine' in xaxis and xaxis['spine']:
|
|
297
|
+
bbox = xaxis['spine'].get('bbox_px', [])
|
|
298
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
299
|
+
return {'type': 'xaxis_spine', 'axes_index': ax_idx, 'element': 'xaxis'}
|
|
300
|
+
|
|
301
|
+
# Check yaxis elements
|
|
302
|
+
if 'yaxis' in ax_info:
|
|
303
|
+
yaxis = ax_info['yaxis']
|
|
304
|
+
if 'spine' in yaxis and yaxis['spine']:
|
|
305
|
+
bbox = yaxis['spine'].get('bbox_px', [])
|
|
306
|
+
if len(bbox) == 4 and self._point_in_bbox(x_px, y_px, bbox):
|
|
307
|
+
return {'type': 'yaxis_spine', 'axes_index': ax_idx, 'element': 'yaxis'}
|
|
308
|
+
|
|
309
|
+
return None
|
|
310
|
+
|
|
311
|
+
def _check_hitmap(self, x_px: int, y_px: int) -> Optional[Dict[str, Any]]:
|
|
312
|
+
"""Check hitmap for data element at pixel position."""
|
|
313
|
+
hitmap = self.editor.hitmap_array
|
|
314
|
+
color_map = self.editor.color_map
|
|
315
|
+
|
|
316
|
+
if hitmap is None or not color_map:
|
|
317
|
+
return None
|
|
318
|
+
|
|
319
|
+
# Bounds check
|
|
320
|
+
h, w = hitmap.shape[:2]
|
|
321
|
+
if x_px < 0 or x_px >= w or y_px < 0 or y_px >= h:
|
|
322
|
+
return None
|
|
323
|
+
|
|
324
|
+
# Get RGB at position
|
|
325
|
+
r, g, b = hitmap[y_px, x_px]
|
|
326
|
+
|
|
327
|
+
# Skip background (black) and axes elements (dark gray)
|
|
328
|
+
if (r, g, b) == (0, 0, 0): # Background
|
|
329
|
+
return None
|
|
330
|
+
if (r, g, b) == (64, 64, 64): # Axes color (#404040)
|
|
331
|
+
return None
|
|
332
|
+
|
|
333
|
+
# Convert RGB to ID
|
|
334
|
+
element_id = r * 65536 + g * 256 + b
|
|
335
|
+
|
|
336
|
+
# Look up in color_map
|
|
337
|
+
if str(element_id) in color_map:
|
|
338
|
+
info = color_map[str(element_id)]
|
|
339
|
+
return {
|
|
340
|
+
'type': 'data_element',
|
|
341
|
+
'element_id': element_id,
|
|
342
|
+
'element_type': info.get('type', 'unknown'),
|
|
343
|
+
'label': info.get('label', ''),
|
|
344
|
+
'axes_index': info.get('axes_index', 0),
|
|
345
|
+
'rgb': [r, g, b],
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return None
|
|
349
|
+
|
|
350
|
+
def _point_in_bbox(self, x: int, y: int, bbox: list) -> bool:
|
|
351
|
+
"""Check if point (x, y) is within bounding box [x0, y0, x1, y1]."""
|
|
352
|
+
x0, y0, x1, y1 = bbox
|
|
353
|
+
return x0 <= x <= x1 and y0 <= y <= y1
|
|
354
|
+
|
|
355
|
+
def _show_selection(self, info: Dict[str, Any]):
|
|
356
|
+
"""Display selection info in UI."""
|
|
357
|
+
if info['type'] == 'data_element':
|
|
358
|
+
text = f"Selected: {info['element_type']} - {info.get('label', 'unnamed')}"
|
|
359
|
+
detail = f"ID: {info['element_id']}, Axes: {info['axes_index']}"
|
|
360
|
+
else:
|
|
361
|
+
text = f"Selected: {info['type']}"
|
|
362
|
+
if 'text' in info:
|
|
363
|
+
text += f" - \"{info['text']}\""
|
|
364
|
+
detail = f"Axes: {info.get('axes_index', 0)}"
|
|
365
|
+
|
|
366
|
+
self.selection_label.setText(f"{text}\n{detail}")
|
|
367
|
+
self.status_bar.showMessage(text)
|
|
368
|
+
|
|
184
369
|
def _create_control_panel(self, parent):
|
|
185
370
|
"""Create the control panel with property editors."""
|
|
186
371
|
scroll_area = self.QtWidgets.QScrollArea()
|
|
@@ -237,19 +422,19 @@ class QtEditorWindow:
|
|
|
237
422
|
layout = self.QtWidgets.QFormLayout(group)
|
|
238
423
|
|
|
239
424
|
self.title_edit = self.QtWidgets.QLineEdit(
|
|
240
|
-
self.editor.current_overrides.get(
|
|
425
|
+
self.editor.current_overrides.get("title", "")
|
|
241
426
|
)
|
|
242
427
|
self.title_edit.editingFinished.connect(self._on_value_change)
|
|
243
428
|
layout.addRow("Title:", self.title_edit)
|
|
244
429
|
|
|
245
430
|
self.xlabel_edit = self.QtWidgets.QLineEdit(
|
|
246
|
-
self.editor.current_overrides.get(
|
|
431
|
+
self.editor.current_overrides.get("xlabel", "")
|
|
247
432
|
)
|
|
248
433
|
self.xlabel_edit.editingFinished.connect(self._on_value_change)
|
|
249
434
|
layout.addRow("X Label:", self.xlabel_edit)
|
|
250
435
|
|
|
251
436
|
self.ylabel_edit = self.QtWidgets.QLineEdit(
|
|
252
|
-
self.editor.current_overrides.get(
|
|
437
|
+
self.editor.current_overrides.get("ylabel", "")
|
|
253
438
|
)
|
|
254
439
|
self.ylabel_edit.editingFinished.connect(self._on_value_change)
|
|
255
440
|
layout.addRow("Y Label:", self.ylabel_edit)
|
|
@@ -261,8 +446,8 @@ class QtEditorWindow:
|
|
|
261
446
|
group = self._create_group_box("Axis Limits")
|
|
262
447
|
layout = self.QtWidgets.QGridLayout(group)
|
|
263
448
|
|
|
264
|
-
xlim = self.editor.current_overrides.get(
|
|
265
|
-
ylim = self.editor.current_overrides.get(
|
|
449
|
+
xlim = self.editor.current_overrides.get("xlim", [0, 1])
|
|
450
|
+
ylim = self.editor.current_overrides.get("ylim", [0, 1])
|
|
266
451
|
|
|
267
452
|
layout.addWidget(self.QtWidgets.QLabel("X Min:"), 0, 0)
|
|
268
453
|
self.xmin_spin = self.QtWidgets.QDoubleSpinBox()
|
|
@@ -306,7 +491,9 @@ class QtEditorWindow:
|
|
|
306
491
|
self.linewidth_spin = self.QtWidgets.QDoubleSpinBox()
|
|
307
492
|
self.linewidth_spin.setRange(0.1, 10.0)
|
|
308
493
|
self.linewidth_spin.setSingleStep(0.1)
|
|
309
|
-
self.linewidth_spin.setValue(
|
|
494
|
+
self.linewidth_spin.setValue(
|
|
495
|
+
self.editor.current_overrides.get("linewidth", 1.0)
|
|
496
|
+
)
|
|
310
497
|
self.linewidth_spin.valueChanged.connect(self._on_value_change)
|
|
311
498
|
layout.addRow("Line Width (pt):", self.linewidth_spin)
|
|
312
499
|
|
|
@@ -319,25 +506,33 @@ class QtEditorWindow:
|
|
|
319
506
|
|
|
320
507
|
self.title_fontsize_spin = self.QtWidgets.QSpinBox()
|
|
321
508
|
self.title_fontsize_spin.setRange(6, 24)
|
|
322
|
-
self.title_fontsize_spin.setValue(
|
|
509
|
+
self.title_fontsize_spin.setValue(
|
|
510
|
+
self.editor.current_overrides.get("title_fontsize", 8)
|
|
511
|
+
)
|
|
323
512
|
self.title_fontsize_spin.valueChanged.connect(self._on_value_change)
|
|
324
513
|
layout.addRow("Title Font Size:", self.title_fontsize_spin)
|
|
325
514
|
|
|
326
515
|
self.axis_fontsize_spin = self.QtWidgets.QSpinBox()
|
|
327
516
|
self.axis_fontsize_spin.setRange(6, 24)
|
|
328
|
-
self.axis_fontsize_spin.setValue(
|
|
517
|
+
self.axis_fontsize_spin.setValue(
|
|
518
|
+
self.editor.current_overrides.get("axis_fontsize", 7)
|
|
519
|
+
)
|
|
329
520
|
self.axis_fontsize_spin.valueChanged.connect(self._on_value_change)
|
|
330
521
|
layout.addRow("Axis Font Size:", self.axis_fontsize_spin)
|
|
331
522
|
|
|
332
523
|
self.tick_fontsize_spin = self.QtWidgets.QSpinBox()
|
|
333
524
|
self.tick_fontsize_spin.setRange(6, 24)
|
|
334
|
-
self.tick_fontsize_spin.setValue(
|
|
525
|
+
self.tick_fontsize_spin.setValue(
|
|
526
|
+
self.editor.current_overrides.get("tick_fontsize", 7)
|
|
527
|
+
)
|
|
335
528
|
self.tick_fontsize_spin.valueChanged.connect(self._on_value_change)
|
|
336
529
|
layout.addRow("Tick Font Size:", self.tick_fontsize_spin)
|
|
337
530
|
|
|
338
531
|
self.legend_fontsize_spin = self.QtWidgets.QSpinBox()
|
|
339
532
|
self.legend_fontsize_spin.setRange(4, 20)
|
|
340
|
-
self.legend_fontsize_spin.setValue(
|
|
533
|
+
self.legend_fontsize_spin.setValue(
|
|
534
|
+
self.editor.current_overrides.get("legend_fontsize", 6)
|
|
535
|
+
)
|
|
341
536
|
self.legend_fontsize_spin.valueChanged.connect(self._on_value_change)
|
|
342
537
|
layout.addRow("Legend Font Size:", self.legend_fontsize_spin)
|
|
343
538
|
|
|
@@ -350,28 +545,32 @@ class QtEditorWindow:
|
|
|
350
545
|
|
|
351
546
|
self.n_ticks_spin = self.QtWidgets.QSpinBox()
|
|
352
547
|
self.n_ticks_spin.setRange(2, 15)
|
|
353
|
-
self.n_ticks_spin.setValue(self.editor.current_overrides.get(
|
|
548
|
+
self.n_ticks_spin.setValue(self.editor.current_overrides.get("n_ticks", 4))
|
|
354
549
|
self.n_ticks_spin.valueChanged.connect(self._on_value_change)
|
|
355
550
|
layout.addRow("N Ticks:", self.n_ticks_spin)
|
|
356
551
|
|
|
357
552
|
self.tick_length_spin = self.QtWidgets.QDoubleSpinBox()
|
|
358
553
|
self.tick_length_spin.setRange(0.1, 5.0)
|
|
359
554
|
self.tick_length_spin.setSingleStep(0.1)
|
|
360
|
-
self.tick_length_spin.setValue(
|
|
555
|
+
self.tick_length_spin.setValue(
|
|
556
|
+
self.editor.current_overrides.get("tick_length", 0.8)
|
|
557
|
+
)
|
|
361
558
|
self.tick_length_spin.valueChanged.connect(self._on_value_change)
|
|
362
559
|
layout.addRow("Tick Length (mm):", self.tick_length_spin)
|
|
363
560
|
|
|
364
561
|
self.tick_width_spin = self.QtWidgets.QDoubleSpinBox()
|
|
365
562
|
self.tick_width_spin.setRange(0.05, 2.0)
|
|
366
563
|
self.tick_width_spin.setSingleStep(0.05)
|
|
367
|
-
self.tick_width_spin.setValue(
|
|
564
|
+
self.tick_width_spin.setValue(
|
|
565
|
+
self.editor.current_overrides.get("tick_width", 0.2)
|
|
566
|
+
)
|
|
368
567
|
self.tick_width_spin.valueChanged.connect(self._on_value_change)
|
|
369
568
|
layout.addRow("Tick Width (mm):", self.tick_width_spin)
|
|
370
569
|
|
|
371
570
|
self.tick_direction_combo = self.QtWidgets.QComboBox()
|
|
372
571
|
self.tick_direction_combo.addItems(["out", "in", "inout"])
|
|
373
572
|
self.tick_direction_combo.setCurrentText(
|
|
374
|
-
self.editor.current_overrides.get(
|
|
573
|
+
self.editor.current_overrides.get("tick_direction", "out")
|
|
375
574
|
)
|
|
376
575
|
self.tick_direction_combo.currentTextChanged.connect(self._on_value_change)
|
|
377
576
|
layout.addRow("Tick Direction:", self.tick_direction_combo)
|
|
@@ -384,27 +583,27 @@ class QtEditorWindow:
|
|
|
384
583
|
layout = self.QtWidgets.QFormLayout(group)
|
|
385
584
|
|
|
386
585
|
self.grid_check = self.QtWidgets.QCheckBox()
|
|
387
|
-
self.grid_check.setChecked(self.editor.current_overrides.get(
|
|
586
|
+
self.grid_check.setChecked(self.editor.current_overrides.get("grid", False))
|
|
388
587
|
self.grid_check.stateChanged.connect(self._on_value_change)
|
|
389
588
|
layout.addRow("Show Grid:", self.grid_check)
|
|
390
589
|
|
|
391
590
|
self.hide_top_spine_check = self.QtWidgets.QCheckBox()
|
|
392
591
|
self.hide_top_spine_check.setChecked(
|
|
393
|
-
self.editor.current_overrides.get(
|
|
592
|
+
self.editor.current_overrides.get("hide_top_spine", True)
|
|
394
593
|
)
|
|
395
594
|
self.hide_top_spine_check.stateChanged.connect(self._on_value_change)
|
|
396
595
|
layout.addRow("Hide Top Spine:", self.hide_top_spine_check)
|
|
397
596
|
|
|
398
597
|
self.hide_right_spine_check = self.QtWidgets.QCheckBox()
|
|
399
598
|
self.hide_right_spine_check.setChecked(
|
|
400
|
-
self.editor.current_overrides.get(
|
|
599
|
+
self.editor.current_overrides.get("hide_right_spine", True)
|
|
401
600
|
)
|
|
402
601
|
self.hide_right_spine_check.stateChanged.connect(self._on_value_change)
|
|
403
602
|
layout.addRow("Hide Right Spine:", self.hide_right_spine_check)
|
|
404
603
|
|
|
405
604
|
self.transparent_check = self.QtWidgets.QCheckBox()
|
|
406
605
|
self.transparent_check.setChecked(
|
|
407
|
-
self.editor.current_overrides.get(
|
|
606
|
+
self.editor.current_overrides.get("transparent", True)
|
|
408
607
|
)
|
|
409
608
|
self.transparent_check.stateChanged.connect(self._on_value_change)
|
|
410
609
|
layout.addRow("Transparent BG:", self.transparent_check)
|
|
@@ -412,12 +611,14 @@ class QtEditorWindow:
|
|
|
412
611
|
self.axis_width_spin = self.QtWidgets.QDoubleSpinBox()
|
|
413
612
|
self.axis_width_spin.setRange(0.05, 2.0)
|
|
414
613
|
self.axis_width_spin.setSingleStep(0.05)
|
|
415
|
-
self.axis_width_spin.setValue(
|
|
614
|
+
self.axis_width_spin.setValue(
|
|
615
|
+
self.editor.current_overrides.get("axis_width", 0.2)
|
|
616
|
+
)
|
|
416
617
|
self.axis_width_spin.valueChanged.connect(self._on_value_change)
|
|
417
618
|
layout.addRow("Axis Width (mm):", self.axis_width_spin)
|
|
418
619
|
|
|
419
620
|
# Background color button
|
|
420
|
-
self.bg_color = self.editor.current_overrides.get(
|
|
621
|
+
self.bg_color = self.editor.current_overrides.get("facecolor", "#ffffff")
|
|
421
622
|
self.bg_color_btn = self.QtWidgets.QPushButton("Choose...")
|
|
422
623
|
self.bg_color_btn.clicked.connect(self._choose_bg_color)
|
|
423
624
|
layout.addRow("Background Color:", self.bg_color_btn)
|
|
@@ -431,26 +632,35 @@ class QtEditorWindow:
|
|
|
431
632
|
|
|
432
633
|
self.legend_visible_check = self.QtWidgets.QCheckBox()
|
|
433
634
|
self.legend_visible_check.setChecked(
|
|
434
|
-
self.editor.current_overrides.get(
|
|
635
|
+
self.editor.current_overrides.get("legend_visible", True)
|
|
435
636
|
)
|
|
436
637
|
self.legend_visible_check.stateChanged.connect(self._on_value_change)
|
|
437
638
|
layout.addRow("Show Legend:", self.legend_visible_check)
|
|
438
639
|
|
|
439
640
|
self.legend_frameon_check = self.QtWidgets.QCheckBox()
|
|
440
641
|
self.legend_frameon_check.setChecked(
|
|
441
|
-
self.editor.current_overrides.get(
|
|
642
|
+
self.editor.current_overrides.get("legend_frameon", False)
|
|
442
643
|
)
|
|
443
644
|
self.legend_frameon_check.stateChanged.connect(self._on_value_change)
|
|
444
645
|
layout.addRow("Show Frame:", self.legend_frameon_check)
|
|
445
646
|
|
|
446
647
|
self.legend_loc_combo = self.QtWidgets.QComboBox()
|
|
447
|
-
self.legend_loc_combo.addItems(
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
648
|
+
self.legend_loc_combo.addItems(
|
|
649
|
+
[
|
|
650
|
+
"best",
|
|
651
|
+
"upper right",
|
|
652
|
+
"upper left",
|
|
653
|
+
"lower right",
|
|
654
|
+
"lower left",
|
|
655
|
+
"center right",
|
|
656
|
+
"center left",
|
|
657
|
+
"upper center",
|
|
658
|
+
"lower center",
|
|
659
|
+
"center",
|
|
660
|
+
]
|
|
661
|
+
)
|
|
452
662
|
self.legend_loc_combo.setCurrentText(
|
|
453
|
-
self.editor.current_overrides.get(
|
|
663
|
+
self.editor.current_overrides.get("legend_loc", "best")
|
|
454
664
|
)
|
|
455
665
|
self.legend_loc_combo.currentTextChanged.connect(self._on_value_change)
|
|
456
666
|
layout.addRow("Position:", self.legend_loc_combo)
|
|
@@ -462,7 +672,7 @@ class QtEditorWindow:
|
|
|
462
672
|
group = self._create_group_box("Dimensions")
|
|
463
673
|
layout = self.QtWidgets.QFormLayout(group)
|
|
464
674
|
|
|
465
|
-
fig_size = self.editor.current_overrides.get(
|
|
675
|
+
fig_size = self.editor.current_overrides.get("fig_size", [3.15, 2.68])
|
|
466
676
|
|
|
467
677
|
self.fig_width_spin = self.QtWidgets.QDoubleSpinBox()
|
|
468
678
|
self.fig_width_spin.setRange(1.0, 20.0)
|
|
@@ -478,7 +688,7 @@ class QtEditorWindow:
|
|
|
478
688
|
|
|
479
689
|
self.dpi_spin = self.QtWidgets.QSpinBox()
|
|
480
690
|
self.dpi_spin.setRange(72, 600)
|
|
481
|
-
self.dpi_spin.setValue(self.editor.current_overrides.get(
|
|
691
|
+
self.dpi_spin.setValue(self.editor.current_overrides.get("dpi", 300))
|
|
482
692
|
self.dpi_spin.valueChanged.connect(self._on_value_change)
|
|
483
693
|
layout.addRow("DPI:", self.dpi_spin)
|
|
484
694
|
|
|
@@ -563,41 +773,41 @@ class QtEditorWindow:
|
|
|
563
773
|
o = self.editor.current_overrides
|
|
564
774
|
|
|
565
775
|
# Labels
|
|
566
|
-
o[
|
|
567
|
-
o[
|
|
568
|
-
o[
|
|
776
|
+
o["title"] = self.title_edit.text()
|
|
777
|
+
o["xlabel"] = self.xlabel_edit.text()
|
|
778
|
+
o["ylabel"] = self.ylabel_edit.text()
|
|
569
779
|
|
|
570
780
|
# Line style
|
|
571
|
-
o[
|
|
781
|
+
o["linewidth"] = self.linewidth_spin.value()
|
|
572
782
|
|
|
573
783
|
# Font settings
|
|
574
|
-
o[
|
|
575
|
-
o[
|
|
576
|
-
o[
|
|
577
|
-
o[
|
|
784
|
+
o["title_fontsize"] = self.title_fontsize_spin.value()
|
|
785
|
+
o["axis_fontsize"] = self.axis_fontsize_spin.value()
|
|
786
|
+
o["tick_fontsize"] = self.tick_fontsize_spin.value()
|
|
787
|
+
o["legend_fontsize"] = self.legend_fontsize_spin.value()
|
|
578
788
|
|
|
579
789
|
# Tick settings
|
|
580
|
-
o[
|
|
581
|
-
o[
|
|
582
|
-
o[
|
|
583
|
-
o[
|
|
790
|
+
o["n_ticks"] = self.n_ticks_spin.value()
|
|
791
|
+
o["tick_length"] = self.tick_length_spin.value()
|
|
792
|
+
o["tick_width"] = self.tick_width_spin.value()
|
|
793
|
+
o["tick_direction"] = self.tick_direction_combo.currentText()
|
|
584
794
|
|
|
585
795
|
# Style
|
|
586
|
-
o[
|
|
587
|
-
o[
|
|
588
|
-
o[
|
|
589
|
-
o[
|
|
590
|
-
o[
|
|
591
|
-
o[
|
|
796
|
+
o["grid"] = self.grid_check.isChecked()
|
|
797
|
+
o["hide_top_spine"] = self.hide_top_spine_check.isChecked()
|
|
798
|
+
o["hide_right_spine"] = self.hide_right_spine_check.isChecked()
|
|
799
|
+
o["transparent"] = self.transparent_check.isChecked()
|
|
800
|
+
o["axis_width"] = self.axis_width_spin.value()
|
|
801
|
+
o["facecolor"] = self.bg_color
|
|
592
802
|
|
|
593
803
|
# Legend
|
|
594
|
-
o[
|
|
595
|
-
o[
|
|
596
|
-
o[
|
|
804
|
+
o["legend_visible"] = self.legend_visible_check.isChecked()
|
|
805
|
+
o["legend_frameon"] = self.legend_frameon_check.isChecked()
|
|
806
|
+
o["legend_loc"] = self.legend_loc_combo.currentText()
|
|
597
807
|
|
|
598
808
|
# Dimensions
|
|
599
|
-
o[
|
|
600
|
-
o[
|
|
809
|
+
o["fig_size"] = [self.fig_width_spin.value(), self.fig_height_spin.value()]
|
|
810
|
+
o["dpi"] = self.dpi_spin.value()
|
|
601
811
|
|
|
602
812
|
def _apply_limits(self):
|
|
603
813
|
"""Apply axis limits."""
|
|
@@ -607,9 +817,9 @@ class QtEditorWindow:
|
|
|
607
817
|
ymax = self.ymax_spin.value()
|
|
608
818
|
|
|
609
819
|
if xmin < xmax:
|
|
610
|
-
self.editor.current_overrides[
|
|
820
|
+
self.editor.current_overrides["xlim"] = [xmin, xmax]
|
|
611
821
|
if ymin < ymax:
|
|
612
|
-
self.editor.current_overrides[
|
|
822
|
+
self.editor.current_overrides["ylim"] = [ymin, ymax]
|
|
613
823
|
|
|
614
824
|
self.editor._user_modified = True
|
|
615
825
|
self._render_figure()
|
|
@@ -619,7 +829,7 @@ class QtEditorWindow:
|
|
|
619
829
|
color = self.QtWidgets.QColorDialog.getColor()
|
|
620
830
|
if color.isValid():
|
|
621
831
|
self.bg_color = color.name()
|
|
622
|
-
self.editor.current_overrides[
|
|
832
|
+
self.editor.current_overrides["facecolor"] = self.bg_color
|
|
623
833
|
self._render_figure()
|
|
624
834
|
|
|
625
835
|
def _add_annotation(self):
|
|
@@ -631,16 +841,18 @@ class QtEditorWindow:
|
|
|
631
841
|
x = self.annot_x_spin.value()
|
|
632
842
|
y = self.annot_y_spin.value()
|
|
633
843
|
|
|
634
|
-
if
|
|
635
|
-
self.editor.current_overrides[
|
|
636
|
-
|
|
637
|
-
self.editor.current_overrides[
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
844
|
+
if "annotations" not in self.editor.current_overrides:
|
|
845
|
+
self.editor.current_overrides["annotations"] = []
|
|
846
|
+
|
|
847
|
+
self.editor.current_overrides["annotations"].append(
|
|
848
|
+
{
|
|
849
|
+
"type": "text",
|
|
850
|
+
"text": text,
|
|
851
|
+
"x": x,
|
|
852
|
+
"y": y,
|
|
853
|
+
"fontsize": self.editor.current_overrides.get("axis_fontsize", 7),
|
|
854
|
+
}
|
|
855
|
+
)
|
|
644
856
|
|
|
645
857
|
self.annot_text_edit.clear()
|
|
646
858
|
self._update_annotations_list()
|
|
@@ -650,7 +862,7 @@ class QtEditorWindow:
|
|
|
650
862
|
def _remove_annotation(self):
|
|
651
863
|
"""Remove selected annotation."""
|
|
652
864
|
row = self.annot_list.currentRow()
|
|
653
|
-
annotations = self.editor.current_overrides.get(
|
|
865
|
+
annotations = self.editor.current_overrides.get("annotations", [])
|
|
654
866
|
|
|
655
867
|
if row >= 0 and row < len(annotations):
|
|
656
868
|
del annotations[row]
|
|
@@ -661,11 +873,11 @@ class QtEditorWindow:
|
|
|
661
873
|
def _update_annotations_list(self):
|
|
662
874
|
"""Update the annotations list widget."""
|
|
663
875
|
self.annot_list.clear()
|
|
664
|
-
for ann in self.editor.current_overrides.get(
|
|
665
|
-
if ann.get(
|
|
666
|
-
text = ann.get(
|
|
667
|
-
x = ann.get(
|
|
668
|
-
y = ann.get(
|
|
876
|
+
for ann in self.editor.current_overrides.get("annotations", []):
|
|
877
|
+
if ann.get("type") == "text":
|
|
878
|
+
text = ann.get("text", "")[:20]
|
|
879
|
+
x = ann.get("x", 0)
|
|
880
|
+
y = ann.get("y", 0)
|
|
669
881
|
self.annot_list.addItem(f"{text} ({x:.2f}, {y:.2f})")
|
|
670
882
|
|
|
671
883
|
def _render_figure(self):
|
|
@@ -677,68 +889,74 @@ class QtEditorWindow:
|
|
|
677
889
|
mm_to_pt = 2.83465
|
|
678
890
|
|
|
679
891
|
# Background
|
|
680
|
-
if o.get(
|
|
681
|
-
self.fig.patch.set_facecolor(
|
|
682
|
-
self.ax.patch.set_facecolor(
|
|
892
|
+
if o.get("transparent", True):
|
|
893
|
+
self.fig.patch.set_facecolor("none")
|
|
894
|
+
self.ax.patch.set_facecolor("none")
|
|
683
895
|
else:
|
|
684
|
-
self.fig.patch.set_facecolor(o.get(
|
|
685
|
-
self.ax.patch.set_facecolor(o.get(
|
|
896
|
+
self.fig.patch.set_facecolor(o.get("facecolor", "#ffffff"))
|
|
897
|
+
self.ax.patch.set_facecolor(o.get("facecolor", "#ffffff"))
|
|
686
898
|
|
|
687
899
|
# Plot from CSV
|
|
688
900
|
if self.editor.csv_data is not None:
|
|
689
901
|
self._plot_from_csv(o)
|
|
690
902
|
else:
|
|
691
|
-
self.ax.text(
|
|
692
|
-
|
|
903
|
+
self.ax.text(
|
|
904
|
+
0.5,
|
|
905
|
+
0.5,
|
|
906
|
+
"No plot data available\n(CSV not found)",
|
|
907
|
+
ha="center",
|
|
908
|
+
va="center",
|
|
909
|
+
transform=self.ax.transAxes,
|
|
910
|
+
)
|
|
693
911
|
|
|
694
912
|
# Labels
|
|
695
|
-
if o.get(
|
|
696
|
-
self.ax.set_title(o[
|
|
697
|
-
if o.get(
|
|
698
|
-
self.ax.set_xlabel(o[
|
|
699
|
-
if o.get(
|
|
700
|
-
self.ax.set_ylabel(o[
|
|
913
|
+
if o.get("title"):
|
|
914
|
+
self.ax.set_title(o["title"], fontsize=o.get("title_fontsize", 8))
|
|
915
|
+
if o.get("xlabel"):
|
|
916
|
+
self.ax.set_xlabel(o["xlabel"], fontsize=o.get("axis_fontsize", 7))
|
|
917
|
+
if o.get("ylabel"):
|
|
918
|
+
self.ax.set_ylabel(o["ylabel"], fontsize=o.get("axis_fontsize", 7))
|
|
701
919
|
|
|
702
920
|
# Ticks
|
|
703
921
|
self.ax.tick_params(
|
|
704
|
-
axis=
|
|
705
|
-
labelsize=o.get(
|
|
706
|
-
length=o.get(
|
|
707
|
-
width=o.get(
|
|
708
|
-
direction=o.get(
|
|
922
|
+
axis="both",
|
|
923
|
+
labelsize=o.get("tick_fontsize", 7),
|
|
924
|
+
length=o.get("tick_length", 0.8) * mm_to_pt,
|
|
925
|
+
width=o.get("tick_width", 0.2) * mm_to_pt,
|
|
926
|
+
direction=o.get("tick_direction", "out"),
|
|
709
927
|
)
|
|
710
928
|
|
|
711
|
-
self.ax.xaxis.set_major_locator(MaxNLocator(nbins=o.get(
|
|
712
|
-
self.ax.yaxis.set_major_locator(MaxNLocator(nbins=o.get(
|
|
929
|
+
self.ax.xaxis.set_major_locator(MaxNLocator(nbins=o.get("n_ticks", 4)))
|
|
930
|
+
self.ax.yaxis.set_major_locator(MaxNLocator(nbins=o.get("n_ticks", 4)))
|
|
713
931
|
|
|
714
932
|
# Grid
|
|
715
|
-
if o.get(
|
|
716
|
-
self.ax.grid(True, linewidth=o.get(
|
|
933
|
+
if o.get("grid"):
|
|
934
|
+
self.ax.grid(True, linewidth=o.get("axis_width", 0.2) * mm_to_pt, alpha=0.3)
|
|
717
935
|
|
|
718
936
|
# Limits
|
|
719
|
-
if o.get(
|
|
720
|
-
self.ax.set_xlim(o[
|
|
721
|
-
if o.get(
|
|
722
|
-
self.ax.set_ylim(o[
|
|
937
|
+
if o.get("xlim"):
|
|
938
|
+
self.ax.set_xlim(o["xlim"])
|
|
939
|
+
if o.get("ylim"):
|
|
940
|
+
self.ax.set_ylim(o["ylim"])
|
|
723
941
|
|
|
724
942
|
# Spines
|
|
725
|
-
if o.get(
|
|
726
|
-
self.ax.spines[
|
|
727
|
-
if o.get(
|
|
728
|
-
self.ax.spines[
|
|
943
|
+
if o.get("hide_top_spine", True):
|
|
944
|
+
self.ax.spines["top"].set_visible(False)
|
|
945
|
+
if o.get("hide_right_spine", True):
|
|
946
|
+
self.ax.spines["right"].set_visible(False)
|
|
729
947
|
|
|
730
948
|
for spine in self.ax.spines.values():
|
|
731
|
-
spine.set_linewidth(o.get(
|
|
949
|
+
spine.set_linewidth(o.get("axis_width", 0.2) * mm_to_pt)
|
|
732
950
|
|
|
733
951
|
# Annotations
|
|
734
|
-
for ann in o.get(
|
|
735
|
-
if ann.get(
|
|
952
|
+
for ann in o.get("annotations", []):
|
|
953
|
+
if ann.get("type") == "text":
|
|
736
954
|
self.ax.text(
|
|
737
|
-
ann.get(
|
|
738
|
-
ann.get(
|
|
739
|
-
ann.get(
|
|
955
|
+
ann.get("x", 0.5),
|
|
956
|
+
ann.get("y", 0.5),
|
|
957
|
+
ann.get("text", ""),
|
|
740
958
|
transform=self.ax.transAxes,
|
|
741
|
-
fontsize=ann.get(
|
|
959
|
+
fontsize=ann.get("fontsize", o.get("axis_fontsize", 7)),
|
|
742
960
|
)
|
|
743
961
|
|
|
744
962
|
self.fig.tight_layout()
|
|
@@ -753,43 +971,49 @@ class QtEditorWindow:
|
|
|
753
971
|
return
|
|
754
972
|
|
|
755
973
|
df = self.editor.csv_data
|
|
756
|
-
linewidth = o.get(
|
|
757
|
-
legend_visible = o.get(
|
|
758
|
-
legend_fontsize = o.get(
|
|
759
|
-
legend_frameon = o.get(
|
|
760
|
-
legend_loc = o.get(
|
|
974
|
+
linewidth = o.get("linewidth", 1.0)
|
|
975
|
+
legend_visible = o.get("legend_visible", True)
|
|
976
|
+
legend_fontsize = o.get("legend_fontsize", 6)
|
|
977
|
+
legend_frameon = o.get("legend_frameon", False)
|
|
978
|
+
legend_loc = o.get("legend_loc", "best")
|
|
761
979
|
|
|
762
|
-
traces = o.get(
|
|
980
|
+
traces = o.get("traces", [])
|
|
763
981
|
|
|
764
982
|
if traces:
|
|
765
983
|
for trace in traces:
|
|
766
|
-
csv_cols = trace.get(
|
|
767
|
-
x_col = csv_cols.get(
|
|
768
|
-
y_col = csv_cols.get(
|
|
984
|
+
csv_cols = trace.get("csv_columns", {})
|
|
985
|
+
x_col = csv_cols.get("x")
|
|
986
|
+
y_col = csv_cols.get("y")
|
|
769
987
|
|
|
770
988
|
if x_col in df.columns and y_col in df.columns:
|
|
771
989
|
self.ax.plot(
|
|
772
990
|
df[x_col],
|
|
773
991
|
df[y_col],
|
|
774
|
-
label=trace.get(
|
|
775
|
-
color=trace.get(
|
|
776
|
-
linestyle=trace.get(
|
|
777
|
-
linewidth=trace.get(
|
|
992
|
+
label=trace.get("label", trace.get("id", "")),
|
|
993
|
+
color=trace.get("color"),
|
|
994
|
+
linestyle=trace.get("linestyle", "-"),
|
|
995
|
+
linewidth=trace.get("linewidth", linewidth),
|
|
778
996
|
)
|
|
779
997
|
|
|
780
|
-
if legend_visible and any(t.get(
|
|
781
|
-
self.ax.legend(
|
|
998
|
+
if legend_visible and any(t.get("label") for t in traces):
|
|
999
|
+
self.ax.legend(
|
|
1000
|
+
fontsize=legend_fontsize, frameon=legend_frameon, loc=legend_loc
|
|
1001
|
+
)
|
|
782
1002
|
else:
|
|
783
1003
|
cols = df.columns.tolist()
|
|
784
1004
|
if len(cols) >= 2:
|
|
785
1005
|
x_col = cols[0]
|
|
786
1006
|
for y_col in cols[1:]:
|
|
787
1007
|
try:
|
|
788
|
-
self.ax.plot(
|
|
1008
|
+
self.ax.plot(
|
|
1009
|
+
df[x_col], df[y_col], label=str(y_col), linewidth=linewidth
|
|
1010
|
+
)
|
|
789
1011
|
except Exception:
|
|
790
1012
|
pass
|
|
791
1013
|
if len(cols) > 2 and legend_visible:
|
|
792
|
-
self.ax.legend(
|
|
1014
|
+
self.ax.legend(
|
|
1015
|
+
fontsize=legend_fontsize, frameon=legend_frameon, loc=legend_loc
|
|
1016
|
+
)
|
|
793
1017
|
|
|
794
1018
|
def _save_manual(self):
|
|
795
1019
|
"""Save to .manual.json."""
|
|
@@ -798,45 +1022,49 @@ class QtEditorWindow:
|
|
|
798
1022
|
try:
|
|
799
1023
|
self._collect_overrides()
|
|
800
1024
|
manual_path = save_manual_overrides(
|
|
801
|
-
self.editor.json_path,
|
|
802
|
-
self.editor.current_overrides
|
|
1025
|
+
self.editor.json_path, self.editor.current_overrides
|
|
803
1026
|
)
|
|
804
1027
|
self.status_bar.showMessage(f"Saved: {manual_path.name}")
|
|
805
1028
|
self.QtWidgets.QMessageBox.information(
|
|
806
|
-
self.window, "Saved",
|
|
807
|
-
f"Manual overrides saved to:\n{manual_path}"
|
|
1029
|
+
self.window, "Saved", f"Manual overrides saved to:\n{manual_path}"
|
|
808
1030
|
)
|
|
809
1031
|
except Exception as e:
|
|
810
1032
|
self.QtWidgets.QMessageBox.critical(
|
|
811
|
-
self.window, "Error",
|
|
812
|
-
f"Failed to save: {e}"
|
|
1033
|
+
self.window, "Error", f"Failed to save: {e}"
|
|
813
1034
|
)
|
|
814
1035
|
|
|
815
1036
|
def _reset_overrides(self):
|
|
816
1037
|
"""Reset to initial overrides."""
|
|
817
1038
|
reply = self.QtWidgets.QMessageBox.question(
|
|
818
|
-
self.window,
|
|
1039
|
+
self.window,
|
|
1040
|
+
"Reset",
|
|
819
1041
|
"Reset all changes to original values?",
|
|
820
|
-
self.QtWidgets.QMessageBox.StandardButton.Yes
|
|
821
|
-
self.QtWidgets.QMessageBox.StandardButton.No
|
|
822
|
-
if hasattr(self.QtWidgets.QMessageBox,
|
|
823
|
-
else self.QtWidgets.QMessageBox.Yes | self.QtWidgets.QMessageBox.No
|
|
1042
|
+
self.QtWidgets.QMessageBox.StandardButton.Yes
|
|
1043
|
+
| self.QtWidgets.QMessageBox.StandardButton.No
|
|
1044
|
+
if hasattr(self.QtWidgets.QMessageBox, "StandardButton")
|
|
1045
|
+
else self.QtWidgets.QMessageBox.Yes | self.QtWidgets.QMessageBox.No,
|
|
824
1046
|
)
|
|
825
1047
|
|
|
826
|
-
yes_val = (
|
|
827
|
-
|
|
828
|
-
|
|
1048
|
+
yes_val = (
|
|
1049
|
+
self.QtWidgets.QMessageBox.StandardButton.Yes
|
|
1050
|
+
if hasattr(self.QtWidgets.QMessageBox, "StandardButton")
|
|
1051
|
+
else self.QtWidgets.QMessageBox.Yes
|
|
1052
|
+
)
|
|
829
1053
|
|
|
830
1054
|
if reply == yes_val:
|
|
831
|
-
self.editor.current_overrides = copy.deepcopy(
|
|
1055
|
+
self.editor.current_overrides = copy.deepcopy(
|
|
1056
|
+
self.editor._initial_overrides
|
|
1057
|
+
)
|
|
832
1058
|
self.editor._user_modified = False
|
|
833
1059
|
|
|
834
1060
|
# Update UI
|
|
835
|
-
self.title_edit.setText(self.editor.current_overrides.get(
|
|
836
|
-
self.xlabel_edit.setText(self.editor.current_overrides.get(
|
|
837
|
-
self.ylabel_edit.setText(self.editor.current_overrides.get(
|
|
838
|
-
self.linewidth_spin.setValue(
|
|
839
|
-
|
|
1061
|
+
self.title_edit.setText(self.editor.current_overrides.get("title", ""))
|
|
1062
|
+
self.xlabel_edit.setText(self.editor.current_overrides.get("xlabel", ""))
|
|
1063
|
+
self.ylabel_edit.setText(self.editor.current_overrides.get("ylabel", ""))
|
|
1064
|
+
self.linewidth_spin.setValue(
|
|
1065
|
+
self.editor.current_overrides.get("linewidth", 1.0)
|
|
1066
|
+
)
|
|
1067
|
+
self.grid_check.setChecked(self.editor.current_overrides.get("grid", False))
|
|
840
1068
|
|
|
841
1069
|
self._update_annotations_list()
|
|
842
1070
|
self._render_figure()
|
|
@@ -845,19 +1073,22 @@ class QtEditorWindow:
|
|
|
845
1073
|
def _export_png(self):
|
|
846
1074
|
"""Export current view to PNG."""
|
|
847
1075
|
filepath, _ = self.QtWidgets.QFileDialog.getSaveFileName(
|
|
848
|
-
self.window,
|
|
849
|
-
|
|
850
|
-
"
|
|
1076
|
+
self.window,
|
|
1077
|
+
"Export PNG",
|
|
1078
|
+
str(self.editor.json_path.with_suffix(".edited.png")),
|
|
1079
|
+
"PNG files (*.png);;All files (*)",
|
|
851
1080
|
)
|
|
852
1081
|
|
|
853
1082
|
if filepath:
|
|
854
1083
|
self._collect_overrides()
|
|
855
1084
|
o = self.editor.current_overrides
|
|
856
|
-
dpi = o.get(
|
|
1085
|
+
dpi = o.get("dpi", 300)
|
|
857
1086
|
|
|
858
1087
|
self.fig.savefig(
|
|
859
|
-
filepath,
|
|
860
|
-
|
|
1088
|
+
filepath,
|
|
1089
|
+
dpi=dpi,
|
|
1090
|
+
bbox_inches="tight",
|
|
1091
|
+
transparent=o.get("transparent", True),
|
|
861
1092
|
)
|
|
862
1093
|
self.status_bar.showMessage(f"Exported: {Path(filepath).name}")
|
|
863
1094
|
|