Worked Examples

Developer reference for dimensional analysis — Sustainable Catalyst Workbench

Developer reference for dimensional analysis — Sustainable Catalyst Workbench Availability: The physical-quantity implementation and the local examples below were inspected/tested at the pinned source revision. Full application st

ProductSustainable Catalyst WorkbenchUpdatedNovember 11, 2026Reading time4 minutes

Developer reference for dimensional analysis — Sustainable Catalyst Workbench

Availability: The physical-quantity implementation and the local examples below were inspected/tested at the pinned source revision. Full application startup, browser controls, authentication, WordPress integration and deployed behavior remain UNVERIFIED. These are internal drafts, not approved public instructions. A local router test is not a production acceptance test.

The source module’s historical label is v11.7.0, but backend/app/release.py currently reports 14.0.0 and the README reports v10.4.0. Use the commit to identify this behavior; do not infer installed-version compatibility from those conflicting labels.

Implemented entry points and boundaries

The implementation is backend/app/v1170.py, using a module-level Pint UnitRegistry(autoconvert_offset_to_baseunit=True). It imports the canonical APP_VERSION, so its responses currently report 14.0.0, despite its historical v11.7.0 module header. backend/app/main.py includes v1170.router, but full startup is blocked earlier by missing app.v10110. No application source was modified during this documentation check.

Route in source Request/behavior Verification scope
GET /v1170/status Engine/capability metadata Isolated router checked; metadata is not execution evidence
POST /calculation-engine/v1/quantities PhysicalQuantityRequest → execute_quantity Local positive and negative requests checked
POST /calculation-engine/v1/quantities/calculation-object QuantityCalculationObjectRequest → extension Existing extension test passed with the isolated router

These routes contain no route-level authentication dependency in this module. That does not establish whether a full deployment has upstream authentication, tenancy or permissions. The minimal test app cannot validate those boundaries.

Request contract

operation is a literal enumeration: parse, convert, dimensionality, compatible, add, subtract, multiply, divide, power, to-base-units, derive, consistency-check. An operand has float magnitude and string unit (maximum 300 characters). expression and formula are optional strings limited to 2,000 characters; targetUnit is limited to 300; operands has maximum 100 elements; exponent is an optional float.

These are schema limits, not complete semantic validation. Most operation-specific required fields are checked inside execute_quantity and raise ValueError. For example, dimensionality without an expression passes request-model validation but fails execution. Invalid operation names fail model validation. consistency-check requires a nonempty operand list and compares dimensions only. It is not a symbolic equation checker.

derive creates q1, q2, … from the operands and evaluates a formula with restricted builtins. It is not an independently audited sandbox or a proof of scientific validity. Do not treat its implementation as authorization to accept arbitrary untrusted formulas. This audit used controlled inputs only; it did not assess adversarial expression safety or resource limits.

Result and provenance

Successful responses include ok, schema sc-workbench-physical-quantity-result/1.0, version, operation, engine: pint, runtime: python, result, details, verification, wordpressRequired: false and resultHash. Quantity serialization includes magnitude, unit, text, dimensionality and baseUnits. compatible and consistency-check return booleans rather than quantity objects. dimensionality returns a dimension map and baseUnits. Clients must branch on operation rather than assume result.magnitude always exists.

The calculation-object extension calls build_calculation_object from v1100, adds extensions.physicalQuantity, units/execution-plan/verification fields, records physicalQuantityResultHash in provenance, and recalculates the calculation-object hash. This demonstrates an in-memory response extension; persistence, governed-object registration and cross-app delivery were not verified.

Optional clients

The standalone client delegates quantity and calculation-object requests to the two POST paths. The optional WordPress adapter proxies through scwb_v1100_backend_request. Its REST namespace is sc-workbench/v1/v1170; /status, /quantities and /calculation-object require edit_posts. The status shortcode is sc_workbench_physical_quantities_status. These are inspected source contracts, not verified WordPress/browser instructions; no install or import was performed.

Focused tests and release drift

Existing test functions check conversion, dimension exponents, compatible addition, derived output, consistency and the calculation-object extension; six passed with the isolated router. test_v1170_status fails its old 11.7.0 version expectation. In tests/test_v1170_static.py, three source-contract tests pass; test_release_identity_v1170 and test_compose_tracks_current_release fail outdated version expectations. Running the normal backend test file fails collection on missing app.v10110 before those assertions execute.

Locally tested invalid operation produces HTTP 422. Missing operation-specific data, an unknown unit and incompatible addition produce HTTP 500 in the minimal router fixture because this module does not translate their execution exceptions. Do not promise that status/body on a deployed app with different middleware. Fixes to application code, structured errors, auth and release metadata are outside this five-article update.

Evidence and related reading

Physical-quantity request models, operations, result serialization and routes; Existing quantity tests; Canonical source release identity.

Verification on 2026-11-10: 23 focused local assertions passed against the actual quantity router in a minimal FastAPI application. Six existing upstream test functions passed in that isolated router context; the status test failed because it expects 11.7.0 rather than the returned 14.0.0. The normal upstream suite could not collect because full app.main imports missing app.v10110. Static tests: three passed, two failed on old release/image expectations. These failures were recorded, not patched away. No deployed endpoint, UI, permission or scientific peer-review acceptance was performed.

Related: overview, worked how-to, research protocol, developer reference, troubleshooting. Technical/scientific review owner remains unassigned; publication remains blocked.

Scroll to Top