Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not monkey-patch Ipython pretty representation on model variables #7712

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Mar 5, 2025

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 ricardoV94 added major Include in major changes release notes section model labels Mar 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
major Include in major changes release notes section model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant