_images/logo.svg

Precision diagnostics for scientific Python ecosystems.#

Install it#

conda install -c uibcdf smonitor

Use it#

import smonitor

smonitor.configure(profile="user", theme="rich")

@smonitor.signal(name="mylib.select")
def select(items, query):
    if query == "all":
        smonitor.emit(
            "WARNING",
            "Selection is ambiguous.",
            code="MYLIB-W001",
            source="mylib.select",
            extra={"hint": "Use a more specific selector, for example atom_name == 'CA'."},
        )
    return items

What happens here:

  • End users get a clear warning plus an actionable hint.

  • Library maintainers keep stable contracts (code, signal) for support and QA.

  • Teams can route the same events to bundles and machine-readable workflows.

Before:

  • ValueError: invalid argument

With SMonitor:

  • ERROR [MYLIB-E001]: Input is invalid. Hint: Use a non-negative value.

Profiling and observability#

SMonitor includes lightweight profiling for library workflows:

  • decorator timing,

  • manual spans,

  • timeline buffering and export.

Use this for QA/debug observability without introducing heavy profiler dependencies.

Why adopt now#

  • Make warnings and errors clearer and more actionable for end users.

  • Reduce support time with stable diagnostic contracts (code, signal).

  • Improve QA and automation workflows with structured events and bundles.

Ecosystem proof#

Integrated across the current UIBCDF scientific stack:

Start with the User Guide and follow the route matching your role.