scitex 2.15.1__py3-none-any.whl → 2.15.2__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 +68 -61
- scitex/_mcp_tools/introspect.py +42 -23
- scitex/_mcp_tools/template.py +24 -0
- scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit.py +30 -1550
- scitex/ai/classification/timeseries/_sliding_window_core.py +467 -0
- scitex/ai/classification/timeseries/_sliding_window_plotting.py +369 -0
- scitex/audio/__init__.py +2 -2
- scitex/audio/_tts.py +18 -10
- scitex/audio/engines/base.py +17 -10
- scitex/audio/engines/elevenlabs_engine.py +1 -1
- scitex/canvas/editor/flask_editor/_core/__init__.py +27 -0
- scitex/canvas/editor/flask_editor/_core/_bbox_extraction.py +200 -0
- scitex/canvas/editor/flask_editor/_core/_editor.py +173 -0
- scitex/canvas/editor/flask_editor/_core/_export_helpers.py +353 -0
- scitex/canvas/editor/flask_editor/_core/_routes_basic.py +190 -0
- scitex/canvas/editor/flask_editor/_core/_routes_export.py +332 -0
- scitex/canvas/editor/flask_editor/_core/_routes_panels.py +252 -0
- scitex/canvas/editor/flask_editor/_core/_routes_save.py +218 -0
- scitex/canvas/editor/flask_editor/_core.py +25 -1684
- scitex/cli/introspect.py +112 -74
- scitex/cli/main.py +2 -0
- scitex/cli/plt.py +357 -0
- scitex/cli/repro.py +15 -8
- scitex/cli/resource.py +15 -8
- scitex/cli/scholar/__init__.py +15 -8
- scitex/cli/social.py +6 -6
- scitex/cli/stats.py +15 -8
- scitex/cli/template.py +129 -12
- scitex/cli/tex.py +15 -8
- scitex/cli/writer.py +15 -8
- scitex/cloud/__init__.py +41 -2
- scitex/config/_env_registry.py +84 -19
- scitex/context/__init__.py +22 -0
- scitex/dev/__init__.py +20 -1
- scitex/gen/__init__.py +50 -14
- scitex/gen/_list_packages.py +4 -4
- scitex/introspect/__init__.py +16 -9
- scitex/introspect/_core.py +7 -8
- scitex/{gen/_inspect_module.py → introspect/_list_api.py} +43 -54
- scitex/introspect/_mcp/__init__.py +10 -6
- scitex/introspect/_mcp/handlers.py +37 -12
- scitex/introspect/_members.py +7 -3
- scitex/introspect/_signature.py +3 -3
- scitex/introspect/_source.py +2 -2
- scitex/io/_save.py +1 -2
- scitex/logging/_formatters.py +19 -9
- scitex/mcp_server.py +1 -1
- scitex/os/__init__.py +4 -0
- scitex/{gen → os}/_check_host.py +4 -5
- scitex/plt/__init__.py +11 -14
- scitex/session/__init__.py +26 -7
- scitex/session/_decorator.py +1 -1
- scitex/sh/__init__.py +7 -4
- scitex/social/__init__.py +10 -8
- scitex/stats/_mcp/_handlers/__init__.py +31 -0
- scitex/stats/_mcp/_handlers/_corrections.py +113 -0
- scitex/stats/_mcp/_handlers/_descriptive.py +78 -0
- scitex/stats/_mcp/_handlers/_effect_size.py +106 -0
- scitex/stats/_mcp/_handlers/_format.py +94 -0
- scitex/stats/_mcp/_handlers/_normality.py +110 -0
- scitex/stats/_mcp/_handlers/_posthoc.py +224 -0
- scitex/stats/_mcp/_handlers/_power.py +247 -0
- scitex/stats/_mcp/_handlers/_recommend.py +102 -0
- scitex/stats/_mcp/_handlers/_run_test.py +279 -0
- scitex/stats/_mcp/_handlers/_stars.py +48 -0
- scitex/stats/_mcp/handlers.py +19 -1171
- scitex/stats/auto/_stat_style.py +175 -0
- scitex/stats/auto/_style_definitions.py +411 -0
- scitex/stats/auto/_styles.py +22 -620
- scitex/stats/descriptive/__init__.py +11 -8
- scitex/stats/descriptive/_ci.py +39 -0
- scitex/stats/power/_power.py +15 -4
- scitex/str/__init__.py +2 -1
- scitex/str/_title_case.py +63 -0
- scitex/template/__init__.py +25 -10
- scitex/template/_code_templates.py +147 -0
- scitex/template/_mcp/handlers.py +81 -0
- scitex/template/_mcp/tool_schemas.py +55 -0
- scitex/template/_templates/__init__.py +51 -0
- scitex/template/_templates/audio.py +233 -0
- scitex/template/_templates/canvas.py +312 -0
- scitex/template/_templates/capture.py +268 -0
- scitex/template/_templates/config.py +43 -0
- scitex/template/_templates/diagram.py +294 -0
- scitex/template/_templates/io.py +107 -0
- scitex/template/_templates/module.py +53 -0
- scitex/template/_templates/plt.py +202 -0
- scitex/template/_templates/scholar.py +267 -0
- scitex/template/_templates/session.py +130 -0
- scitex/template/_templates/session_minimal.py +43 -0
- scitex/template/_templates/session_plot.py +67 -0
- scitex/template/_templates/session_stats.py +77 -0
- scitex/template/_templates/stats.py +323 -0
- scitex/template/_templates/writer.py +296 -0
- scitex/ui/_backends/_email.py +10 -2
- scitex/ui/_backends/_webhook.py +5 -1
- scitex/web/_search_pubmed.py +10 -6
- {scitex-2.15.1.dist-info → scitex-2.15.2.dist-info}/METADATA +1 -1
- {scitex-2.15.1.dist-info → scitex-2.15.2.dist-info}/RECORD +105 -64
- scitex/gen/_ci.py +0 -12
- scitex/gen/_title_case.py +0 -89
- /scitex/{gen → context}/_detect_environment.py +0 -0
- /scitex/{gen → context}/_get_notebook_path.py +0 -0
- /scitex/{gen/_shell.py → sh/_shell_legacy.py} +0 -0
- {scitex-2.15.1.dist-info → scitex-2.15.2.dist-info}/WHEEL +0 -0
- {scitex-2.15.1.dist-info → scitex-2.15.2.dist-info}/entry_points.txt +0 -0
- {scitex-2.15.1.dist-info → scitex-2.15.2.dist-info}/licenses/LICENSE +0 -0
scitex/__init__.py
CHANGED
|
@@ -29,19 +29,9 @@ warnings.filterwarnings("default", category=DeprecationWarning, module="scitex.*
|
|
|
29
29
|
# Version
|
|
30
30
|
from .__version__ import __version__
|
|
31
31
|
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# Sentinel object for decorator-injected parameters
|
|
37
|
-
class _InjectedSentinel:
|
|
38
|
-
"""Sentinel value indicating a parameter will be injected by a decorator"""
|
|
39
|
-
|
|
40
|
-
def __repr__(self):
|
|
41
|
-
return "<INJECTED>"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
INJECTED = _InjectedSentinel()
|
|
32
|
+
# BACKWARD COMPATIBILITY: Deprecated items accessible via __getattr__
|
|
33
|
+
# These are handled at the end of this file after lazy modules are defined
|
|
34
|
+
_DEPRECATED_ATTRS = {"INJECTED", "show_install_guide", "Diagram"}
|
|
45
35
|
|
|
46
36
|
|
|
47
37
|
# Lazy loading for all modules
|
|
@@ -198,47 +188,53 @@ msword = _LazyModule("msword")
|
|
|
198
188
|
fts = _LazyModule("fts") # Bundle schemas module
|
|
199
189
|
social = _LazyModule("social") # Social media integration (socialia wrapper)
|
|
200
190
|
diagram = _LazyModule("diagram") # Diagram creation (delegates to figrecipe)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
191
|
+
introspect = _LazyModule("introspect") # Python introspection utilities
|
|
192
|
+
sh = _LazyModule("sh") # Shell command execution
|
|
193
|
+
os = _LazyModule("os") # OS utilities (file operations)
|
|
194
|
+
cv = _LazyModule("cv") # Computer vision utilities
|
|
195
|
+
ui = _LazyModule("ui") # User interface utilities
|
|
196
|
+
git = _LazyModule("git") # Git operations
|
|
197
|
+
schema = _LazyModule("schema") # Data schema utilities
|
|
198
|
+
canvas = _LazyModule("canvas") # Canvas utilities for figure composition
|
|
199
|
+
security = _LazyModule("security") # Security utilities
|
|
200
|
+
benchmark = _LazyModule("benchmark") # Benchmarking utilities
|
|
201
|
+
bridge = _LazyModule("bridge") # Bridge utilities
|
|
202
|
+
browser = _LazyModule("browser") # Browser automation
|
|
203
|
+
compat = _LazyModule("compat") # Compatibility utilities
|
|
204
|
+
cli = _LazyModule("cli") # Command-line interface
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
# BACKWARD COMPATIBILITY: Module-level __getattr__ for deprecated attributes
|
|
208
|
+
def __getattr__(name):
|
|
209
|
+
"""Handle deprecated attributes with warnings."""
|
|
210
|
+
if name == "INJECTED":
|
|
211
|
+
warnings.warn(
|
|
212
|
+
"scitex.INJECTED is deprecated, use scitex.session.INJECTED instead",
|
|
213
|
+
DeprecationWarning,
|
|
214
|
+
stacklevel=2,
|
|
215
|
+
)
|
|
216
|
+
from .session import INJECTED
|
|
217
|
+
|
|
218
|
+
return INJECTED
|
|
219
|
+
if name == "show_install_guide":
|
|
220
|
+
warnings.warn(
|
|
221
|
+
"scitex.show_install_guide() is deprecated, use scitex.dev.show_install_guide() instead",
|
|
222
|
+
DeprecationWarning,
|
|
223
|
+
stacklevel=2,
|
|
224
|
+
)
|
|
225
|
+
from .dev import show_install_guide
|
|
226
|
+
|
|
227
|
+
return show_install_guide
|
|
228
|
+
if name == "Diagram":
|
|
229
|
+
warnings.warn(
|
|
230
|
+
"scitex.Diagram is deprecated, use scitex.diagram.Diagram instead",
|
|
231
|
+
DeprecationWarning,
|
|
232
|
+
stacklevel=2,
|
|
233
|
+
)
|
|
234
|
+
from .diagram import Diagram
|
|
235
|
+
|
|
236
|
+
return Diagram
|
|
237
|
+
raise AttributeError(f"module 'scitex' has no attribute '{name}'")
|
|
242
238
|
|
|
243
239
|
|
|
244
240
|
# Centralized path configuration - eager loaded for convenience
|
|
@@ -257,6 +253,7 @@ if _os.environ.get("SCITEX_CLOUD_CODE_WORKSPACE") == "true":
|
|
|
257
253
|
pass # Silently fail if matplotlib not available
|
|
258
254
|
|
|
259
255
|
__all__ = [
|
|
256
|
+
# Core modules
|
|
260
257
|
"io",
|
|
261
258
|
"gen",
|
|
262
259
|
"plt",
|
|
@@ -268,7 +265,6 @@ __all__ = [
|
|
|
268
265
|
"path",
|
|
269
266
|
"dict",
|
|
270
267
|
"decorators",
|
|
271
|
-
"__version__",
|
|
272
268
|
"sh",
|
|
273
269
|
"errors",
|
|
274
270
|
"units",
|
|
@@ -292,7 +288,7 @@ __all__ = [
|
|
|
292
288
|
"linalg",
|
|
293
289
|
"parallel",
|
|
294
290
|
"datetime",
|
|
295
|
-
"dt",
|
|
291
|
+
"dt",
|
|
296
292
|
"types",
|
|
297
293
|
"utils",
|
|
298
294
|
"etc",
|
|
@@ -304,12 +300,23 @@ __all__ = [
|
|
|
304
300
|
"audio",
|
|
305
301
|
"msword",
|
|
306
302
|
"fts",
|
|
307
|
-
"
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"
|
|
303
|
+
"social",
|
|
304
|
+
"diagram",
|
|
305
|
+
"introspect",
|
|
306
|
+
"os",
|
|
307
|
+
"cv",
|
|
308
|
+
"ui",
|
|
309
|
+
"git",
|
|
310
|
+
"schema",
|
|
311
|
+
"canvas",
|
|
312
|
+
"security",
|
|
313
|
+
"benchmark",
|
|
314
|
+
"bridge",
|
|
315
|
+
"browser",
|
|
316
|
+
"compat",
|
|
317
|
+
"cli",
|
|
311
318
|
"PATHS",
|
|
312
|
-
"
|
|
319
|
+
"__version__",
|
|
313
320
|
]
|
|
314
321
|
|
|
315
322
|
# EOF
|
scitex/_mcp_tools/introspect.py
CHANGED
|
@@ -16,17 +16,18 @@ def _json(data: dict) -> str:
|
|
|
16
16
|
|
|
17
17
|
def register_introspect_tools(mcp) -> None:
|
|
18
18
|
"""Register introspection tools with FastMCP server."""
|
|
19
|
+
# IPython-style tools (primary)
|
|
19
20
|
|
|
20
21
|
@mcp.tool()
|
|
21
|
-
async def
|
|
22
|
+
async def introspect_q(
|
|
22
23
|
dotted_path: str,
|
|
23
24
|
include_defaults: bool = True,
|
|
24
25
|
include_annotations: bool = True,
|
|
25
26
|
) -> str:
|
|
26
27
|
"""[introspect] Get function/class signature (like IPython's func?)."""
|
|
27
|
-
from scitex.introspect._mcp.handlers import
|
|
28
|
+
from scitex.introspect._mcp.handlers import q_handler
|
|
28
29
|
|
|
29
|
-
result = await
|
|
30
|
+
result = await q_handler(
|
|
30
31
|
dotted_path=dotted_path,
|
|
31
32
|
include_defaults=include_defaults,
|
|
32
33
|
include_annotations=include_annotations,
|
|
@@ -34,29 +35,15 @@ def register_introspect_tools(mcp) -> None:
|
|
|
34
35
|
return _json(result)
|
|
35
36
|
|
|
36
37
|
@mcp.tool()
|
|
37
|
-
async def
|
|
38
|
-
dotted_path: str,
|
|
39
|
-
format: str = "raw",
|
|
40
|
-
) -> str:
|
|
41
|
-
"""[introspect] Get docstring of a Python object. format: raw|parsed|summary."""
|
|
42
|
-
from scitex.introspect._mcp.handlers import docstring_handler
|
|
43
|
-
|
|
44
|
-
result = await docstring_handler(
|
|
45
|
-
dotted_path=dotted_path,
|
|
46
|
-
format=format,
|
|
47
|
-
)
|
|
48
|
-
return _json(result)
|
|
49
|
-
|
|
50
|
-
@mcp.tool()
|
|
51
|
-
async def introspect_source(
|
|
38
|
+
async def introspect_qq(
|
|
52
39
|
dotted_path: str,
|
|
53
40
|
max_lines: Optional[int] = None,
|
|
54
41
|
include_decorators: bool = True,
|
|
55
42
|
) -> str:
|
|
56
43
|
"""[introspect] Get source code of a Python object (like IPython's func??)."""
|
|
57
|
-
from scitex.introspect._mcp.handlers import
|
|
44
|
+
from scitex.introspect._mcp.handlers import qq_handler
|
|
58
45
|
|
|
59
|
-
result = await
|
|
46
|
+
result = await qq_handler(
|
|
60
47
|
dotted_path=dotted_path,
|
|
61
48
|
max_lines=max_lines,
|
|
62
49
|
include_decorators=include_decorators,
|
|
@@ -64,16 +51,16 @@ def register_introspect_tools(mcp) -> None:
|
|
|
64
51
|
return _json(result)
|
|
65
52
|
|
|
66
53
|
@mcp.tool()
|
|
67
|
-
async def
|
|
54
|
+
async def introspect_dir(
|
|
68
55
|
dotted_path: str,
|
|
69
56
|
filter: str = "public",
|
|
70
57
|
kind: Optional[str] = None,
|
|
71
58
|
include_inherited: bool = False,
|
|
72
59
|
) -> str:
|
|
73
60
|
"""[introspect] List members of module/class (like dir()). filter: all|public|private|dunder."""
|
|
74
|
-
from scitex.introspect._mcp.handlers import
|
|
61
|
+
from scitex.introspect._mcp.handlers import dir_handler
|
|
75
62
|
|
|
76
|
-
result = await
|
|
63
|
+
result = await dir_handler(
|
|
77
64
|
dotted_path=dotted_path,
|
|
78
65
|
filter=filter,
|
|
79
66
|
kind=kind,
|
|
@@ -81,6 +68,38 @@ def register_introspect_tools(mcp) -> None:
|
|
|
81
68
|
)
|
|
82
69
|
return _json(result)
|
|
83
70
|
|
|
71
|
+
@mcp.tool()
|
|
72
|
+
async def introspect_api(
|
|
73
|
+
dotted_path: str,
|
|
74
|
+
max_depth: int = 5,
|
|
75
|
+
docstring: bool = False,
|
|
76
|
+
root_only: bool = False,
|
|
77
|
+
) -> str:
|
|
78
|
+
"""[introspect] List the API tree of a module recursively."""
|
|
79
|
+
from scitex.introspect._mcp.handlers import list_api_handler
|
|
80
|
+
|
|
81
|
+
result = await list_api_handler(
|
|
82
|
+
dotted_path=dotted_path,
|
|
83
|
+
max_depth=max_depth,
|
|
84
|
+
docstring=docstring,
|
|
85
|
+
root_only=root_only,
|
|
86
|
+
)
|
|
87
|
+
return _json(result)
|
|
88
|
+
|
|
89
|
+
@mcp.tool()
|
|
90
|
+
async def introspect_docstring(
|
|
91
|
+
dotted_path: str,
|
|
92
|
+
format: str = "raw",
|
|
93
|
+
) -> str:
|
|
94
|
+
"""[introspect] Get docstring of a Python object. format: raw|parsed|summary."""
|
|
95
|
+
from scitex.introspect._mcp.handlers import docstring_handler
|
|
96
|
+
|
|
97
|
+
result = await docstring_handler(
|
|
98
|
+
dotted_path=dotted_path,
|
|
99
|
+
format=format,
|
|
100
|
+
)
|
|
101
|
+
return _json(result)
|
|
102
|
+
|
|
84
103
|
@mcp.tool()
|
|
85
104
|
async def introspect_exports(dotted_path: str) -> str:
|
|
86
105
|
"""[introspect] Get __all__ exports of a module."""
|
scitex/_mcp_tools/template.py
CHANGED
|
@@ -62,5 +62,29 @@ def register_template_tools(mcp) -> None:
|
|
|
62
62
|
result = await list_git_strategies_handler()
|
|
63
63
|
return _json(result)
|
|
64
64
|
|
|
65
|
+
@mcp.tool()
|
|
66
|
+
async def template_get_code_template(
|
|
67
|
+
template_id: str,
|
|
68
|
+
filepath: Optional[str] = None,
|
|
69
|
+
docstring: Optional[str] = None,
|
|
70
|
+
) -> str:
|
|
71
|
+
"""[template] Get a code template for scripts and modules. Core: session, io, config. Module usage: plt, stats, scholar, audio, capture, diagram, canvas, writer. Use 'all' for all templates combined."""
|
|
72
|
+
from scitex.template._mcp.handlers import get_code_template_handler
|
|
73
|
+
|
|
74
|
+
result = await get_code_template_handler(
|
|
75
|
+
template_id=template_id,
|
|
76
|
+
filepath=filepath,
|
|
77
|
+
docstring=docstring,
|
|
78
|
+
)
|
|
79
|
+
return _json(result)
|
|
80
|
+
|
|
81
|
+
@mcp.tool()
|
|
82
|
+
async def template_list_code_templates() -> str:
|
|
83
|
+
"""[template] List all available code templates for scripts and modules."""
|
|
84
|
+
from scitex.template._mcp.handlers import list_code_templates_handler
|
|
85
|
+
|
|
86
|
+
result = await list_code_templates_handler()
|
|
87
|
+
return _json(result)
|
|
88
|
+
|
|
65
89
|
|
|
66
90
|
# EOF
|