pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Show dims in model textual representation

Open ricardoV94 opened this issue 1 year ago • 0 comments

Description

Currently, there is no information about dimensionality of variables:

import pymc as pm
from pymc.printing import str_for_model

with pm.Model(coords={"trial": range(10)}) as m:
    x = pm.Normal("x")
    y = pm.Normal("y", dims=["trial"])

print(str_for_model(m))
x ~ Normal(0, 1)
y ~ Normal(0, 1)

Would be nice if output was something like the following:

x ~ Normal(0, 1)
y ~ Normal(0, 1, dims=[trial])
x ~ Normal(0, 1)
y ~ Normal(0, 1) [trial]
x ~ Normal(0, 1)
y[trial] ~ Normal(0, 1)

Do you like any of these. Better suggestions?

ricardoV94 avatar Feb 13 '24 10:02 ricardoV94