Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
# index, since the default one resolves to a far larger CUDA build.
- run: |
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e './packages/structured-data-models-client[test]'
pip install -e './packages/structured-data-models-client[test,report]'
pip install "structured-data-models @ git+https://github.com/NVIDIA/structured-data-models.git@${SDM_REF}"
python -m pytest packages/structured-data-models-client/tests -q \
-m 'not live_nim and not live_warehouse'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ these packages. All five distributions share one version and one entry.
`EXPLAIN`. It is `None` when explanations were not asked for.
- The `EXPLAIN` query prefix: `EXPLAIN PREDICT …` adds `'explanation'` to the
call's outputs. A ranking refuses it; a forecast explains each step.
- `sdm_client.reporting.anomaly_report()` draws a `kumo-anomaly` answer over
the readings it scored, as a PDF: the score, the signals it was computed
from, and which rows a thresholder marked. Rows are matched to their scores
by position in the frame that was sent. Detections are marked by whichever
thresholder the answer carries, or by the caller's own, one per row.
`sdm_client.percentile_thresholds()` draws one such line from the scores
alone, by percentile, widened by how scattered the scores are. Install the
drawing with the `report` extra.

### Changed

Expand Down
6 changes: 6 additions & 0 deletions packages/structured-data-models-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ databricks-serving = ["databricks-sdk>=0.68.0,<1.0"]
# the extra installs nothing, and `SDMClient.in_process()` says why. The marker
# is also what lets the workspace lock resolve.
in-process = ["structured-data-models>=0.2.1,<0.3; python_version >= '3.11'"]
# Drawing an answer. matplotlib is the only thing this client plots with, and
# nothing else here plots at all, so a caller who wants no plotting stack is
# not given one. `all` does not carry it for the same reason it does not carry
# `databricks-serving`: it is a thing to do with an answer rather than a
# backend to read.
report = ["matplotlib>=3.8,<4"]
all = [
"structured-data-models-client[relational,sqlite,duckdb,postgres,snowflake,databricks,lakebase,s3]",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
SourceTable,
Table,
)
from sdm_client.thresholds import percentile_thresholds

__all__ = [
'SDMWarning',
Expand Down Expand Up @@ -83,4 +84,5 @@
'UnknownModelError',
'UnsupportedRequestError',
'__version__',
'percentile_thresholds',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: Apache-2.0

r"""Drawing an answer, for the models whose answer is worth looking at.

Needs ``pip install structured-data-models-client[report]``, which brings
matplotlib. Nothing else in this client draws anything, so a caller who does
not want a plotting stack does not get one.
"""

from sdm_client.reporting.anomaly import anomaly_report

__all__ = ['anomaly_report']
Loading
Loading