Updated Oct 19, 2026

Static Code Analysis

Find suspicious units and uncertainty patterns in Python

unit-uncertainty-audit is an offline AST audit for units and uncertainty patterns in Python source.

Agent

overview

What unit-uncertainty-audit does

Statically audit Python source for silent unit and measurement-uncertainty mistakes (stripped units, offset temperatures, population vs sample standard deviation, broken propagation, hard-coded CODATA constants) with K-Dense's audit_units. JSON findings; code is parsed, never run.

Parse Python source without importing or running it. Return JSON findings with rule, severity, line, column, message and remedy, plus file and suppression counts. Heuristics cover stripped units, offset-temperature arithmetic, uncertainty propagation, numpy.std defaults and hardcoded scientific constants.

Recursively scan 1 to 50 Python files of at most 4 MiB each. In-file audit-units:ignore suppressions are honored and counted. Findings remain successful data through --fail-on none; a syntax error in any file fails without output. No numerical experiment or network lookup is performed.

Packaged version: 065b734. Upstream license: MIT.

source github.com/k-dense-ai/scientific-agent-skills/tree/065b734670d7d990627dbc06a05b5a99be33f1f1/skills/uncertainty-and-units

use cases

Where unit-uncertainty-audit fits

Review standard-deviation assumptions

Flag numpy.std patterns that need a deliberate degrees-of-freedom choice.

Locate hardcoded constants

Find scientific constants that may belong in a maintained constants library.

Triage scientific-code heuristics

Receive rule locations and suggested remedies for manual review.

reference

unit-uncertainty-audit inputs and flags

1 inputs
NameTypeFlagDescription
sourceFOLDER--sourceFolder with 1–50 Python files (searched recursively), each at most 4 MiB.

Showing key inputs. unit-uncertainty-audit exposes 1 inputs in total.

example

Run unit-uncertainty-audit

unit-uncertainty-audit · command
python3 /app/run.py --source ./source ./output

guidance

Choosing unit-uncertainty-audit

Use unit-uncertainty-audit to flag scientific-code patterns for review. It does not prove physical correctness, validate a model or replace numerical tests. General type checkers and linters do not establish unit or uncertainty correctness either.

faq

unit-uncertainty-audit questions

source: Folder with 1–50 Python files (searched recursively), each at most 4 MiB.

Parse Python source without importing or running it. Return JSON findings with rule, severity, line, column, message and remedy, plus file and suppression counts. Heuristics cover stripped units, offset-temperature arithmetic, uncertainty propagation, numpy.std defaults and hardcoded scientific constants.

Recursively scan 1 to 50 Python files of at most 4 MiB each. In-file audit-units:ignore suppressions are honored and counted. Findings remain successful data through --fail-on none; a syntax error in any file fails without output. No numerical experiment or network lookup is performed.

Use unit-uncertainty-audit to flag scientific-code patterns for review. It does not prove physical correctness, validate a model or replace numerical tests. General type checkers and linters do not establish unit or uncertainty correctness either.

The public image repository gives immutable image and ORAS download commands, the expected source/notices bundle checksum and pinned upstream source directions. The accompanying OCI bundle retains the original build recipe, runtime sources and full installed notices. The Git recipe keeps primary notices and an exact layer/hash index; it does not duplicate the full installed notice tree or mirror every upstream source archive. Image, source and license notice downloads.

Run unit-uncertainty-audit yourself

The saved fixture verifier confirmed two files scanned, four findings, including UNC002 on line 4 and CONST001 on line 5, with no findings in clean.py. Saved counts were one medium and three low findings. The complete native report was not retained. The command shows the container entrypoint with example paths.

Facts on this page come from the live Trickest tool library.