-
-
Notifications
You must be signed in to change notification settings - Fork 48
Better error messages for incomplete probability calls #1021
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
WardBrian
merged 13 commits into
stan-dev:master
from
adamhaber:feature/incomplete-probability-calls
Nov 4, 2021
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6b25668
add match pattern
adamhaber 1dc5500
compare against all distributions
adamhaber 5983802
add tests
adamhaber 65f4780
move hardcoded suffixes to utils
adamhaber c6dbdd9
add case for lpdf-lpmf change
adamhaber 8f7779d
add tests
adamhaber 4d40d92
Update test/integration/bad/missing_dist_suffix/non_existing_distribu…
adamhaber 88630fe
add more tests
adamhaber 86f4fc2
Merge branch 'master' into feature/incomplete-probability-calls
adamhaber 7617a6c
migrate code to typechecker
adamhaber 02357e5
refactor to use new utils
adamhaber c66d087
dune prmote
adamhaber 5bebf3b
switch to env.mem
adamhaber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| (include ../dune) |
5 changes: 5 additions & 0 deletions
5
test/integration/bad/missing_dist_suffix/non_existing_distribution_suffix1.stan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| data { | ||
| } | ||
| model { | ||
| target += von_mises_cdf(1|0,1); | ||
| } |
5 changes: 5 additions & 0 deletions
5
test/integration/bad/missing_dist_suffix/non_existing_distribution_suffix2.stan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| data { | ||
| } | ||
| model { | ||
| target += von_mises_lcdf(1|0,1); | ||
| } |
5 changes: 5 additions & 0 deletions
5
test/integration/bad/missing_dist_suffix/non_existing_distribution_suffix3.stan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| data { | ||
| } | ||
| model { | ||
| target += von_mises_lccdf(1|0,1); | ||
| } |
5 changes: 5 additions & 0 deletions
5
test/integration/bad/missing_dist_suffix/non_existing_distribution_suffix4.stan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| data { | ||
| } | ||
| model { | ||
| target += von_mises_notasuffix(1|0,1); | ||
adamhaber marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| $ ../../../../../install/default/bin/stanc non_existing_distribution_suffix1.stan | ||
| Semantic error in 'non_existing_distribution_suffix1.stan', line 4, column 14 to column 34: | ||
| ------------------------------------------------- | ||
| 2: } | ||
| 3: model { | ||
| 4: target += von_mises_cdf(1|0,1); | ||
| ^ | ||
| 5: } | ||
| ------------------------------------------------- | ||
|
|
||
| A function was expected but an unknown identifier von_mises_cdf was recieved. This appears to be part of the von_mises family of distributions, for which the cdf suffix in not implemented. | ||
| $ ../../../../../install/default/bin/stanc non_existing_distribution_suffix2.stan | ||
| Semantic error in 'non_existing_distribution_suffix2.stan', line 4, column 14 to column 35: | ||
| ------------------------------------------------- | ||
| 2: } | ||
| 3: model { | ||
| 4: target += von_mises_lcdf(1|0,1); | ||
| ^ | ||
| 5: } | ||
| ------------------------------------------------- | ||
|
|
||
| A function was expected but an unknown identifier von_mises_lcdf was recieved. This appears to be part of the von_mises family of distributions, for which the lcdf suffix in not implemented. | ||
| $ ../../../../../install/default/bin/stanc non_existing_distribution_suffix3.stan | ||
| Semantic error in 'non_existing_distribution_suffix3.stan', line 4, column 14 to column 36: | ||
| ------------------------------------------------- | ||
| 2: } | ||
| 3: model { | ||
| 4: target += von_mises_lccdf(1|0,1); | ||
| ^ | ||
| 5: } | ||
| ------------------------------------------------- | ||
|
|
||
| A function was expected but an unknown identifier von_mises_lccdf was recieved. This appears to be part of the von_mises family of distributions, for which the lccdf suffix in not implemented. | ||
| $ ../../../../../install/default/bin/stanc non_existing_distribution_suffix4.stan | ||
| Semantic error in 'non_existing_distribution_suffix4.stan', line 4, column 14 to column 41: | ||
| ------------------------------------------------- | ||
| 2: } | ||
| 3: model { | ||
| 4: target += von_mises_notasuffix(1|0,1); | ||
| ^ | ||
| 5: } | ||
| ------------------------------------------------- | ||
|
|
||
| Only functions with names ending in _lpdf, _lupdf, _lpmf, _lupmf, _cdf, _lcdf, _lccdf can make use of conditional notation. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.