You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really nice, for record-keeping and transparency, if
for constraint in constraints:
print(constraint)
told you enough about the constraints you used for an MCMC that you could re-configure that chain run from scratch. The descriptions should also be human-readable (like "Parts must be contiguous.").
Having these helpful __str__ methods would also be useful in IPython/Jupyter environments, so that a user could quickly verify that a constraint is what they think it is.
The text was updated successfully, but these errors were encountered:
Would something like this work? It is a bit of a mess of metaprogramming, but it is a decorator that can be attached to any function, and uses the first line of the docstring as the repr. It has some nice features, like tab-completion continuing to work.
I've attached a screenshot of how to use it on an existing constraint.
I can document it a bit and submit a pull request if it would be helpful.
I like the idea of this approach! I'm worried that using the first name of the doc string might be a brittle solution. It would also be nice if we could bind some parameters (like functools.partial) of the function, and see those in the generated __repr__, since we run into that a lot. Maybe the name of the function and the parameters supplied would be sufficient for our needs? Could we adapt this approach to something along those lines?
It would be really nice, for record-keeping and transparency, if
told you enough about the constraints you used for an MCMC that you could re-configure that chain run from scratch. The descriptions should also be human-readable (like "Parts must be contiguous.").
Having these helpful
__str__
methods would also be useful in IPython/Jupyter environments, so that a user could quickly verify that a constraint is what they think it is.The text was updated successfully, but these errors were encountered: