sir3stoolkit package

Subpackages

Submodules

sir3stoolkit.dependency_check module

Shared helper for sir3stoolkit’s optional (“mantle”) third-party dependencies.

Each sir3stoolkit.mantle module calls require_packages() with its own actual requirements as the first thing it does (before any of the third-party imports it’s checking for), so a missing package surfaces as one clear, actionable message naming exactly what’s missing and how to install it - instead of a raw ModuleNotFoundError/ImportError traceback from wherever inside that package’s own import machinery it happened to fail.

@author: Jablonski

sir3stoolkit.dependency_check.require_packages(module_name: str, *package_names: str) → None[source]

Verify each of package_names is importable, and raise one combined ImportError naming every missing one if any are missing.

Uses importlib.util.find_spec() rather than actually importing each package - cheap (no module code executes) and side-effect-free, so calling this before the real imports below it doesn’t do any of that work twice.

Parameters:
  • module_name (str) – The calling module’s __name__, used in the error message so the user knows which part of sir3stoolkit needs the missing package(s).

  • package_names (str) – Top-level import names to check (e.g. “pandas”, “geopandas”). Assumed to match their PyPI/pip distribution name - true for every package sir3stoolkit’s “mantle” extra currently uses.

Raises:

ImportError – If any of package_names is not importable.

sir3stoolkit.logging_utils module

sir3stoolkit.logging_utils.emit_message(logger: Logger, message) → None[source]

Emit a legacy message with level inference.

sir3stoolkit.logging_utils.get_logger(name: str) → Logger[source]

Create/get module logger with a host-aware fallback print handler.

sir3stoolkit.logging_utils.get_process_executable_name() → str[source]

Get executable name of current process when available.

sir3stoolkit.logging_utils.get_process_executable_path() → str | None[source]

Get absolute path to current process executable when available.

sir3stoolkit.logging_utils.is_host_process() → bool[source]

Return True when running inside SirGraf host process.

Module contents

sir3stoolkit: Python client for SIR 3S (pipe network simulation/analysis software, 3S Consult).

AI assistant writing code against this package? Quick orientation: - core.wrapper: thin low-level wrapper around the SIR 3S .NET Toolkit API (SIR3S_Model:

OpenModel, GetValue/SetValue, ExecCalculation, GetResultValue, …).