root_mcp.common package
Common utilities shared between core and extended modes.
- exception root_mcp.common.AnalysisError[source]
Bases:
ROOTMCPErrorRaised when analysis operations fail.
- exception root_mcp.common.FileOperationError[source]
Bases:
ROOTMCPErrorRaised when file operations fail.
- class root_mcp.common.LRUCache(max_size)[source]
Bases:
Generic[T]Generic LRU cache implementation.
- Parameters:
max_size (int)
- __init__(max_size)[source]
Initialize LRU cache.
- Parameters:
max_size (int) – Maximum number of items to cache
- get(key)[source]
Get item from cache.
- Parameters:
key (str) – Cache key
- Returns:
Cached item or None if not found
- Return type:
T | None
- exception root_mcp.common.ROOTMCPError[source]
Bases:
ExceptionBase exception for ROOT-MCP errors.
- exception root_mcp.common.SecurityError[source]
Bases:
ROOTMCPErrorRaised when a security constraint is violated.
- exception root_mcp.common.ValidationError[source]
Bases:
ROOTMCPErrorRaised when validation fails.
- root_mcp.common.ensure_path_exists(path)[source]
Ensure a path exists, creating parent directories if needed.
- root_mcp.common.get_root_features()[source]
Get a dict of optional ROOT feature availability.
- Example return:
{“rdataframe”: True, “roofit”: True, “tmva”: False, “minuit2”: True}
Returns empty dict if ROOT is not available. Result is cached after the first call.
- root_mcp.common.get_root_version()[source]
Get the ROOT version string (e.g. ‘6.32/02’), or None if not available.
Result is cached after the first call.
- Return type:
str | None
- root_mcp.common.is_root_available()[source]
Check whether native ROOT/PyROOT is importable.
Result is cached after the first call.
- Return type:
- root_mcp.common.sanitize_filename(filename)[source]
Sanitize a filename by removing/replacing invalid characters.