Skip to content

Show dims in model textual representation #7154

@ricardoV94

Description

@ricardoV94

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions