-
-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make preview module more robust catch import errors so an existing arviz-xyz broken installation doesn't affect regular arviz * add info element and logging * docs and linters * use markdown file for docs
- Loading branch information
1 parent
9dbd43e
commit adb2fef
Showing
4 changed files
with
51 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,48 @@ | ||
# pylint: disable=unused-import,unused-wildcard-import,wildcard-import | ||
# pylint: disable=unused-import,unused-wildcard-import,wildcard-import,invalid-name | ||
"""Expose features from arviz-xyz refactored packages inside ``arviz.preview`` namespace.""" | ||
import logging | ||
|
||
_log = logging.getLogger(__name__) | ||
|
||
info = "" | ||
|
||
try: | ||
from arviz_base import * | ||
|
||
status = "arviz_base available, exposing its functions as part of arviz.preview" | ||
_log.info(status) | ||
except ModuleNotFoundError: | ||
pass | ||
status = "arviz_base not installed" | ||
_log.info(status) | ||
except ImportError: | ||
status = "Unable to import arviz_base" | ||
_log.info(status, exc_info=True) | ||
|
||
info += status + "\n" | ||
|
||
try: | ||
import arviz_stats | ||
from arviz_stats import * | ||
|
||
status = "arviz_stats available, exposing its functions as part of arviz.preview" | ||
_log.info(status) | ||
except ModuleNotFoundError: | ||
pass | ||
status = "arviz_stats not installed" | ||
_log.info(status) | ||
except ImportError: | ||
status = "Unable to import arviz_stats" | ||
_log.info(status, exc_info=True) | ||
info += status + "\n" | ||
|
||
try: | ||
from arviz_plots import * | ||
|
||
status = "arviz_plots available, exposing its functions as part of arviz.preview" | ||
_log.info(status) | ||
except ModuleNotFoundError: | ||
pass | ||
status = "arviz_plots not installed" | ||
_log.info(status) | ||
except ImportError: | ||
status = "Unable to import arviz_plots" | ||
_log.info(status, exc_info=True) | ||
|
||
info += status + "\n" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ API Reference | |
plot_utils | ||
utils | ||
rcparams | ||
preview | ||
wrappers | ||
stats_refitting |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(preview_api)= | ||
|
||
# Preview | ||
This module give access to upcoming refactored features by exposing | ||
all objects in [arviz-base](https://arviz-base.readthedocs.io/en/latest/), | ||
[arviz-stats](https://arviz-stats.readthedocs.io/en/latest/) and | ||
[arviz-plots](https://arviz-plots.readthedocs.io/en/latest/) | ||
under a single namespace: `arviz.preview`. | ||
|
||
In addition, there is also an `arviz.preview.info` to check availability | ||
of the different sub-libraries. |
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