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

New version: JuliaBUGS v0.7.0 #119572

Merged

Conversation

JuliaRegistrator
Copy link
Contributor

UUID: ba9fb4c0-828e-4473-b6a1-cd2560fee5bf
Repo: https://github.com/TuringLang/JuliaBUGS.jl.git
Tree: 3347280ce1cdf1e0ea2c22e024d86d997019d586

Registrator tree SHA: 17aec322677d9b81cdd6b9b9236b09a3f1374c6a
JuliaRegistrator referenced this pull request in TuringLang/JuliaBUGS.jl Nov 16, 2024
…inition (#237)

The motivation for the PR is initially to allow the use
[`product_distribution`](https://juliastats.org/Distributions.jl/stable/multivariate/#Distributions.product_distribution)
in JuliaBUGS model. By writing

```julia
@bugs begin
    x[1:2] ~ Distributions.product_distribution(fill(Normal(), 2))
end
```

It also enables

```julia
julia> foo(x) = x + 1
foo (generic function with 1 method)

julia> model_def = @bugs begin
           a = Main.foo(b)
       end
quote
    a = Main.foo(b)
end

julia> compile(model_def, (;b=2))
BUGSModel (parameters are in transformed (unconstrained) space, with dimension 0):

  Model parameters:

  Variable sizes and types:
    a: type = Int64
    b: type = Int64
```

i.e., an easier way to introduce external functions into JuliaBUGS. 

This can't fully replace `@register_primitive` yet, because using `Main`
module is relying on Julia runtime behavior and not very intuitive.
Examples:

```julia
julia> module TestModule
           bar(x) = x + 1
       end
Main.TestModule

julia> model_def = @bugs begin
           a = TestModule.bar(b)
       end
quote
    a = TestModule.bar(b)
end

julia> compile(model_def, (; b = 1))
ERROR: UndefVarError: `TestModule` not defined in `JuliaBUGS`
...
```

one would need to do 

```julia
julia> model_def = @bugs begin
           a = Main.TestModule.bar(b)
       end
quote
    a = Main.TestModule.bar(b)
end
```

also

```julia
julia> @testset "t" begin
           foo1(x) = x + 1
           model_def = @bugs begin
               a = Main.foo1(b)
           end
           compile(model_def, (; b= 1))
       end
t: Error During Test at REPL[18]:1
  Got exception outside of a @test
  UndefVarError: `foo1` not defined in `Main`
...
```
Copy link
Contributor

Hello, I am an automated registration bot. I help manage the registration process by checking your registration against a set of AutoMerge guidelines. If all these guidelines are met, this pull request will be merged automatically, completing your registration. It is strongly recommended to follow the guidelines, since otherwise the pull request needs to be manually reviewed and merged by a human.

1. AutoMerge Guidelines are all met! ✅

Your new version registration met all of the guidelines for auto-merging and is scheduled to be merged in the next round (~20 minutes).

2. To pause or stop registration

If you want to prevent this pull request from being auto-merged, simply leave a comment. If you want to post a comment without blocking auto-merging, you must include the text [noblock] in your comment.

Tip: You can edit blocking comments to add [noblock] in order to unblock auto-merging.

@JuliaTagBot JuliaTagBot merged commit b6e8bde into master Nov 16, 2024
20 checks passed
@JuliaTagBot JuliaTagBot deleted the registrator-juliabugs-ba9fb4c0-v0.7.0-a890b4ef2d branch November 16, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants