forked from arviz-devs/arviz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify compare() docstring, error-check, pass var_name. (arviz-devs#1616
) * Modify compare() docstring, and var_name param and error-check. Check to see if the log_likelihood groups have more than one data variable, and if so, require the var_name parameter. This avoids having a less understandable error message crop up later. Introduce `var_name` parameter, and pass it through to the IC function invoked by compare. * Fix error in argument test. * More explicit error message. Previously, if we got a TypeError when trying to find a log_likelihood in from_pymc3() that TypeError would be squashed completely. Now we will echo it to the log before handling it. * Fix type signature of compare(). Took @OriolAbril correction. * Annotated IC function errors from compare(). Catch errors from IC functions invoked inside compare and annotate them with information about the source `InferenceData` object. * Remove incorrect docstring. * pylint * mypy fixes. * Make "e" acceptable variable name. Many examples show this as a good variable name for exceptions, particularly in "except <ExceptionClass> as e:" * Changelog update. * Backward-compatibility fix. * Fix test. Error now caught sooner. * Fix mypy issues. * Python 3.5 and 3.6 compatibility. * Whitespace issue caught by Oriol. * Test for error-trapping. Make sure we check for multiple observed variables in compare() and that support for "var_name" works. * Don't let sample_stats shadow log_likelihood. Previously, we checked for `sample_stats` in `get_log_likelihood()` *before* reading `log_likelihood`. Add a check that `log_likelihood` must be missing before we check `sample_stats`. * Improvements suggested by OriolAbril. * Limit recomputation in tests by scoping a fixture. * Test for expected IC in `compare` test. * Refine type assertion.
- Loading branch information
1 parent
066e48d
commit 2b4d141
Showing
7 changed files
with
128 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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