You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extract Vis._identity_args() helper to unify delegate call signatures #65
Three delegation sugar properties use three different call shapes for
the same identity triple, flagged by the adversarial review
(`src/pymat/vis/_model.py`):
If mat-vis-client ever makes `tier` keyword-only (`*, tier: str = "1k"`),
`.channels` + `.materialize` break while `.mtlx` keeps working — and the
breakage is silent-ish (`TypeError: got positional arg for keyword-only`).
Fix
def_identity_args(self) ->tuple[str, str, str]:
"""Return (source, material_id, tier) — the positional arg triple that mat-vis-client methods expect. Call guarded by has_mapping."""return (self.source, self.material_id, self.tier)
@propertydefmtlx(self) ->MtlxSource|None:
ifnotself.has_mapping:
returnNonesrc, mid, tier=self._identity_args()
returnself.client.mtlx(src, mid, tier=tier)
# Same shape for .channels and .materialize.
Plus: grep for every remaining `self.client.X(self.source, self.material_id, ...)`
and route through the helper. This is a consistency refactor — not
behavioral.
Why a helper instead of explicit calls everywhere
The helper makes it one place to update when mat-vis-client changes
signatures. Also provides a seam for testing (monkeypatch
`_identity_args` to return a fixture triple).
Activity
feat: 3.1.2 — milestone 1 audit follow-ups (13 issues closed)