Skip to content
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

Add convenience forms for update and regenerate with optional args and argdiffs #236

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

marcoct
Copy link
Collaborator

@marcoct marcoct commented Apr 11, 2020

"""
function update(trace;
args::Tuple=get_args(trace),
argdiffs::Tuple=map((_) -> NoChange(), args),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the default be NoChange or UnknownChange?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there are two convenience forms:

If you provide args, then argdiffs is an optional keyword argument that defaults to UnknownChange. (This is so you don't need to construct the unknown change argdiffs).

If you do not provide args then argdiffs is automatically set to NoChanges. (This is a common case e.g. for top-level generative functions on which we are doing MCMC or optimization).

@marcoct marcoct changed the title Add keyword args for common defaults for update and regenerate Add convenience forms for update and regenerate with optional args and argdiffs Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants