pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Do not monkey-patch Ipython pretty representation on model variables

Open ricardoV94 opened this issue 9 months ago • 0 comments

Only model objects will have a default Ipython/Jupyter representation.

This simplifies the codebase and saves half a second of import time.

Before:

import pymc as pm

with pm.Model() as m:
    x = pm.Normal("x")
    a = pm.Deterministic("a", x + 1)
    y = pm.Normal("y", a)

# Before this would print x ~ Nomal(0, 1)
# Now it just prints x (the name)
x
# x
# Still prints the same as before
m
# x ~ Normal(0, 1)
# y ~ Normal(f(x), 1)
# a ~ Deterministic(f(x))

📚 Documentation preview 📚: https://pymc--7712.org.readthedocs.build/en/7712/

ricardoV94 avatar Mar 05 '25 13:03 ricardoV94