Skip to content

fix(vis): declare Vis as public API (3.9.1) - #186

Merged
gerchowl merged 2 commits into
mainfrom
feature/3.9.1-vis-public-api
May 6, 2026
Merged

gerchowl merged 2 commits into
mainfrom
feature/3.9.1-vis-public-api

Conversation

@gerchowl

@gerchowl gerchowl commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrites Vis.__module__ / VisDeltas.__module__ / FinishEntry.__module__ to "pymat.vis" at the public re-export site, so type(material.vis), repr, IDE auto-import suggestions, and Sphinx cross-references stop pointing at the private pymat.vis._model location.
  • Adds a "Public API contract" section to the pymat.vis module docstring: field names and constructor signatures of Vis / VisDeltas / FinishEntry follow semver. The Vis field set mirrors glTF 2.0 / Three.js MeshPhysicalMaterial — stable external spec, low freeze cost.
  • Pins the contract with tests/test_vis.py::TestPublicApiContract (4 tests).

No code change, no API change — metadata + docs catching up to facts. The classes have been in pymat.vis.__all__ for three minor versions; this release just stops the underscore-prefixed import path from looking like the canonical one.

Why

Bernhard hit this in build123d#1270 and filed mat-vis #282 cross-referencing our #98. Closing both with a stake-in-the-ground rather than another quiet release.

Test plan

  • uv run pytest — 576 passed, 18 skipped
  • New: TestPublicApiContract::test_vis_module_path_is_public
  • New: TestPublicApiContract::test_visdeltas_module_path_is_public
  • New: TestPublicApiContract::test_finishentry_module_path_is_public
  • New: TestPublicApiContract::test_repr_uses_public_path (behavioral pin via type(stainless.vis).__module__)

After merge

release-please picks up the fix: commit → opens / updates Release PR → tag → PyPI publish via release.yml (OIDC trusted publisher).

Closes #98
Refs MorePET/mat-vis#282

gerchowl added 2 commits May 6, 2026 20:37
Vis, VisDeltas, and FinishEntry have been re-exported from pymat.vis
since 3.4 / 3.6 / 3.8 respectively, but their __module__ attribute
still pointed at the private pymat.vis._model location — so
type(material.vis), repr, IDE auto-import, and Sphinx all surfaced
the underscore-prefixed path, pushing downstream code (build123d,
ocp_vscode) toward `from pymat.vis._model import Vis`.

Rewrite __module__ at the public re-export site and document the
public-API contract in the pymat.vis docstring: field names and
constructor signatures of these three types follow semver. The Vis
field set mirrors glTF 2.0 / Three.js MeshPhysicalMaterial — a
stable external spec, so the freeze cost is intentionally low.

Pin with TestPublicApiContract so a future refactor that moves the
implementation can't silently regress the public path.

Closes #98
Refs MorePET/mat-vis#282
@gerchowl
gerchowl merged commit 8362827 into main May 6, 2026
21 checks passed
@vig-os-release-app vig-os-release-app Bot mentioned this pull request May 5, 2026
6 tasks
gerchowl added a commit that referenced this pull request May 6, 2026
Bundles four schema-foundation feats merged after 3.9.0 plus the Vis
public-API clarification into a single release:

- feat(schema): _sources provenance table (#150 / #182)
- feat(schema): _stddev sibling sugar + ufloat boundary helper
  (#149 / #183)
- feat(policy): data licensing policy + CI license gate (#174 / #184)
- feat(schema): T-dependent property curves (#148 / #185)
- fix(vis): declare Vis as public API (#98 / #186)

Three feats × one fix → minor version bump per semver. The version
3.9.1 originally proposed for the Vis public-API change alone became
inconsistent once the four schema feats had landed on main without
their own release cut, so they're rolled into 3.10.0 honestly rather
than shipped as a misleading patch.

CHANGELOG entry for 3.10.0 covers all five items with PR + issue
links. .release-please-manifest.json synced to 3.10.0 so the open
release-please PR (#80) recomputes correctly going forward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] material.vis returns object of a class in a private model

1 participant