scitex 2.11.0__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.
- scitex/__main__.py +24 -5
- scitex/__version__.py +1 -1
- scitex/_optional_deps.py +33 -0
- scitex/ai/classification/reporters/_ClassificationReporter.py +1 -1
- scitex/ai/classification/timeseries/_TimeSeriesBlockingSplit.py +2 -2
- scitex/ai/classification/timeseries/_TimeSeriesCalendarSplit.py +2 -2
- scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit.py +2 -2
- scitex/ai/classification/timeseries/_TimeSeriesSlidingWindowSplit_v01-not-using-n_splits.py +2 -2
- scitex/ai/classification/timeseries/_TimeSeriesStratifiedSplit.py +2 -2
- scitex/ai/classification/timeseries/_normalize_timestamp.py +1 -1
- scitex/ai/metrics/_calc_seizure_prediction_metrics.py +1 -1
- scitex/ai/plt/_plot_feature_importance.py +1 -1
- scitex/ai/plt/_plot_learning_curve.py +1 -1
- scitex/ai/plt/_plot_optuna_study.py +1 -1
- scitex/ai/plt/_plot_pre_rec_curve.py +1 -1
- scitex/ai/plt/_plot_roc_curve.py +1 -1
- scitex/ai/plt/_stx_conf_mat.py +1 -1
- scitex/ai/training/_LearningCurveLogger.py +1 -1
- scitex/audio/mcp_server.py +38 -8
- scitex/browser/automation/CookieHandler.py +1 -1
- scitex/browser/core/BrowserMixin.py +1 -1
- scitex/browser/core/ChromeProfileManager.py +1 -1
- scitex/browser/debugging/_browser_logger.py +1 -1
- scitex/browser/debugging/_highlight_element.py +1 -1
- scitex/browser/debugging/_show_grid.py +1 -1
- scitex/browser/interaction/click_center.py +1 -1
- scitex/browser/interaction/click_with_fallbacks.py +1 -1
- scitex/browser/interaction/close_popups.py +1 -1
- scitex/browser/interaction/fill_with_fallbacks.py +1 -1
- scitex/browser/pdf/click_download_for_chrome_pdf_viewer.py +1 -1
- scitex/browser/pdf/detect_chrome_pdf_viewer.py +1 -1
- scitex/browser/stealth/HumanBehavior.py +1 -1
- scitex/browser/stealth/StealthManager.py +1 -1
- scitex/canvas/_mcp_handlers.py +372 -0
- scitex/canvas/_mcp_tool_schemas.py +219 -0
- scitex/canvas/mcp_server.py +151 -0
- scitex/capture/mcp_server.py +41 -12
- scitex/cli/audio.py +233 -0
- scitex/cli/capture.py +307 -0
- scitex/cli/main.py +27 -4
- scitex/cli/repro.py +233 -0
- scitex/cli/resource.py +240 -0
- scitex/cli/stats.py +325 -0
- scitex/cli/template.py +236 -0
- scitex/cli/tex.py +286 -0
- scitex/cli/web.py +11 -12
- scitex/dev/__init__.py +3 -0
- scitex/dev/_pyproject.py +405 -0
- scitex/dev/plt/__init__.py +2 -2
- scitex/dev/plt/mpl/get_dir_ax.py +1 -1
- scitex/dev/plt/mpl/get_signatures.py +1 -1
- scitex/dev/plt/mpl/get_signatures_details.py +1 -1
- scitex/diagram/_mcp_handlers.py +400 -0
- scitex/diagram/_mcp_tool_schemas.py +157 -0
- scitex/diagram/mcp_server.py +151 -0
- scitex/dsp/_demo_sig.py +51 -5
- scitex/dsp/_mne.py +13 -2
- scitex/dsp/_modulation_index.py +15 -3
- scitex/dsp/_pac.py +23 -5
- scitex/dsp/_psd.py +16 -4
- scitex/dsp/_resample.py +24 -4
- scitex/dsp/_transform.py +16 -3
- scitex/dsp/add_noise.py +15 -1
- scitex/dsp/norm.py +17 -2
- scitex/dsp/reference.py +17 -1
- scitex/dsp/utils/_differential_bandpass_filters.py +20 -2
- scitex/dsp/utils/_zero_pad.py +18 -4
- scitex/dt/_normalize_timestamp.py +1 -1
- scitex/git/_session.py +1 -1
- scitex/io/_load_modules/_con.py +12 -1
- scitex/io/_load_modules/_eeg.py +12 -1
- scitex/io/_load_modules/_optuna.py +21 -63
- scitex/io/_load_modules/_torch.py +11 -3
- scitex/io/_save_modules/_optuna_study_as_csv_and_pngs.py +13 -2
- scitex/io/_save_modules/_torch.py +11 -3
- scitex/mcp_server.py +159 -0
- scitex/plt/_mcp_handlers.py +361 -0
- scitex/plt/_mcp_tool_schemas.py +169 -0
- scitex/plt/mcp_server.py +205 -0
- scitex/repro/README_RandomStateManager.md +3 -3
- scitex/repro/_RandomStateManager.py +14 -14
- scitex/repro/_gen_ID.py +1 -1
- scitex/repro/_gen_timestamp.py +1 -1
- scitex/repro/_hash_array.py +4 -4
- scitex/scholar/__main__.py +24 -2
- scitex/scholar/_mcp_handlers.py +685 -0
- scitex/scholar/_mcp_tool_schemas.py +339 -0
- scitex/scholar/docs/template.py +1 -1
- scitex/scholar/examples/07_storage_integration.py +1 -1
- scitex/scholar/impact_factor/jcr/ImpactFactorJCREngine.py +1 -1
- scitex/scholar/impact_factor/jcr/build_database.py +1 -1
- scitex/scholar/mcp_server.py +315 -0
- scitex/scholar/pdf_download/ScholarPDFDownloader.py +1 -1
- scitex/scholar/pipelines/ScholarPipelineBibTeX.py +1 -1
- scitex/scholar/pipelines/ScholarPipelineParallel.py +1 -1
- scitex/scholar/pipelines/ScholarPipelineSingle.py +1 -1
- scitex/scholar/storage/PaperIO.py +1 -1
- scitex/session/README.md +4 -4
- scitex/session/__init__.py +1 -1
- scitex/session/_decorator.py +9 -9
- scitex/session/_lifecycle.py +5 -5
- scitex/session/template.py +1 -1
- scitex/stats/__main__.py +281 -0
- scitex/stats/_mcp_handlers.py +1191 -0
- scitex/stats/_mcp_tool_schemas.py +384 -0
- scitex/stats/correct/_correct_bonferroni.py +1 -1
- scitex/stats/correct/_correct_fdr.py +1 -1
- scitex/stats/correct/_correct_fdr_.py +1 -1
- scitex/stats/correct/_correct_holm.py +1 -1
- scitex/stats/correct/_correct_sidak.py +1 -1
- scitex/stats/effect_sizes/_cliffs_delta.py +1 -1
- scitex/stats/effect_sizes/_cohens_d.py +1 -1
- scitex/stats/effect_sizes/_epsilon_squared.py +1 -1
- scitex/stats/effect_sizes/_eta_squared.py +1 -1
- scitex/stats/effect_sizes/_prob_superiority.py +1 -1
- scitex/stats/mcp_server.py +405 -0
- scitex/stats/posthoc/_dunnett.py +1 -1
- scitex/stats/posthoc/_games_howell.py +1 -1
- scitex/stats/posthoc/_tukey_hsd.py +1 -1
- scitex/stats/power/_power.py +1 -1
- scitex/stats/utils/_effect_size.py +1 -1
- scitex/stats/utils/_formatters.py +1 -1
- scitex/stats/utils/_power.py +1 -1
- scitex/template/_mcp_handlers.py +259 -0
- scitex/template/_mcp_tool_schemas.py +112 -0
- scitex/template/mcp_server.py +186 -0
- scitex/utils/_verify_scitex_format.py +2 -2
- scitex/utils/template.py +1 -1
- scitex/web/__init__.py +12 -11
- scitex/web/_scraping.py +26 -265
- scitex/web/download_images.py +316 -0
- scitex/writer/Writer.py +1 -1
- scitex/writer/_clone_writer_project.py +1 -1
- scitex/writer/_validate_tree_structures.py +1 -1
- scitex/writer/dataclasses/config/_WriterConfig.py +1 -1
- scitex/writer/dataclasses/contents/_ManuscriptContents.py +1 -1
- scitex/writer/dataclasses/core/_Document.py +1 -1
- scitex/writer/dataclasses/core/_DocumentSection.py +1 -1
- scitex/writer/dataclasses/results/_CompilationResult.py +1 -1
- scitex/writer/dataclasses/results/_LaTeXIssue.py +1 -1
- scitex/writer/utils/.legacy_git_retry.py +7 -5
- scitex/writer/utils/_parse_latex_logs.py +1 -1
- {scitex-2.11.0.dist-info → scitex-2.13.0.dist-info}/METADATA +431 -269
- {scitex-2.11.0.dist-info → scitex-2.13.0.dist-info}/RECORD +147 -118
- scitex-2.13.0.dist-info/entry_points.txt +11 -0
- scitex-2.11.0.dist-info/entry_points.txt +0 -2
- {scitex-2.11.0.dist-info → scitex-2.13.0.dist-info}/WHEEL +0 -0
- {scitex-2.11.0.dist-info → scitex-2.13.0.dist-info}/licenses/LICENSE +0 -0
scitex/__main__.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
"""
|
|
4
3
|
SciTeX Package Entry Point
|
|
5
4
|
|
|
@@ -9,16 +8,36 @@ Allows running: python -m scitex [command]
|
|
|
9
8
|
import sys
|
|
10
9
|
|
|
11
10
|
|
|
11
|
+
def _check_cli_dependencies():
|
|
12
|
+
"""Check CLI dependencies and return missing ones."""
|
|
13
|
+
missing = []
|
|
14
|
+
try:
|
|
15
|
+
import click
|
|
16
|
+
except ImportError:
|
|
17
|
+
missing.append(("click", "pip install click"))
|
|
18
|
+
return missing
|
|
19
|
+
|
|
20
|
+
|
|
12
21
|
def main():
|
|
13
22
|
"""Main entry point for scitex CLI"""
|
|
23
|
+
# Check dependencies first
|
|
24
|
+
missing = _check_cli_dependencies()
|
|
25
|
+
if missing:
|
|
26
|
+
print("SciTeX CLI missing dependencies:")
|
|
27
|
+
for pkg, install in missing:
|
|
28
|
+
print(f" - {pkg}: {install}")
|
|
29
|
+
print("\nOr install all CLI deps: pip install scitex[cli]")
|
|
30
|
+
sys.exit(1)
|
|
31
|
+
|
|
14
32
|
try:
|
|
15
33
|
from scitex.cli.main import cli
|
|
16
34
|
|
|
17
35
|
cli()
|
|
18
|
-
except ImportError:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
except ImportError as e:
|
|
37
|
+
print(f"SciTeX CLI import error: {e}")
|
|
38
|
+
import traceback
|
|
39
|
+
|
|
40
|
+
traceback.print_exc()
|
|
22
41
|
sys.exit(1)
|
|
23
42
|
|
|
24
43
|
|
scitex/__version__.py
CHANGED
scitex/_optional_deps.py
CHANGED
|
@@ -38,6 +38,8 @@ PACKAGE_TO_EXTRA: Dict[str, tuple] = {
|
|
|
38
38
|
"mss": ("mss", "capture"),
|
|
39
39
|
# CLI Module
|
|
40
40
|
"click": ("click", "cli"),
|
|
41
|
+
# MCP Module (Model Context Protocol)
|
|
42
|
+
"mcp": ("mcp", "mcp"),
|
|
41
43
|
# DB Module
|
|
42
44
|
"sqlalchemy": ("sqlalchemy", "db"),
|
|
43
45
|
"psycopg2": ("psycopg2-binary", "db"),
|
|
@@ -297,4 +299,35 @@ def has_plotting() -> bool:
|
|
|
297
299
|
return check_optional_deps("matplotlib")["matplotlib"]
|
|
298
300
|
|
|
299
301
|
|
|
302
|
+
def has_mcp() -> bool:
|
|
303
|
+
"""Check if MCP (Model Context Protocol) dependencies are available."""
|
|
304
|
+
return check_optional_deps("mcp")["mcp"]
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def check_mcp_deps(server_name: str = "scitex") -> None:
|
|
308
|
+
"""
|
|
309
|
+
Check MCP dependencies and exit with helpful message if missing.
|
|
310
|
+
|
|
311
|
+
Use at the start of MCP server main() functions for graceful handling.
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
server_name: Name of the MCP server for error messages
|
|
315
|
+
"""
|
|
316
|
+
import sys
|
|
317
|
+
|
|
318
|
+
try:
|
|
319
|
+
import mcp # noqa: F401
|
|
320
|
+
except ImportError:
|
|
321
|
+
print(f"{'=' * 60}")
|
|
322
|
+
print(f"MCP Server '{server_name}' requires the 'mcp' package.")
|
|
323
|
+
print()
|
|
324
|
+
print("Install with:")
|
|
325
|
+
print(" pip install mcp")
|
|
326
|
+
print()
|
|
327
|
+
print("Or install scitex with MCP support:")
|
|
328
|
+
print(" pip install scitex[mcp]")
|
|
329
|
+
print(f"{'=' * 60}")
|
|
330
|
+
sys.exit(1)
|
|
331
|
+
|
|
332
|
+
|
|
300
333
|
# EOF
|
|
@@ -101,7 +101,7 @@ class TimeSeriesBlockingSplit(BaseCrossValidator):
|
|
|
101
101
|
self.test_ratio = test_ratio
|
|
102
102
|
self.val_ratio = val_ratio
|
|
103
103
|
self.random_state = random_state
|
|
104
|
-
self.
|
|
104
|
+
self.rng = np.random.default_rng(random_state)
|
|
105
105
|
|
|
106
106
|
def split(
|
|
107
107
|
self,
|
|
@@ -616,7 +616,7 @@ def run_main() -> None:
|
|
|
616
616
|
|
|
617
617
|
args = parse_args()
|
|
618
618
|
|
|
619
|
-
CONFIG, sys.stdout, sys.stderr, plt, CC,
|
|
619
|
+
CONFIG, sys.stdout, sys.stderr, plt, CC, rng = stx.session.start(
|
|
620
620
|
sys,
|
|
621
621
|
plt,
|
|
622
622
|
args=args,
|
|
@@ -110,7 +110,7 @@ class TimeSeriesCalendarSplit(BaseCrossValidator):
|
|
|
110
110
|
self.gap_intervals = gap_intervals
|
|
111
111
|
self.step_intervals = step_intervals
|
|
112
112
|
self.random_state = random_state
|
|
113
|
-
self.
|
|
113
|
+
self.rng = np.random.default_rng(random_state)
|
|
114
114
|
|
|
115
115
|
def split(
|
|
116
116
|
self,
|
|
@@ -705,7 +705,7 @@ def run_main() -> None:
|
|
|
705
705
|
|
|
706
706
|
args = parse_args()
|
|
707
707
|
|
|
708
|
-
CONFIG, sys.stdout, sys.stderr, plt, CC,
|
|
708
|
+
CONFIG, sys.stdout, sys.stderr, plt, CC, rng = stx.session.start(
|
|
709
709
|
sys,
|
|
710
710
|
plt,
|
|
711
711
|
args=args,
|
|
@@ -151,7 +151,7 @@ class TimeSeriesSlidingWindowSplit(BaseCrossValidator):
|
|
|
151
151
|
self.gap = gap
|
|
152
152
|
self.val_ratio = val_ratio
|
|
153
153
|
self.random_state = random_state
|
|
154
|
-
self.
|
|
154
|
+
self.rng = np.random.default_rng(random_state)
|
|
155
155
|
self.overlapping_tests = overlapping_tests
|
|
156
156
|
self.expanding_window = expanding_window
|
|
157
157
|
self.undersample = undersample
|
|
@@ -1613,7 +1613,7 @@ def run_main() -> None:
|
|
|
1613
1613
|
|
|
1614
1614
|
args = parse_args()
|
|
1615
1615
|
|
|
1616
|
-
CONFIG, sys.stdout, sys.stderr, plt, CC,
|
|
1616
|
+
CONFIG, sys.stdout, sys.stderr, plt, CC, rng = stx.session.start(
|
|
1617
1617
|
sys,
|
|
1618
1618
|
plt,
|
|
1619
1619
|
args=args,
|
|
@@ -121,7 +121,7 @@ class TimeSeriesSlidingWindowSplit(BaseCrossValidator):
|
|
|
121
121
|
self.gap = gap
|
|
122
122
|
self.val_ratio = val_ratio
|
|
123
123
|
self.random_state = random_state
|
|
124
|
-
self.
|
|
124
|
+
self.rng = np.random.default_rng(random_state)
|
|
125
125
|
self.overlapping_tests = overlapping_tests
|
|
126
126
|
self.expanding_window = expanding_window
|
|
127
127
|
self.undersample = undersample
|
|
@@ -1582,7 +1582,7 @@ def run_main() -> None:
|
|
|
1582
1582
|
|
|
1583
1583
|
args = parse_args()
|
|
1584
1584
|
|
|
1585
|
-
CONFIG, sys.stdout, sys.stderr, plt, CC,
|
|
1585
|
+
CONFIG, sys.stdout, sys.stderr, plt, CC, rng = stx.session.start(
|
|
1586
1586
|
sys,
|
|
1587
1587
|
plt,
|
|
1588
1588
|
args=args,
|
|
@@ -97,7 +97,7 @@ class TimeSeriesStratifiedSplit(BaseCrossValidator):
|
|
|
97
97
|
self.gap = gap
|
|
98
98
|
self.stratify = stratify
|
|
99
99
|
self.random_state = random_state
|
|
100
|
-
self.
|
|
100
|
+
self.rng = np.random.default_rng(random_state)
|
|
101
101
|
|
|
102
102
|
def split(
|
|
103
103
|
self,
|
|
@@ -670,7 +670,7 @@ def run_main() -> None:
|
|
|
670
670
|
|
|
671
671
|
args = parse_args()
|
|
672
672
|
|
|
673
|
-
CONFIG, sys.stdout, sys.stderr, plt, CC,
|
|
673
|
+
CONFIG, sys.stdout, sys.stderr, plt, CC, rng = stx.session.start(
|
|
674
674
|
sys,
|
|
675
675
|
plt,
|
|
676
676
|
args=args,
|
scitex/ai/plt/_plot_roc_curve.py
CHANGED
scitex/ai/plt/_stx_conf_mat.py
CHANGED
scitex/audio/mcp_server.py
CHANGED
|
@@ -20,12 +20,23 @@ from dataclasses import dataclass, field
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pathlib import Path
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
from mcp.server
|
|
23
|
+
# Graceful MCP dependency handling
|
|
24
|
+
try:
|
|
25
|
+
import mcp.types as types
|
|
26
|
+
from mcp.server import NotificationOptions, Server
|
|
27
|
+
from mcp.server.models import InitializationOptions
|
|
28
|
+
from mcp.server.stdio import stdio_server
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
MCP_AVAILABLE = True
|
|
31
|
+
except ImportError:
|
|
32
|
+
MCP_AVAILABLE = False
|
|
33
|
+
types = None # type: ignore
|
|
34
|
+
Server = None # type: ignore
|
|
35
|
+
NotificationOptions = None # type: ignore
|
|
36
|
+
InitializationOptions = None # type: ignore
|
|
37
|
+
stdio_server = None # type: ignore
|
|
38
|
+
|
|
39
|
+
__all__ = ["AudioServer", "main", "MCP_AVAILABLE"]
|
|
29
40
|
|
|
30
41
|
|
|
31
42
|
@dataclass
|
|
@@ -373,8 +384,8 @@ class AudioServer:
|
|
|
373
384
|
return {"success": False, "error": str(e)}
|
|
374
385
|
|
|
375
386
|
|
|
376
|
-
async def
|
|
377
|
-
"""
|
|
387
|
+
async def _run_server():
|
|
388
|
+
"""Run the MCP server (internal)."""
|
|
378
389
|
server = AudioServer()
|
|
379
390
|
async with stdio_server() as (read_stream, write_stream):
|
|
380
391
|
await server.server.run(
|
|
@@ -391,8 +402,27 @@ async def main():
|
|
|
391
402
|
)
|
|
392
403
|
|
|
393
404
|
|
|
405
|
+
def main():
|
|
406
|
+
"""Main entry point for the MCP server."""
|
|
407
|
+
if not MCP_AVAILABLE:
|
|
408
|
+
import sys
|
|
409
|
+
|
|
410
|
+
print("=" * 60)
|
|
411
|
+
print("MCP Server 'scitex-audio' requires the 'mcp' package.")
|
|
412
|
+
print()
|
|
413
|
+
print("Install with:")
|
|
414
|
+
print(" pip install mcp")
|
|
415
|
+
print()
|
|
416
|
+
print("Or install scitex with MCP support:")
|
|
417
|
+
print(" pip install scitex[mcp]")
|
|
418
|
+
print("=" * 60)
|
|
419
|
+
sys.exit(1)
|
|
420
|
+
|
|
421
|
+
asyncio.run(_run_server())
|
|
422
|
+
|
|
423
|
+
|
|
394
424
|
if __name__ == "__main__":
|
|
395
|
-
|
|
425
|
+
main()
|
|
396
426
|
|
|
397
427
|
|
|
398
428
|
# EOF
|