Skip to content

Define model generator exactly as specified by the user #109

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 3 commits into from
Jun 23, 2020

Conversation

devmotion
Copy link
Member

This PR fixes #106 by defining a model generator with exactly the function signature that the user specified (i.e., all positional arguments and keyword arguments are preserved).

E.g.,

@model function test1(x, y = 4.0)
    x ~ Normal(0, 1)
    y ~ Exponential()
end

defines the model generator test1(x, y = 4.0), whereas

@model function test2(x; y = 4.0)
    x ~ Normal(0, 1)
    y ~ Exponential()
end

defines the model generator test2(x; y = 4.0). Thus in the first case one can generate a model with test1(3.0) and test1(3.0, 10.0) but not test1(3.0, y = 10.0), whereas in the second case one can define a model with test2(3.0) and test2(3.0; y = 10.0) but not test2(3.0, 10.0).

@devmotion
Copy link
Member Author

I also played around a bit with bors in my own repos, and it seems the status has to be specified differently for Github actions.

@devmotion
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request May 8, 2020
@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #109 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   74.91%   74.97%   +0.05%     
==========================================
  Files          14       14              
  Lines         901      903       +2     
==========================================
+ Hits          675      677       +2     
  Misses        226      226              
Impacted Files Coverage Δ
src/compiler.jl 88.03% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b4be6b...7b62284. Read the comment docs.

@devmotion devmotion mentioned this pull request May 9, 2020
bors bot added a commit that referenced this pull request May 9, 2020
111: Fix bors status r=devmotion a=devmotion

Just cherry picked the commit in #109 that fixes the bors status for Github actions.

Co-authored-by: David Widmann <[email protected]>
@yebai yebai closed this May 13, 2020
@mohamed82008 mohamed82008 reopened this May 13, 2020
@yebai yebai changed the base branch from master to dev June 23, 2020 19:29
@yebai yebai merged commit c85e73a into dev Jun 23, 2020
@bors bors bot deleted the function_signature branch June 23, 2020 21:34
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.

Respect user-provided function signatures
3 participants