Skip to content

fix Model docstring #6048

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pymc/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,15 @@ def __init__(self, mean=0, sigma=1, name=''):
# variables in several ways note, that all variables
# will get model's name prefix

# 3) you can create variables with Var method
self.Var('v1', Normal.dist(mu=mean, sigma=sd))
# this will create variable named like '{prefix::}v1'
# 3) you can create variables with the register_rv method
self.register_rv(Normal.dist(mu=mean, sigma=sigma), 'v1', initval=1)
# this will create variable named like '{name::}v1'
# and assign attribute 'v1' to instance created
# variable can be accessed with self.v1 or self['v1']

# 4) this syntax will also work as we are in the
# context of instance itself, names are given as usual
Normal('v2', mu=mean, sigma=sd)
Normal('v2', mu=mean, sigma=sigma)

# something more complex is allowed, too
half_cauchy = HalfCauchy('sigma', beta=10, initval=1.)
Expand Down Expand Up @@ -510,7 +510,6 @@ def __init__(self, mean=0, sigma=1, name=''):
CustomModel(mean=2, name='second')

# variables inside both scopes will be named like `first::*`, `second::*`

"""

if TYPE_CHECKING:
Expand Down