scitex 2.10.3__py3-none-any.whl → 2.13.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. scitex/__init__.py +1 -4
  2. scitex/__main__.py +24 -5
  3. scitex/__version__.py +1 -1
  4. scitex/_install_guide.py +14 -2
  5. scitex/_optional_deps.py +33 -0
  6. scitex/ai/classification/reporters/_ClassificationReporter.py +1 -1
  7. scitex/ai/classification/timeseries/_TimeSeriesBlockingSplit.py +2 -2
  8. scitex/ai/classification/timeseries/_TimeSeriesCalendarSplit.py +2 -2
  9. scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit.py +2 -2
  10. scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit_v01-not-using-n_splits.py +2 -2
  11. scitex/ai/classification/timeseries/_TimeSeriesStratifiedSplit.py +2 -2
  12. scitex/ai/classification/timeseries/_normalize_timestamp.py +1 -1
  13. scitex/ai/metrics/_calc_seizure_prediction_metrics.py +1 -1
  14. scitex/ai/plt/_plot_feature_importance.py +1 -1
  15. scitex/ai/plt/_plot_learning_curve.py +1 -1
  16. scitex/ai/plt/_plot_optuna_study.py +1 -1
  17. scitex/ai/plt/_plot_pre_rec_curve.py +1 -1
  18. scitex/ai/plt/_plot_roc_curve.py +1 -1
  19. scitex/ai/plt/_stx_conf_mat.py +1 -1
  20. scitex/ai/training/_LearningCurveLogger.py +1 -1
  21. scitex/audio/mcp_server.py +38 -8
  22. scitex/bridge/_figrecipe.py +1 -1
  23. scitex/bridge/_helpers.py +1 -1
  24. scitex/bridge/_plt_vis.py +1 -1
  25. scitex/bridge/_stats_plt.py +1 -1
  26. scitex/bridge/_stats_vis.py +2 -2
  27. scitex/browser/automation/CookieHandler.py +1 -1
  28. scitex/browser/core/BrowserMixin.py +1 -1
  29. scitex/browser/core/ChromeProfileManager.py +1 -1
  30. scitex/browser/debugging/_browser_logger.py +1 -1
  31. scitex/browser/debugging/_highlight_element.py +1 -1
  32. scitex/browser/debugging/_show_grid.py +1 -1
  33. scitex/browser/interaction/click_center.py +1 -1
  34. scitex/browser/interaction/click_with_fallbacks.py +1 -1
  35. scitex/browser/interaction/close_popups.py +1 -1
  36. scitex/browser/interaction/fill_with_fallbacks.py +1 -1
  37. scitex/browser/pdf/click_download_for_chrome_pdf_viewer.py +1 -1
  38. scitex/browser/pdf/detect_chrome_pdf_viewer.py +1 -1
  39. scitex/browser/stealth/HumanBehavior.py +1 -1
  40. scitex/browser/stealth/StealthManager.py +1 -1
  41. scitex/{fig → canvas}/__init__.py +84 -96
  42. scitex/canvas/_mcp_handlers.py +372 -0
  43. scitex/canvas/_mcp_tool_schemas.py +219 -0
  44. scitex/{fig → canvas}/backend/_parser.py +1 -1
  45. scitex/{fig → canvas}/canvas.py +13 -14
  46. scitex/{fts/_fig/_editor → canvas/editor}/_defaults.py +2 -2
  47. scitex/{fig → canvas}/editor/edit/__init__.py +11 -14
  48. scitex/{fig → canvas}/editor/edit/bundle_resolver.py +56 -48
  49. scitex/{fig → canvas}/editor/edit/editor_launcher.py +79 -26
  50. scitex/{fts/_fig/_editor/_cui/_panel_loader.py → canvas/editor/edit/panel_loader.py} +8 -8
  51. scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_bbox.py +2 -1
  52. scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_core.py +84 -84
  53. scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_renderer.py +7 -6
  54. scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/static/css/features/canvas.css +2 -2
  55. scitex/{fig → canvas}/editor/flask_editor/static/css/features/panel-grid.css +1 -1
  56. scitex/{fig → canvas}/editor/flask_editor/static/js/core/api.js +3 -4
  57. scitex/{fig → canvas}/editor/flask_editor/static/js/editor/preview.js +5 -5
  58. scitex/{fig → canvas}/editor/flask_editor/templates/_html.py +3 -3
  59. scitex/{fig → canvas}/editor/flask_editor/templates/_scripts.py +10 -10
  60. scitex/{fig → canvas}/editor/flask_editor/templates/_styles.py +3 -3
  61. scitex/{fig → canvas}/io/__init__.py +32 -38
  62. scitex/{fig → canvas}/io/_bundle.py +217 -154
  63. scitex/{fig → canvas}/io/_canvas.py +1 -1
  64. scitex/{fig → canvas}/io/_data.py +1 -1
  65. scitex/{fig → canvas}/io/_export.py +1 -1
  66. scitex/{fig → canvas}/io/_load.py +1 -1
  67. scitex/{fig → canvas}/io/_panel.py +1 -1
  68. scitex/{fig → canvas}/io/_save.py +1 -1
  69. scitex/canvas/mcp_server.py +151 -0
  70. scitex/{fig → canvas}/model/__init__.py +1 -1
  71. scitex/{fig → canvas}/model/_annotations.py +1 -1
  72. scitex/{fig → canvas}/model/_axes.py +1 -1
  73. scitex/{fig → canvas}/model/_figure.py +1 -1
  74. scitex/{fig → canvas}/model/_guides.py +1 -1
  75. scitex/{fig → canvas}/model/_plot.py +1 -1
  76. scitex/{fig → canvas}/model/_styles.py +1 -1
  77. scitex/{fig → canvas}/utils/__init__.py +1 -1
  78. scitex/capture/mcp_server.py +41 -12
  79. scitex/cli/audio.py +233 -0
  80. scitex/cli/capture.py +307 -0
  81. scitex/cli/convert.py +10 -6
  82. scitex/cli/main.py +27 -4
  83. scitex/cli/repro.py +233 -0
  84. scitex/cli/resource.py +240 -0
  85. scitex/cli/stats.py +325 -0
  86. scitex/cli/template.py +236 -0
  87. scitex/cli/tex.py +286 -0
  88. scitex/cli/web.py +11 -12
  89. scitex/dev/__init__.py +3 -0
  90. scitex/dev/_pyproject.py +405 -0
  91. scitex/dev/plt/__init__.py +2 -2
  92. scitex/dev/plt/mpl/get_dir_ax.py +1 -1
  93. scitex/dev/plt/mpl/get_signatures.py +1 -1
  94. scitex/dev/plt/mpl/get_signatures_details.py +1 -1
  95. scitex/diagram/README.md +7 -7
  96. scitex/diagram/_mcp_handlers.py +400 -0
  97. scitex/diagram/_mcp_tool_schemas.py +157 -0
  98. scitex/diagram/mcp_server.py +151 -0
  99. scitex/dsp/_demo_sig.py +51 -5
  100. scitex/dsp/_mne.py +13 -2
  101. scitex/dsp/_modulation_index.py +15 -3
  102. scitex/dsp/_pac.py +23 -5
  103. scitex/dsp/_psd.py +16 -4
  104. scitex/dsp/_resample.py +24 -4
  105. scitex/dsp/_transform.py +16 -3
  106. scitex/dsp/add_noise.py +15 -1
  107. scitex/dsp/norm.py +17 -2
  108. scitex/dsp/reference.py +17 -1
  109. scitex/dsp/utils/_differential_bandpass_filters.py +20 -2
  110. scitex/dsp/utils/_zero_pad.py +18 -4
  111. scitex/dt/_normalize_timestamp.py +1 -1
  112. scitex/git/_session.py +1 -1
  113. scitex/io/__init__.py +7 -19
  114. scitex/io/_load.py +15 -19
  115. scitex/io/_load_modules/_canvas.py +2 -2
  116. scitex/io/_load_modules/_con.py +17 -6
  117. scitex/io/_load_modules/_eeg.py +28 -13
  118. scitex/io/_load_modules/_optuna.py +21 -63
  119. scitex/io/_load_modules/_torch.py +11 -3
  120. scitex/io/_save.py +11 -16
  121. scitex/io/_save_modules/__init__.py +6 -10
  122. scitex/io/_save_modules/_canvas.py +3 -3
  123. scitex/io/_save_modules/_optuna_study_as_csv_and_pngs.py +13 -2
  124. scitex/io/_save_modules/_plot_bundle.py +112 -0
  125. scitex/io/_save_modules/{_pltz_stx.py → _plot_scitex.py} +7 -7
  126. scitex/io/_save_modules/_stx_bundle.py +16 -16
  127. scitex/io/_save_modules/_torch.py +11 -3
  128. scitex/io/bundle/README.md +89 -80
  129. scitex/{fts/_bundle/_FTS.py → io/bundle/_Bundle.py} +197 -95
  130. scitex/io/bundle/__init__.py +67 -35
  131. scitex/{fts/_bundle → io/bundle}/_children.py +32 -40
  132. scitex/io/bundle/_core.py +184 -97
  133. scitex/{fts/_bundle/_dataclasses/_Node.py → io/bundle/_dataclasses/_Spec.py} +29 -23
  134. scitex/{fts/_bundle/_dataclasses/_NodeRefs.py → io/bundle/_dataclasses/_SpecRefs.py} +6 -6
  135. scitex/{fts/_bundle → io/bundle}/_dataclasses/__init__.py +4 -4
  136. scitex/{fts/_bundle → io/bundle}/_loader.py +19 -19
  137. scitex/io/bundle/_manifest.py +99 -0
  138. scitex/{fts/_bundle → io/bundle}/_mpl_helpers.py +119 -28
  139. scitex/io/bundle/_nested.py +113 -100
  140. scitex/{fts/_bundle → io/bundle}/_saver.py +13 -14
  141. scitex/{fts/_bundle → io/bundle}/_storage.py +3 -3
  142. scitex/io/bundle/_types.py +41 -16
  143. scitex/{fts/_bundle → io/bundle}/_validation.py +20 -18
  144. scitex/io/bundle/_zip.py +21 -31
  145. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_backend/_parser.py +1 -1
  146. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Annotations.py +1 -1
  147. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Axes.py +1 -1
  148. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Figure.py +1 -1
  149. scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Guides.py +1 -1
  150. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Plot.py +1 -1
  151. scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Styles.py +1 -1
  152. scitex/{fts/_kinds → io/bundle/kinds}/_plot/_utils/_plot_layout.py +1 -1
  153. scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/__init__.py +1 -1
  154. scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/_app.py +1 -1
  155. scitex/{fts/_tables → io/bundle/kinds/_table}/_latex/_export.py +1 -1
  156. scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_figure_exporter.py +1 -1
  157. scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_table_exporter.py +1 -1
  158. scitex/io/bundle/schemas/__init__.py +30 -0
  159. scitex/mcp_server.py +159 -0
  160. scitex/parallel/_run.py +5 -4
  161. scitex/path/_find.py +60 -83
  162. scitex/path/_get_module_path.py +23 -21
  163. scitex/path/_get_spath.py +6 -27
  164. scitex/path/_getsize.py +23 -9
  165. scitex/path/_increment_version.py +31 -38
  166. scitex/path/_mk_spath.py +26 -29
  167. scitex/path/_path.py +5 -12
  168. scitex/path/_split.py +27 -15
  169. scitex/path/_this_path.py +23 -9
  170. scitex/plt/_mcp_handlers.py +361 -0
  171. scitex/plt/_mcp_tool_schemas.py +169 -0
  172. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +2 -1
  173. scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +2 -2
  174. scitex/plt/gallery/_generate.py +76 -50
  175. scitex/plt/io/__init__.py +17 -19
  176. scitex/plt/io/_bundle.py +99 -52
  177. scitex/plt/io/_layered_bundle.py +303 -168
  178. scitex/plt/mcp_server.py +205 -0
  179. scitex/plt/utils/_csv_column_naming.py +250 -118
  180. scitex/repro/README_RandomStateManager.md +3 -3
  181. scitex/repro/_RandomStateManager.py +14 -14
  182. scitex/repro/_gen_ID.py +1 -1
  183. scitex/repro/_gen_timestamp.py +1 -1
  184. scitex/repro/_hash_array.py +4 -4
  185. scitex/schema/__init__.py +69 -73
  186. scitex/schema/_canvas.py +1 -1
  187. scitex/schema/_stats.py +2 -2
  188. scitex/scholar/__main__.py +24 -2
  189. scitex/scholar/_mcp_handlers.py +685 -0
  190. scitex/scholar/_mcp_tool_schemas.py +339 -0
  191. scitex/scholar/docs/template.py +1 -1
  192. scitex/scholar/examples/07_storage_integration.py +1 -1
  193. scitex/scholar/impact_factor/jcr/ImpactFactorJCREngine.py +1 -1
  194. scitex/scholar/impact_factor/jcr/build_database.py +1 -1
  195. scitex/scholar/mcp_server.py +315 -0
  196. scitex/scholar/pdf_download/ScholarPDFDownloader.py +1 -1
  197. scitex/scholar/pipelines/ScholarPipelineBibTeX.py +1 -1
  198. scitex/scholar/pipelines/ScholarPipelineParallel.py +1 -1
  199. scitex/scholar/pipelines/ScholarPipelineSingle.py +1 -1
  200. scitex/scholar/storage/PaperIO.py +1 -1
  201. scitex/session/README.md +4 -4
  202. scitex/session/__init__.py +1 -1
  203. scitex/session/_decorator.py +9 -9
  204. scitex/session/_lifecycle.py +5 -5
  205. scitex/session/template.py +1 -1
  206. scitex/stats/__init__.py +30 -33
  207. scitex/stats/__main__.py +281 -0
  208. scitex/stats/_mcp_handlers.py +1191 -0
  209. scitex/stats/_mcp_tool_schemas.py +384 -0
  210. scitex/stats/_schema.py +1 -1
  211. scitex/stats/correct/_correct_bonferroni.py +1 -1
  212. scitex/stats/correct/_correct_fdr.py +1 -1
  213. scitex/stats/correct/_correct_fdr_.py +1 -1
  214. scitex/stats/correct/_correct_holm.py +1 -1
  215. scitex/stats/correct/_correct_sidak.py +1 -1
  216. scitex/stats/effect_sizes/_cliffs_delta.py +1 -1
  217. scitex/stats/effect_sizes/_cohens_d.py +1 -1
  218. scitex/stats/effect_sizes/_epsilon_squared.py +1 -1
  219. scitex/stats/effect_sizes/_eta_squared.py +1 -1
  220. scitex/stats/effect_sizes/_prob_superiority.py +1 -1
  221. scitex/stats/io/__init__.py +10 -11
  222. scitex/stats/io/_bundle.py +16 -16
  223. scitex/stats/mcp_server.py +405 -0
  224. scitex/stats/posthoc/_dunnett.py +1 -1
  225. scitex/stats/posthoc/_games_howell.py +1 -1
  226. scitex/stats/posthoc/_tukey_hsd.py +1 -1
  227. scitex/stats/power/_power.py +1 -1
  228. scitex/stats/utils/_effect_size.py +1 -1
  229. scitex/stats/utils/_formatters.py +1 -1
  230. scitex/stats/utils/_power.py +1 -1
  231. scitex/template/_mcp_handlers.py +259 -0
  232. scitex/template/_mcp_tool_schemas.py +112 -0
  233. scitex/template/mcp_server.py +186 -0
  234. scitex/utils/_verify_scitex_format.py +2 -2
  235. scitex/utils/template.py +1 -1
  236. scitex/web/__init__.py +12 -11
  237. scitex/web/_scraping.py +26 -265
  238. scitex/web/download_images.py +316 -0
  239. scitex/writer/Writer.py +1 -1
  240. scitex/writer/_clone_writer_project.py +1 -1
  241. scitex/writer/_validate_tree_structures.py +1 -1
  242. scitex/writer/dataclasses/config/_WriterConfig.py +1 -1
  243. scitex/writer/dataclasses/contents/_ManuscriptContents.py +1 -1
  244. scitex/writer/dataclasses/core/_Document.py +1 -1
  245. scitex/writer/dataclasses/core/_DocumentSection.py +1 -1
  246. scitex/writer/dataclasses/results/_CompilationResult.py +1 -1
  247. scitex/writer/dataclasses/results/_LaTeXIssue.py +1 -1
  248. scitex/writer/utils/.legacy_git_retry.py +7 -5
  249. scitex/writer/utils/_parse_latex_logs.py +1 -1
  250. scitex-2.13.0.dist-info/METADATA +1231 -0
  251. {scitex-2.10.3.dist-info → scitex-2.13.0.dist-info}/RECORD +376 -470
  252. scitex-2.13.0.dist-info/entry_points.txt +11 -0
  253. scitex/fig/editor/_defaults.py +0 -300
  254. scitex/fig/editor/edit/panel_loader.py +0 -232
  255. scitex/fig/editor/flask_editor/_bbox.py +0 -1299
  256. scitex/fig/editor/flask_editor/_core.py +0 -1429
  257. scitex/fig/editor/flask_editor/_renderer.py +0 -813
  258. scitex/fig/editor/flask_editor/static/css/features/canvas.css +0 -176
  259. scitex/fts/README.md +0 -262
  260. scitex/fts/TODO.md +0 -66
  261. scitex/fts/__init__.py +0 -90
  262. scitex/fts/_bundle/README_IN_BUNDLE.md +0 -102
  263. scitex/fts/_bundle/__init__.py +0 -38
  264. scitex/fts/_bundle/_utils/__init__.py +0 -55
  265. scitex/fts/_bundle/_utils/_const.py +0 -26
  266. scitex/fts/_bundle/_utils/_errors.py +0 -73
  267. scitex/fts/_bundle/_utils/_generate.py +0 -21
  268. scitex/fts/_bundle/_utils/_types.py +0 -76
  269. scitex/fts/_bundle/_zipbundle.py +0 -165
  270. scitex/fts/_fig/__init__.py +0 -22
  271. scitex/fts/_fig/_backend/_parser.py +0 -188
  272. scitex/fts/_fig/_editor/__init__.py +0 -14
  273. scitex/fts/_fig/_editor/_cui/__init__.py +0 -33
  274. scitex/fts/_fig/_editor/_cui/_backend_detector.py +0 -39
  275. scitex/fts/_fig/_editor/_cui/_bundle_resolver.py +0 -366
  276. scitex/fts/_fig/_editor/_cui/_editor_launcher.py +0 -175
  277. scitex/fts/_fig/_editor/_cui/_manual_handler.py +0 -52
  278. scitex/fts/_fig/_editor/_cui/_path_resolver.py +0 -66
  279. scitex/fts/_fig/_editor/_gui/__init__.py +0 -11
  280. scitex/fts/_fig/_editor/_gui/_flask_editor/__init__.py +0 -20
  281. scitex/fts/_fig/_editor/_gui/_flask_editor/_plotter.py +0 -664
  282. scitex/fts/_fig/_editor/_gui/_flask_editor/_utils.py +0 -79
  283. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/reset.css +0 -41
  284. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/typography.css +0 -16
  285. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/variables.css +0 -85
  286. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/buttons.css +0 -217
  287. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/context-menu.css +0 -93
  288. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/dropdown.css +0 -57
  289. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/forms.css +0 -112
  290. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/modal.css +0 -59
  291. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/sections.css +0 -212
  292. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/element-inspector.css +0 -190
  293. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/loading.css +0 -59
  294. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/overlay.css +0 -45
  295. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/panel-grid.css +0 -95
  296. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/selection.css +0 -101
  297. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/statistics.css +0 -138
  298. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/index.css +0 -31
  299. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/container.css +0 -7
  300. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/controls.css +0 -56
  301. scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/preview.css +0 -78
  302. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/axis.js +0 -314
  303. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/basic.js +0 -107
  304. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/distribute.js +0 -54
  305. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/canvas.js +0 -172
  306. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/dragging.js +0 -258
  307. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/resize.js +0 -48
  308. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/selection.js +0 -71
  309. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/api.js +0 -288
  310. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/state.js +0 -143
  311. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/utils.js +0 -245
  312. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/dev/element-inspector.js +0 -992
  313. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/bbox.js +0 -339
  314. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/element-drag.js +0 -286
  315. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/overlay.js +0 -371
  316. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/preview.js +0 -293
  317. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/main.js +0 -426
  318. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/context-menu.js +0 -152
  319. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/keyboard.js +0 -265
  320. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/controls.js +0 -184
  321. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/download.js +0 -57
  322. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/help.js +0 -100
  323. scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/theme.js +0 -34
  324. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/__init__.py +0 -124
  325. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_html.py +0 -851
  326. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_scripts.py +0 -4932
  327. scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_styles.py +0 -1657
  328. scitex/fts/_fig/_editor/_gui/_flask_editor.py +0 -36
  329. scitex/fts/_fig/_models/_Annotations.py +0 -115
  330. scitex/fts/_fig/_models/_Axes.py +0 -152
  331. scitex/fts/_fig/_models/_Figure.py +0 -138
  332. scitex/fts/_fig/_models/_Plot.py +0 -123
  333. scitex/fts/_fig/_utils/_plot_layout.py +0 -397
  334. scitex/fts/_kinds/_figure/_composite.py +0 -345
  335. scitex/fts/_kinds/_plot/_backend/__init__.py +0 -53
  336. scitex/fts/_kinds/_plot/_backend/_export.py +0 -165
  337. scitex/fts/_kinds/_plot/_backend/_render.py +0 -538
  338. scitex/fts/_kinds/_plot/_dataclasses/_ChannelEncoding.py +0 -46
  339. scitex/fts/_kinds/_plot/_dataclasses/_Encoding.py +0 -82
  340. scitex/fts/_kinds/_plot/_dataclasses/_Theme.py +0 -441
  341. scitex/fts/_kinds/_plot/_dataclasses/_TraceEncoding.py +0 -52
  342. scitex/fts/_kinds/_plot/_dataclasses/__init__.py +0 -47
  343. scitex/fts/_kinds/_plot/_models/_Guides.py +0 -104
  344. scitex/fts/_kinds/_plot/_models/_Styles.py +0 -245
  345. scitex/fts/_kinds/_plot/_models/__init__.py +0 -80
  346. scitex/fts/_kinds/_plot/_models/_plot_types/__init__.py +0 -156
  347. scitex/fts/_kinds/_plot/_models/_plot_types/_bar.py +0 -43
  348. scitex/fts/_kinds/_plot/_models/_plot_types/_box.py +0 -38
  349. scitex/fts/_kinds/_plot/_models/_plot_types/_distribution.py +0 -36
  350. scitex/fts/_kinds/_plot/_models/_plot_types/_errorbar.py +0 -60
  351. scitex/fts/_kinds/_plot/_models/_plot_types/_histogram.py +0 -30
  352. scitex/fts/_kinds/_plot/_models/_plot_types/_image.py +0 -61
  353. scitex/fts/_kinds/_plot/_models/_plot_types/_line.py +0 -57
  354. scitex/fts/_kinds/_plot/_models/_plot_types/_scatter.py +0 -30
  355. scitex/fts/_kinds/_plot/_models/_plot_types/_seaborn.py +0 -121
  356. scitex/fts/_kinds/_plot/_models/_plot_types/_violin.py +0 -36
  357. scitex/fts/_kinds/_plot/_utils/__init__.py +0 -129
  358. scitex/fts/_kinds/_plot/_utils/_auto_layout.py +0 -127
  359. scitex/fts/_kinds/_plot/_utils/_calc_bounds.py +0 -111
  360. scitex/fts/_kinds/_plot/_utils/_const_sizes.py +0 -48
  361. scitex/fts/_kinds/_plot/_utils/_convert_coords.py +0 -77
  362. scitex/fts/_kinds/_plot/_utils/_get_template.py +0 -178
  363. scitex/fts/_kinds/_plot/_utils/_normalize.py +0 -73
  364. scitex/fts/_kinds/_plot/_utils/_validate.py +0 -197
  365. scitex/fts/_kinds/_table/_latex/_export.py +0 -279
  366. scitex/fts/_stats/__init__.py +0 -48
  367. scitex/fts/_stats/_dataclasses/_Stats.py +0 -423
  368. scitex/fts/_stats/_dataclasses/__init__.py +0 -48
  369. scitex/fts/_tables/__init__.py +0 -65
  370. scitex/fts/_tables/_latex/__init__.py +0 -93
  371. scitex/fts/_tables/_latex/_editor/__init__.py +0 -11
  372. scitex/fts/_tables/_latex/_editor/_app.py +0 -725
  373. scitex/fts/_tables/_latex/_figure_exporter.py +0 -153
  374. scitex/fts/_tables/_latex/_stats_formatter.py +0 -274
  375. scitex/fts/_tables/_latex/_table_exporter.py +0 -362
  376. scitex/fts/_tables/_latex/_utils.py +0 -369
  377. scitex/fts/_tables/_latex/_validator.py +0 -445
  378. scitex/io/_save_modules/_pltz_bundle.py +0 -356
  379. scitex-2.10.3.dist-info/METADATA +0 -952
  380. scitex-2.10.3.dist-info/entry_points.txt +0 -2
  381. /scitex/{fig → canvas}/README.md +0 -0
  382. /scitex/{fig → canvas}/backend/__init__.py +0 -0
  383. /scitex/{fig → canvas}/backend/_export.py +0 -0
  384. /scitex/{fig → canvas}/backend/_render.py +0 -0
  385. /scitex/{fig → canvas}/docs/CANVAS_ARCHITECTURE.md +0 -0
  386. /scitex/{fig → canvas}/editor/__init__.py +0 -0
  387. /scitex/{fig → canvas}/editor/_dearpygui_editor.py +0 -0
  388. /scitex/{fig → canvas}/editor/_flask_editor.py +0 -0
  389. /scitex/{fig → canvas}/editor/_mpl_editor.py +0 -0
  390. /scitex/{fig → canvas}/editor/_qt_editor.py +0 -0
  391. /scitex/{fig → canvas}/editor/_tkinter_editor.py +0 -0
  392. /scitex/{fig → canvas}/editor/edit/backend_detector.py +0 -0
  393. /scitex/{fig → canvas}/editor/edit/manual_handler.py +0 -0
  394. /scitex/{fig → canvas}/editor/edit/path_resolver.py +0 -0
  395. /scitex/{fig → canvas}/editor/flask_editor/__init__.py +0 -0
  396. /scitex/{fig → canvas}/editor/flask_editor/_plotter.py +0 -0
  397. /scitex/{fig → canvas}/editor/flask_editor/_utils.py +0 -0
  398. /scitex/{fig → canvas}/editor/flask_editor/static/css/base/reset.css +0 -0
  399. /scitex/{fig → canvas}/editor/flask_editor/static/css/base/typography.css +0 -0
  400. /scitex/{fig → canvas}/editor/flask_editor/static/css/base/variables.css +0 -0
  401. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/buttons.css +0 -0
  402. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/context-menu.css +0 -0
  403. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/dropdown.css +0 -0
  404. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/forms.css +0 -0
  405. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/modal.css +0 -0
  406. /scitex/{fig → canvas}/editor/flask_editor/static/css/components/sections.css +0 -0
  407. /scitex/{fig → canvas}/editor/flask_editor/static/css/features/element-inspector.css +0 -0
  408. /scitex/{fig → canvas}/editor/flask_editor/static/css/features/loading.css +0 -0
  409. /scitex/{fig → canvas}/editor/flask_editor/static/css/features/overlay.css +0 -0
  410. /scitex/{fig → canvas}/editor/flask_editor/static/css/features/selection.css +0 -0
  411. /scitex/{fig → canvas}/editor/flask_editor/static/css/features/statistics.css +0 -0
  412. /scitex/{fig → canvas}/editor/flask_editor/static/css/index.css +0 -0
  413. /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/container.css +0 -0
  414. /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/controls.css +0 -0
  415. /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/preview.css +0 -0
  416. /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/axis.js +0 -0
  417. /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/basic.js +0 -0
  418. /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/distribute.js +0 -0
  419. /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/canvas.js +0 -0
  420. /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/dragging.js +0 -0
  421. /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/resize.js +0 -0
  422. /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/selection.js +0 -0
  423. /scitex/{fig → canvas}/editor/flask_editor/static/js/core/state.js +0 -0
  424. /scitex/{fig → canvas}/editor/flask_editor/static/js/core/utils.js +0 -0
  425. /scitex/{fig → canvas}/editor/flask_editor/static/js/dev/element-inspector.js +0 -0
  426. /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/bbox.js +0 -0
  427. /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/element-drag.js +0 -0
  428. /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/overlay.js +0 -0
  429. /scitex/{fig → canvas}/editor/flask_editor/static/js/main.js +0 -0
  430. /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/context-menu.js +0 -0
  431. /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/keyboard.js +0 -0
  432. /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/controls.js +0 -0
  433. /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/download.js +0 -0
  434. /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/help.js +0 -0
  435. /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/theme.js +0 -0
  436. /scitex/{fig → canvas}/editor/flask_editor/templates/__init__.py +0 -0
  437. /scitex/{fig → canvas}/io/_directory.py +0 -0
  438. /scitex/{fig → canvas}/model/_plot_types.py +0 -0
  439. /scitex/{fig → canvas}/utils/_defaults.py +0 -0
  440. /scitex/{fig → canvas}/utils/_validate.py +0 -0
  441. /scitex/{fts/_bundle → io/bundle}/_conversion/__init__.py +0 -0
  442. /scitex/{fts/_bundle → io/bundle}/_conversion/_bundle2dict.py +0 -0
  443. /scitex/{fts/_bundle → io/bundle}/_conversion/_dict2bundle.py +0 -0
  444. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_Axes.py +0 -0
  445. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_BBox.py +0 -0
  446. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_ColumnDef.py +0 -0
  447. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataFormat.py +0 -0
  448. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataInfo.py +0 -0
  449. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataSource.py +0 -0
  450. /scitex/{fts/_bundle → io/bundle}/_dataclasses/_SizeMM.py +0 -0
  451. /scitex/{fts/_bundle → io/bundle}/_extractors/__init__.py +0 -0
  452. /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_bar.py +0 -0
  453. /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_line.py +0 -0
  454. /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_scatter.py +0 -0
  455. /scitex/{fts/_kinds → io/bundle/kinds}/__init__.py +0 -0
  456. /scitex/{fts/_kinds → io/bundle/kinds}/_figure/__init__.py +0 -0
  457. /scitex/{fts/_fig → io/bundle/kinds/_figure}/_composite.py +0 -0
  458. /scitex/{fts/_kinds → io/bundle/kinds}/_plot/__init__.py +0 -0
  459. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/__init__.py +0 -0
  460. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_export.py +0 -0
  461. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_render.py +0 -0
  462. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_ChannelEncoding.py +0 -0
  463. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Encoding.py +0 -0
  464. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Theme.py +0 -0
  465. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_TraceEncoding.py +0 -0
  466. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/__init__.py +0 -0
  467. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/__init__.py +0 -0
  468. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/__init__.py +0 -0
  469. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_bar.py +0 -0
  470. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_box.py +0 -0
  471. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_distribution.py +0 -0
  472. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_errorbar.py +0 -0
  473. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_histogram.py +0 -0
  474. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_image.py +0 -0
  475. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_line.py +0 -0
  476. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_scatter.py +0 -0
  477. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_seaborn.py +0 -0
  478. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_violin.py +0 -0
  479. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/__init__.py +0 -0
  480. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_auto_layout.py +0 -0
  481. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_calc_bounds.py +0 -0
  482. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_const_sizes.py +0 -0
  483. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_convert_coords.py +0 -0
  484. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_get_template.py +0 -0
  485. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_normalize.py +0 -0
  486. /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_validate.py +0 -0
  487. /scitex/{fts/_kinds → io/bundle/kinds}/_shape/__init__.py +0 -0
  488. /scitex/{fts/_kinds → io/bundle/kinds}/_stats/__init__.py +0 -0
  489. /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/_Stats.py +0 -0
  490. /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/__init__.py +0 -0
  491. /scitex/{fts/_kinds → io/bundle/kinds}/_table/__init__.py +0 -0
  492. /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/__init__.py +0 -0
  493. /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_stats_formatter.py +0 -0
  494. /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_utils.py +0 -0
  495. /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_validator.py +0 -0
  496. /scitex/{fts/_kinds → io/bundle/kinds}/_text/__init__.py +0 -0
  497. /scitex/{fts/_schemas → io/bundle/schemas}/data_info.schema.json +0 -0
  498. /scitex/{fts/_schemas → io/bundle/schemas}/encoding.schema.json +0 -0
  499. /scitex/{fts/_schemas → io/bundle/schemas}/node.schema.json +0 -0
  500. /scitex/{fts/_schemas → io/bundle/schemas}/render_manifest.schema.json +0 -0
  501. /scitex/{fts/_schemas → io/bundle/schemas}/stats.schema.json +0 -0
  502. /scitex/{fts/_schemas → io/bundle/schemas}/theme.schema.json +0 -0
  503. {scitex-2.10.3.dist-info → scitex-2.13.0.dist-info}/WHEEL +0 -0
  504. {scitex-2.10.3.dist-info → scitex-2.13.0.dist-info}/licenses/LICENSE +0 -0
@@ -3,7 +3,7 @@
3
3
  # Timestamp: 2025-12-08
4
4
  # File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_load_modules/_canvas.py
5
5
  """
6
- Load canvas directory (.canvas) for scitex.fig.
6
+ Load canvas directory (.canvas) for scitex.canvas.
7
7
 
8
8
  Canvas directories are portable figure bundles containing:
9
9
  - canvas.json: Layout, panels, composition settings
@@ -100,7 +100,7 @@ def _load_canvas(
100
100
  # Return Canvas object by default
101
101
  if not as_dict:
102
102
  try:
103
- from scitex.fig.canvas import Canvas
103
+ from scitex.canvas.canvas import Canvas
104
104
 
105
105
  canvas_obj = Canvas.from_dict(canvas_dict)
106
106
  # Store reference to original directory for copying
@@ -1,20 +1,31 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-14 07:51:45 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/io/_load_modules/_con.py
5
4
 
6
5
  from typing import Any
7
6
 
8
- import mne
7
+ try:
8
+ import mne
9
+
10
+ MNE_AVAILABLE = True
11
+ except ImportError:
12
+ MNE_AVAILABLE = False
13
+ mne = None
9
14
 
10
15
 
11
16
  def _load_con(lpath: str, **kwargs) -> Any:
17
+ if not MNE_AVAILABLE:
18
+ raise ImportError(
19
+ "MNE-Python is not installed. Please install with: pip install mne"
20
+ )
21
+
12
22
  if not lpath.endswith(".con"):
13
23
  raise ValueError("File must have .con extension")
14
- obj = mne.io.read_raw_fif(lpath, preload=True, **kwargs)
15
- obj = obj.to_data_frame()
16
- obj["samp_rate"] = obj.info["sfreq"]
17
- return obj
24
+ raw = mne.io.read_raw_fif(lpath, preload=True, **kwargs)
25
+ sfreq = raw.info["sfreq"]
26
+ df = raw.to_data_frame()
27
+ df["samp_rate"] = sfreq
28
+ return df
18
29
 
19
30
 
20
31
  # EOF
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-14 07:56:27 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/io/_load_modules/_eeg.py
5
4
 
@@ -7,10 +6,16 @@ import os
7
6
  import warnings
8
7
  from typing import Any
9
8
 
10
- import mne
9
+ try:
10
+ import mne
11
11
 
12
+ MNE_AVAILABLE = True
13
+ except ImportError:
14
+ MNE_AVAILABLE = False
15
+ mne = None
12
16
 
13
- def _load_eeg_data(path: str, **kwargs) -> Any:
17
+
18
+ def _load_eeg_data(lpath: str, **kwargs) -> Any:
14
19
  """
15
20
  Load EEG data based on file extension and associated files using MNE-Python.
16
21
 
@@ -39,19 +44,24 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
39
44
  This function uses MNE-Python to load the EEG data. It automatically detects the file format
40
45
  based on the file extension and uses the appropriate MNE function to load the data.
41
46
  """
47
+ if not MNE_AVAILABLE:
48
+ raise ImportError(
49
+ "MNE-Python is not installed. Please install with: pip install mne"
50
+ )
51
+
42
52
  # Get the file extension
43
53
  extension = lpath.split(".")[-1]
44
54
 
45
55
  allowed_extensions = [
46
- ".vhdr",
47
- ".vmrk",
48
- ".edf",
49
- ".bdf",
50
- ".gdf",
51
- ".cnt",
52
- ".egi",
53
- ".eeg",
54
- ".set",
56
+ "vhdr",
57
+ "vmrk",
58
+ "edf",
59
+ "bdf",
60
+ "gdf",
61
+ "cnt",
62
+ "egi",
63
+ "eeg",
64
+ "set",
55
65
  ]
56
66
 
57
67
  if extension not in allowed_extensions:
@@ -59,6 +69,9 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
59
69
  f"File must have one of these extensions: {', '.join(allowed_extensions)}"
60
70
  )
61
71
 
72
+ # Remove preload from kwargs if present - we always use preload=True
73
+ kwargs.pop("preload", None)
74
+
62
75
  with warnings.catch_warnings():
63
76
  warnings.simplefilter("ignore", RuntimeWarning)
64
77
 
@@ -98,9 +111,11 @@ def _load_eeg_data(path: str, **kwargs) -> Any:
98
111
  lpath_v = lpath.replace(".eeg", ".vhdr")
99
112
  raw = mne.io.read_raw_brainvision(lpath_v, preload=True, **kwargs)
100
113
  # Nihon Koden
101
- if is_NihonKoden:
114
+ elif is_NihonKoden:
102
115
  # raw = mne.io.read_raw_nihon(lpath, preload=True, **kwargs)
103
116
  raw = mne.io.read_raw(lpath, preload=True, **kwargs)
117
+ else:
118
+ raise ValueError("No associated files found for .eeg file")
104
119
  else:
105
120
  raise ValueError(f"Unsupported file extension: {extension}")
106
121
 
@@ -1,10 +1,17 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-14 07:55:45 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/io/_load_modules/_optuna.py
5
4
 
6
5
  from ._yaml import _load_yaml
7
6
 
7
+ try:
8
+ import optuna
9
+
10
+ OPTUNA_AVAILABLE = True
11
+ except ImportError:
12
+ OPTUNA_AVAILABLE = False
13
+ optuna = None
14
+
8
15
 
9
16
  def load_yaml_as_an_optuna_dict(fpath_yaml, trial):
10
17
  """
@@ -31,7 +38,14 @@ def load_yaml_as_an_optuna_dict(fpath_yaml, trial):
31
38
  If the specified YAML file does not exist.
32
39
  ValueError
33
40
  If the YAML file contains invalid configuration for Optuna.
41
+ ImportError
42
+ If Optuna is not installed.
34
43
  """
44
+ if not OPTUNA_AVAILABLE:
45
+ raise ImportError(
46
+ "Optuna is not installed. Please install with: pip install optuna"
47
+ )
48
+
35
49
  _d = _load_yaml(fpath_yaml)
36
50
 
37
51
  for k, v in _d.items():
@@ -74,6 +88,8 @@ def load_study_rdb(study_name, rdb_raw_bytes_url):
74
88
  -------
75
89
  optuna.exceptions.StorageInvalidUsageError
76
90
  If there's an error loading the study from the storage.
91
+ ImportError
92
+ If Optuna is not installed.
77
93
 
78
94
  Example:
79
95
  --------
@@ -82,7 +98,10 @@ def load_study_rdb(study_name, rdb_raw_bytes_url):
82
98
  ... rdb_raw_bytes_url="sqlite:///path/to/your/study.db"
83
99
  ... )
84
100
  """
85
- import optuna
101
+ if not OPTUNA_AVAILABLE:
102
+ raise ImportError(
103
+ "Optuna is not installed. Please install with: pip install optuna"
104
+ )
86
105
 
87
106
  storage = optuna.storages.RDBStorage(url=rdb_raw_bytes_url)
88
107
  study = optuna.load_study(study_name=study_name, storage=storage)
@@ -90,65 +109,4 @@ def load_study_rdb(study_name, rdb_raw_bytes_url):
90
109
  return study
91
110
 
92
111
 
93
- def load_yaml_as_an_optuna_dict(fpath_yaml, trial):
94
- """
95
- Load a YAML file and convert it to an Optuna-compatible dictionary.
96
-
97
- Parameters:
98
- -----------
99
- fpath_yaml : str
100
- The path to the YAML file.
101
- trial : optuna.trial.Trial
102
- The Optuna trial object.
103
-
104
- Returns:
105
- --------
106
- dict
107
- A dictionary with Optuna-compatible parameter suggestions.
108
- """
109
- _d = _load_yaml(fpath_yaml)
110
-
111
- for k, v in _d.items():
112
- dist = v["distribution"]
113
-
114
- if dist == "categorical":
115
- _d[k] = trial.suggest_categorical(k, v["values"])
116
-
117
- elif dist == "uniform":
118
- _d[k] = trial.suggest_int(k, float(v["min"]), float(v["max"]))
119
-
120
- elif dist == "loguniform":
121
- _d[k] = trial.suggest_loguniform(k, float(v["min"]), float(v["max"]))
122
-
123
- elif dist == "intloguniform":
124
- _d[k] = trial.suggest_int(k, float(v["min"]), float(v["max"]), log=True)
125
-
126
- return _d
127
-
128
-
129
- def load_study_rdb(study_name, rdb_raw_bytes_url):
130
- """
131
- Load an Optuna study from a RDB storage.
132
-
133
- Parameters:
134
- -----------
135
- study_name : str
136
- The name of the Optuna study.
137
- rdb_raw_bytes_url : str
138
- The URL of the RDB storage.
139
-
140
- Returns:
141
- --------
142
- optuna.study.Study
143
- The loaded Optuna study object.
144
- """
145
- import optuna
146
-
147
- # rdb_raw_bytes_url = "sqlite:////tmp/fake/ywatanabe/_MicroNN_WindowSize-1.0-sec_MaxEpochs_100_2021-1216-1844/optuna_study_test_file#0.db"
148
- storage = optuna.storages.RDBStorage(url=rdb_raw_bytes_url)
149
- study = optuna.load_study(study_name=study_name, storage=storage)
150
- print(f"\nLoaded: {rdb_raw_bytes_url}\n")
151
- return study
152
-
153
-
154
112
  # EOF
@@ -1,13 +1,21 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-14 07:41:34 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/io/_load_modules/_torch.py
5
4
 
5
+ try:
6
+ import torch
7
+
8
+ TORCH_AVAILABLE = True
9
+ except ImportError:
10
+ TORCH_AVAILABLE = False
11
+
6
12
 
7
13
  def _load_torch(lpath, **kwargs):
8
14
  """Load PyTorch model/checkpoint file."""
9
- # Lazy import to avoid circular import issues
10
- import torch
15
+ if not TORCH_AVAILABLE:
16
+ raise ImportError(
17
+ "PyTorch is not installed. Please install with: pip install torch"
18
+ )
11
19
 
12
20
  if not lpath.endswith((".pth", ".pt")):
13
21
  raise ValueError("File must have .pth or .pt extension")
scitex/io/_save.py CHANGED
@@ -6,7 +6,7 @@
6
6
  Save utilities for various data types to different file formats.
7
7
 
8
8
  Supported formats include CSV, NPY, PKL, JOBLIB, PNG, HTML, TIFF, MP4, YAML,
9
- JSON, HDF5, PTH, MAT, CBM, and FTS bundles (.zip or directory).
9
+ JSON, HDF5, PTH, MAT, CBM, and SciTeX bundles (.zip or directory).
10
10
  """
11
11
 
12
12
  import inspect
@@ -40,8 +40,6 @@ from ._save_modules import (
40
40
  save_npz,
41
41
  save_pickle,
42
42
  save_pickle_compressed,
43
- save_pltz_bundle,
44
- save_stx_bundle,
45
43
  save_tex,
46
44
  save_text,
47
45
  save_torch,
@@ -53,12 +51,9 @@ from ._save_modules import (
53
51
 
54
52
  logger = logging.getLogger()
55
53
 
56
- # Re-export for backward compatibility
57
54
  _get_figure_with_data = get_figure_with_data
58
55
  _symlink = symlink
59
56
  _symlink_to = symlink_to
60
- _save_stx_bundle = save_stx_bundle
61
- _save_pltz_bundle = save_pltz_bundle
62
57
  _handle_image_with_csv = handle_image_with_csv
63
58
 
64
59
 
@@ -278,17 +273,17 @@ def _save(
278
273
  """Core dispatcher for saving objects to various formats."""
279
274
  ext = _os.path.splitext(spath)[1].lower()
280
275
 
281
- # Check if this is a matplotlib figure being saved to FTS bundle format
282
- # FTS bundles use .zip (archive) or no extension (directory)
276
+ # Check if this is a matplotlib figure being saved to SciTeX bundle format
277
+ # SciTeX bundles use .zip (archive) or no extension (directory)
283
278
  if _is_matplotlib_figure(obj):
284
- # Save as FTS bundle if:
279
+ # Save as SciTeX bundle if:
285
280
  # 1. Path ends with .zip (create ZIP bundle)
286
281
  # 2. Path has no extension and doesn't match other formats (create directory bundle)
287
282
  if ext == ".zip" or (ext == "" and not spath.endswith("/")):
288
- # Check if explicitly requesting FTS bundle or just .zip
283
+ # Check if explicitly requesting SciTeX bundle or just .zip
289
284
  # Pop as_zip from kwargs to avoid duplicate parameter error
290
285
  as_zip = kwargs.pop("as_zip", ext == ".zip")
291
- _save_fts_bundle(
286
+ _save_scitex_bundle(
292
287
  obj, spath, as_zip, verbose, symlink_from_cwd, symlink_to, **kwargs
293
288
  )
294
289
  return
@@ -348,12 +343,12 @@ def _is_matplotlib_figure(obj):
348
343
  return False
349
344
 
350
345
 
351
- def _save_fts_bundle(
346
+ def _save_scitex_bundle(
352
347
  obj, spath, as_zip, verbose, symlink_from_cwd, symlink_to_path, **kwargs
353
348
  ):
354
- """Save matplotlib figure as FTS bundle (.zip or directory).
349
+ """Save matplotlib figure as SciTeX bundle (.zip or directory).
355
350
 
356
- Delegates to scitex.fts.from_matplotlib as the single source of truth
351
+ Delegates to scitex.io.bundle.from_matplotlib as the single source of truth
357
352
  for bundle structure (canonical/artifacts/payload/children).
358
353
 
359
354
  When figrecipe is available and enabled on the figure, also saves
@@ -362,7 +357,7 @@ def _save_fts_bundle(
362
357
  # Get the actual matplotlib figure
363
358
  import matplotlib.figure
364
359
 
365
- from scitex.fts import from_matplotlib
360
+ from scitex.io.bundle import from_matplotlib
366
361
 
367
362
  from ._save_modules._figure_utils import get_figure_with_data
368
363
 
@@ -390,7 +385,7 @@ def _save_fts_bundle(
390
385
  except Exception:
391
386
  pass
392
387
 
393
- # Delegate to FTS (single source of truth)
388
+ # Delegate to Bundle (single source of truth)
394
389
  # Encoding is built from CSV columns directly for consistency
395
390
  from_matplotlib(fig, spath, name=name, csv_df=csv_df, dpi=dpi)
396
391
 
@@ -55,14 +55,10 @@ from ._mp4 import _mk_mp4 as save_mp4
55
55
  from ._numpy import _save_npy as save_npy
56
56
  from ._numpy import _save_npz as save_npz
57
57
  from ._optuna_study_as_csv_and_pngs import save_optuna_study_as_csv_and_pngs
58
- from ._pickle import (
59
- _save_pickle as save_pickle,
60
- )
61
- from ._pickle import (
62
- _save_pickle_gz as save_pickle_compressed,
63
- )
64
- from ._pltz_bundle import save_pltz_bundle
65
- from ._pltz_stx import save_pltz_as_stx
58
+ from ._pickle import _save_pickle as save_pickle
59
+ from ._pickle import _save_pickle_gz as save_pickle_compressed
60
+ from ._plot_bundle import save_plot_bundle
61
+ from ._plot_scitex import save_plot_as_scitex
66
62
  from ._stx_bundle import save_stx_bundle
67
63
  from ._symlink import symlink, symlink_to
68
64
  from ._tex import _save_tex as save_tex
@@ -121,8 +117,8 @@ __all__ = [
121
117
  "save_optuna_study_as_csv_and_pngs",
122
118
  # Bundle save functions
123
119
  "save_stx_bundle",
124
- "save_pltz_bundle",
125
- "save_pltz_as_stx",
120
+ "save_plot_bundle",
121
+ "save_plot_as_scitex",
126
122
  "save_separate_legends",
127
123
  "handle_image_with_csv",
128
124
  # Utilities
@@ -3,7 +3,7 @@
3
3
  # Timestamp: 2025-12-08
4
4
  # File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_save_modules/_canvas.py
5
5
  """
6
- Save canvas directory (.canvas) for scitex.fig.
6
+ Save canvas directory (.canvas) for scitex.canvas.
7
7
 
8
8
  Canvas directories are portable figure bundles containing:
9
9
  - canvas.json: Layout, panels, composition settings
@@ -113,7 +113,7 @@ def _export_canvas_figures(
113
113
  formats = ["png", "pdf", "svg"]
114
114
 
115
115
  try:
116
- from scitex.fig.io.export import _compose_and_export
116
+ from scitex.canvas.io.export import _compose_and_export
117
117
  import json
118
118
 
119
119
  # Load canvas.json
@@ -136,7 +136,7 @@ def _export_canvas_figures(
136
136
  transparent=False,
137
137
  )
138
138
  except ImportError:
139
- # scitex.fig not available
139
+ # scitex.canvas not available
140
140
  pass
141
141
  except Exception as e:
142
142
  # Log but don't fail save if export fails
@@ -1,11 +1,22 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  # Time-stamp: "2024-11-02 17:01:15 (ywatanabe)"
4
3
  # File: ./scitex_repo/src/scitex/io/_save_optuna_study_as_csv_and_pngs.py
5
4
 
5
+ try:
6
+ import optuna
7
+
8
+ OPTUNA_AVAILABLE = True
9
+ except ImportError:
10
+ OPTUNA_AVAILABLE = False
11
+ optuna = None
12
+
6
13
 
7
14
  def save_optuna_study_as_csv_and_pngs(study, sdir):
8
- import optuna
15
+ if not OPTUNA_AVAILABLE:
16
+ raise ImportError(
17
+ "Optuna is not installed. Please install with: pip install optuna"
18
+ )
19
+
9
20
  from .._save import save
10
21
 
11
22
  ## Trials DataFrame
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env python3
2
+ # Timestamp: 2025-12-19
3
+ # File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_save_modules/_plot_bundle.py
4
+
5
+ """Save matplotlib figures as .plot bundles."""
6
+
7
+ import tempfile
8
+ from pathlib import Path
9
+
10
+ from scitex import logging
11
+
12
+ from ._figure_utils import get_figure_with_data
13
+
14
+ logger = logging.getLogger()
15
+
16
+
17
+ def save_plot_bundle(obj, spath, as_zip=False, data=None, layered=True, **kwargs):
18
+ """Save a matplotlib figure as a .plot bundle.
19
+
20
+ Bundle structure v2.0 (layered - default):
21
+ plot.plot/
22
+ spec.json # Semantic: WHAT to plot (canonical)
23
+ style.json # Appearance: HOW it looks (canonical)
24
+ data.csv # Raw data (immutable)
25
+ exports/ # PNG, SVG, hitmap
26
+ cache/ # geometry_px.json, render_manifest.json
27
+
28
+ Parameters
29
+ ----------
30
+ obj : matplotlib.figure.Figure
31
+ The figure to save.
32
+ spath : str or Path
33
+ Output path (e.g., "plot.plot" or "plot.plot.zip").
34
+ as_zip : bool
35
+ If True, save as ZIP archive.
36
+ data : pandas.DataFrame, optional
37
+ Data to embed in the bundle as plot.csv.
38
+ layered : bool
39
+ If True (default), use new layered format (spec/style/geometry).
40
+ **kwargs
41
+ Additional arguments passed to savefig.
42
+ """
43
+ import shutil
44
+
45
+ import matplotlib.figure
46
+
47
+ p = Path(spath)
48
+
49
+ # Extract basename from path
50
+ basename = p.stem
51
+ if basename.endswith(".plot"):
52
+ basename = basename[:-5]
53
+ elif basename.endswith(".zip"):
54
+ basename = Path(basename).stem
55
+ if basename.endswith(".plot"):
56
+ basename = basename[:-5]
57
+
58
+ # Extract figure from various matplotlib object types
59
+ fig = obj
60
+ if hasattr(obj, "figure"):
61
+ fig = obj.figure
62
+ elif hasattr(obj, "fig"):
63
+ fig = obj.fig
64
+
65
+ if not isinstance(fig, matplotlib.figure.Figure):
66
+ raise TypeError(f"Expected matplotlib Figure, got {type(obj).__name__}")
67
+
68
+ dpi = kwargs.pop("dpi", 300)
69
+
70
+ # === Always use layered format ===
71
+ # Determine bundle directory path
72
+ if as_zip:
73
+ temp_dir = Path(tempfile.mkdtemp())
74
+ bundle_dir = temp_dir / f"{basename}.plot"
75
+ zip_path = p if not str(p).endswith(".zip") else p
76
+ else:
77
+ bundle_dir = p if str(p).endswith(".plot") else Path(str(p) + ".plot")
78
+ temp_dir = None
79
+
80
+ # Get CSV data from figure if not provided
81
+ csv_df = data
82
+ if csv_df is None:
83
+ csv_source = get_figure_with_data(obj)
84
+ if csv_source is not None and hasattr(csv_source, "export_as_csv"):
85
+ try:
86
+ csv_df = csv_source.export_as_csv()
87
+ except Exception:
88
+ pass
89
+
90
+ from scitex.plt.io import save_layered_plot_bundle
91
+
92
+ save_layered_plot_bundle(
93
+ fig=fig,
94
+ bundle_dir=bundle_dir,
95
+ basename=basename,
96
+ dpi=dpi,
97
+ csv_df=csv_df,
98
+ )
99
+
100
+ # Compress to ZIP if requested
101
+ if as_zip:
102
+ import zipfile
103
+
104
+ with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zf:
105
+ for file_path in bundle_dir.rglob("*"):
106
+ if file_path.is_file():
107
+ arcname = file_path.relative_to(bundle_dir.parent)
108
+ zf.write(file_path, arcname)
109
+ shutil.rmtree(temp_dir)
110
+
111
+
112
+ # EOF
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env python3
2
2
  # Timestamp: 2025-12-19
3
- # File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_save_modules/_pltz_stx.py
3
+ # File: /home/ywatanabe/proj/scitex-code/src/scitex/io/_save_modules/_plot_scitex.py
4
4
 
5
- """Save matplotlib figures as FTS bundles (ZIP or directory) with plot content type."""
5
+ """Save matplotlib figures as SciTeX bundles (ZIP or directory) with plot content type."""
6
6
 
7
7
  import json
8
8
  import tempfile
@@ -199,8 +199,8 @@ def _build_theme_from_figure(fig):
199
199
  }
200
200
 
201
201
 
202
- def save_pltz_as_stx(obj, spath, as_zip=True, basename=None, **kwargs):
203
- """Save a matplotlib figure as an FTS bundle (ZIP or directory).
202
+ def save_plot_as_scitex(obj, spath, as_zip=True, basename=None, **kwargs):
203
+ """Save a matplotlib figure as a SciTeX bundle (ZIP or directory).
204
204
 
205
205
  Bundle structure:
206
206
  plot_name/ # or plot_name.zip (with plot_name/ inside)
@@ -463,7 +463,7 @@ def _generate_readme(bundle_dir, basename, spec, csv_df):
463
463
  from datetime import datetime
464
464
 
465
465
  readme_lines = [
466
- f"# {basename} FTS Bundle",
466
+ f"# {basename} SciTeX Bundle",
467
467
  "",
468
468
  "## Overview",
469
469
  "",
@@ -517,9 +517,9 @@ def _generate_readme(bundle_dir, basename, spec, csv_df):
517
517
  "## Usage",
518
518
  "",
519
519
  "```python",
520
- "from scitex.fts import FTS",
520
+ "from scitex.io.bundle import Bundle",
521
521
  "",
522
- f'bundle = FTS("{basename}.zip") # or "{basename}/" directory',
522
+ f'bundle = Bundle("{basename}.zip") # or "{basename}/" directory',
523
523
  "bundle.show() # Display",
524
524
  'bundle.export("output.png") # Export',
525
525
  "```",