-
Notifications
You must be signed in to change notification settings - Fork 32
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 by Bors] - Hotfixes after #309 #351
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…cPPL.jl into tor/submodels-hotfixes
bors try |
One thing is leaving me very confused. If I try to run the doctests locally, it'll complain because DynamicPPL.jl/src/submodel_macro.jl Line 166 in ce0a3e8
LoadError: LoadError: rather than just LoadError . Aaaand I have no idea why 🤷
|
Is there something wrong with |
@devmotion @phipsgabler @yebai Could one of you have a look here? I think it's pretty "simple" given what we have in master. |
quote | ||
$(esc(:__varinfo__)) = last( | ||
$(DynamicPPL._evaluate!!)($(esc(expr)), $(esc(:__varinfo__)), $(ctx)) | ||
$retval, $(esc(:__varinfo__)) = $(DynamicPPL._evaluate!!)( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like returning both the retval
and varinfo
. I was talking with Philip that we should consider enforcing this more systematically. Roughly speaking, we can consider adopting the notation that retval
refers to generated quantities and varinfo
refers to model parameters. This would help clarify the submodel notation as well, i.e.
x = SubModel
will extractretval
and assign it to LHSx ~ SubModel
will extractvarinfo
and assign it to LHS
Following this view, we no longer need to concern ourselves what is the semantics if the returned value retval
of SubModel
is deterministic in case 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused. In both those cases we still have to concern ourselves with the return-value, no? Essentially the difference between =
and ~
will be whether we have $retval
or varinfo
below, right?
Anyways, you're happy with this right? You're just talking about potentially also supporting ~
later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, happy with this PR.
I think retval
and varinfo
provides a clear semantical distinction between =
and ~
. If we always return both, (e.g. we can return (, varinfo)
in case retval
is empty), we can extract either retval
or varinfo
for =
or ~
.
bors r+ |
You broke it (or rather the last PR that was merged) 😛 It waits until all tests listed in bors.toml are finished (failed or succeeded) but since there are no tests of the form DynamicPPL.jl/.github/workflows/CI.yml Line 19 in 1744ba7
|
Nested |
As I said, I really didn't want the PR to get merged when it did 😅 But sorry! That was not the intended effect.
I get that nested |
Canceled. |
Any final things before we merge this @devmotion ? |
I think Documenter creates some modules internally, I think this explains differences between running the examples in the REPL and running the doc tests. |
No, but it's also a bit difficult to see if e.g. anything else is missing 😄 I'm happy if bors is 🤖 |
That was my immediate thought as well, but I can't properly understand exactly what goes wrong, only that I guess this could be the cause. But I'll leave the version that works with Documenter.jl 👍
Yeah I know, def non-ideal with such a big change 😕 But I'll bors it then 👍 |
bors r+ |
Build failed: |
Sooo the behavior of |
It seems we have to add a doctestfilter ( DynamicPPL.jl/test/runtests.jl Line 62 in 1744ba7
LoadError: LoadError: with Julia 1.3?
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
bors r+ |
Build failed: |
docs/make.jl
Outdated
@@ -18,6 +18,9 @@ makedocs(; | |||
r"(Array{.+,\s?1}|Vector{.+})", | |||
# Older versions will show "Array{...,2}" instead of "Matrix{...}". | |||
r"(Array{.+,\s?2}|Matrix{.+})", | |||
# Errors from macros sometimes result in `LoadError: LoadError:` | |||
# rather than `LoadError:`, depending on Julia version. | |||
r"ERROR: LoadError: (LoadError:\s)?+", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use
r"ERROR: LoadError: (LoadError:\s)?+", | |
r"ERROR: (LoadError:\s)+", |
? And it seems you forgot to update test/runtests.jl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use
Is this correct though? Don't we want to match at least one LoadError
?
And it seems you forgot to update test/runtests.jl?
Ah thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to match at least one
LoadError
?
+
matches one or more occurrences so it doesn't match only "ERROR: "
:
julia> regex = r"ERROR: (LoadError:\s)+";
julia> match(regex, "ERROR: ") === nothing
true
julia> match(regex, "ERROR: LoadError: ")
RegexMatch("ERROR: LoadError: ", 1="LoadError: ")
julia> match(regex, "ERROR: LoadError: LoadError: ")
RegexMatch("ERROR: LoadError: LoadError: ", 1="LoadError: ")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, yeah I knew that, hence why I used ?
on the second one. Now you might ask "then why did you just say what you just did?", to which I don't have a good answer 🙃 Thanks man!
EDIT: Oh wait, now I remember why I did it! If you do (LoadError:\s)+
you'll end up comparing the output to Error:
, no? While we want to compare it to Error: LoadError:
, i.e. all the redundant LoadError:
removed?|
EDIT 2: Nope:) I guess it removes it from both the expected output and the actual output then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doctest filters will be applied to both the expected output and the actual output and then the matches will be removed. The remaining string is checked for equality. So the LoadError: will be removed from the expected output as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my original understanding when I wrote it, but I think I must have missed some whitespace so it didn't match but instead complained that "ERROR: ...ddin't match
ERROR: LoadError: ...`, i.e. the display seemed to indicate it was only removed from the expected output which confused me.
What I've learned tonight: I should not let myself be so easily swayed by displayed information:)
tryTimed out. |
bors r+ |
Build failed: |
bors r+ |
Pull request successfully merged into master. Build succeeded: |
#309 was merged a bit too soon, for example
bors
was never run on the final version due to some issues. Before we make a release, we should make sure that it all works properly.