Skip to content

Commit

Permalink
Merge branch 'ppcplot' of https://github.com/imperorrp/arviz-plots in…
Browse files Browse the repository at this point in the history
…to ppcplot
  • Loading branch information
imperorrp committed Jun 24, 2024
2 parents 9d13403 + f717d45 commit c561543
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ name: Publish library

on:
push:
branches:
- main
tags:
# Don't try to be smart about PEP 440 compliance,
# see https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
- v*

jobs:
publish:
environment:
name: publish
url: https://pypi.org/p/arviz-plots
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -25,6 +28,3 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ disable=missing-docstring,
not-an-iterable,
no-member,
import-error,
possibly-used-before-assignment,
fixme


Expand Down
9 changes: 9 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
html[data-theme="light"] {
--pst-color-primary: rgb(11 117 145);
--pst-color-secondary: rgb(238 144 64);
}

html[data-theme="dark"] {
--pst-color-primary: rgb(0 192 191);
--pst-color-secondary: rgb(238 144 64);
}
Binary file added docs/source/_static/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/source/_templates/name.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="sd-d-flex-row sd-align-major-spaced sd-align-minor-center">
<a href="https://arviz-base.readthedocs.io"><div class="sd-fs-6 sd-font-weight-lighter sd-text-muted">BASE</div></a>
<a href="https://arviz-stats.readthedocs.io"><div class="sd-fs-6 sd-font-weight-lighter sd-text-muted">STATS</div></a>
<a href="{{ pathto(root_doc) }}"><div class="sd-fs-3 sd-font-weight-bold sd-text-primary">PLOTS</div></a>
</div>
11 changes: 11 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,15 @@
"image_dark": "_static/ArviZ_white.png",
}
}
html_favicon = "_static/favicon.ico"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_sidebars = {
"**": [
"navbar-logo.html",
"name.html",
"icon-links.html",
"search-button-field.html",
"sbt-sidebar-nav.html",
]
}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dynamic = ["version", "description"]
dependencies = [
"arviz-base",
"arviz-stats @ git+https://github.com/arviz-devs/arviz-stats",
"arviz-base==0.2",
"arviz-stats[xarray]==0.2",
]

[tool.flit.module]
Expand Down
2 changes: 1 addition & 1 deletion src/arviz_plots/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Base ArviZ version."""
__version__ = "0.1.0"
__version__ = "0.2.0"
4 changes: 2 additions & 2 deletions src/arviz_plots/plots/distplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def plot_dist(
How to represent the marginal density.
Defaults to ``rcParams["plot.density_kind"]``
point_estimate : {"mean", "median", "mode"}, optional
Which point estimate to plot. Defaults to ``rcParams["plot.point_estimate"]``
Which point estimate to plot. Defaults to rcParam :data:`stats.point_estimate`
ci_kind : {"eti", "hdi"}, optional
Which credible interval to use. Defaults to ``rcParams["stats.ci_kind"]``
ci_prob : float, optional
Expand Down Expand Up @@ -180,7 +180,7 @@ def plot_dist(
if ci_kind is None:
ci_kind = rcParams["stats.ci_kind"] if "stats.ci_kind" in rcParams else "eti"
if point_estimate is None:
point_estimate = rcParams["plot.point_estimate"]
point_estimate = rcParams["stats.point_estimate"]
if kind is None:
kind = rcParams["plot.density_kind"]
if plot_kwargs is None:
Expand Down
10 changes: 5 additions & 5 deletions src/arviz_plots/plots/forestplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def plot_forest(
Whether to plot intervals for each chain or not. Ignored when the "chain" dimension
is not present.
point_estimate : {"mean", "median", "mode"}, optional
Which point estimate to plot. Defaults to ``rcParams["plot.point_estimate"]``
Which point estimate to plot. Defaults to rcParam :data:`stats.point_estimate`
ci_kind : {"eti", "hdi"}, optional
Which credible interval to use. Defaults to ``rcParams["stats.ci_kind"]``
ci_probs : (float, float), optional
Expand Down Expand Up @@ -187,14 +187,14 @@ def plot_forest(
:context: close-figs
>>> from arviz_plots import visuals
>>> from arviz_stats.base import ess
>>> import arviz_stats # make accessor available
>>>
>>> c_aux = centered["posterior"].expand_dims(
>>> column=3
>>> ).assign_coords(column=["labels", "forest", "ess"])
>>> pc = plot_forest(c_aux, combined=True)
>>> pc.map(
>>> visuals.scatter_x, "ess", data=ess(centered),
>>> visuals.scatter_x, "ess", data=centered.azstats.ess().ds,
>>> coords={"column": "ess"}, color="C0"
>>> )
Expand All @@ -217,7 +217,7 @@ def plot_forest(
if ci_kind is None:
ci_kind = rcParams["stats.ci_kind"] if "stats.ci_kind" in rcParams else "eti"
if point_estimate is None:
point_estimate = rcParams["plot.point_estimate"]
point_estimate = rcParams["stats.point_estimate"]
if plot_kwargs is None:
plot_kwargs = {}
if pc_kwargs is None:
Expand Down Expand Up @@ -328,7 +328,7 @@ def plot_forest(
np.linspace(-0.2, 0.2, distribution.sizes["model"]),
coords={"model": distribution.model},
)
chain_lim = 0.4 * (model_spacing[1] - model_spacing[0])
chain_lim = 0.4 * (model_spacing[1] - model_spacing[0]).item()
chain_spacing = xr.DataArray(
np.linspace(-chain_lim, chain_lim, distribution.sizes["chain"]),
coords={"chain": distribution.chain},
Expand Down

0 comments on commit c561543

Please sign in to comment.