Skip to content

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

Closed

Description

@bernhard-42

Description

pymat.vis._model.Vis which gets returned e.g. from stainless.vis looks like an internal implementation class

Steps to Reproduce

In [17]: from pymat import stainless

In [18]: stainless.vis
Out[18]: Vis(source='ambientcg', material_id='Metal012', tier='1k', finishes={'brushed': {'source': 'ambientcg', 'id': 'Metal012'}, 'polished': {'source': 'ambientcg', 'id': 'Metal049A'}, 'dirty': {'source': 'ambientcg', 'id': 'Metal049B'}}, roughness=0.3, metallic=1.0, base_color=(0.75, 0.75, 0.77, 1.0), ior=None, transmission=0.0, clearcoat=None, emissive=None)

In [19]: type(stainless.vis)
Out[19]: pymat.vis._model.Vis

In my code I now need to say

pbr: pymat.vis._model.Vis = stainless.vis

which looks like using an internal model not meant to be exposed.

Do I miss something?

Expected Behavior

I would expect Vis to be a clearly public class (now private model in the module path)

Actual Behavior

see above

Environment

any

Additional Context

No response

Possible Solution

No response

Changelog Category

Fixed

Activity

  1. added
    bug
    on Apr 22, 2026
  2. added a commit that references this issue on May 6, 2026
    8362827
  3. gerchowl commented on May 6, 2026

    @gerchowl
    Contributor

    Shipped in py-materials 3.10.0.

    Vis / VisDeltas / FinishEntry are now formally public:

    • __module__ rewritten to pymat.vis so type(), repr, IDE auto-import, and Sphinx all surface the public path.
    • pymat.vis module docstring documents the stability contract: field set follows semver; additive changes minor; renames need major.
    • Pinned by tests/test_vis.py::TestPublicApiContract.
    from pymat.vis import Vis, VisDeltas, FinishEntry  # public

    Underscore-prefixed paths (pymat.vis._model, Vis._finish, Vis._textures, pymat.vis._client) remain private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions