Skip to content

Commit

Permalink
Merge pull request #98 from ColCarroll/update_docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
ColCarroll committed May 25, 2018
2 parents 1ce045d + f359bbc commit d6a0325
Show file tree
Hide file tree
Showing 33 changed files with 678 additions and 109 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install:

- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy mkl scipy pandas matplotlib pytest pylint sphinx numpydoc ipython
- source activate test-environment
- pip install -r requirements.txt
- pip install .
- pip install -r requirements-dev.txt
- pip install coveralls

Expand All @@ -33,7 +33,7 @@ before_script:
script:
- pylint arviz/
- pytest -xv arviz/tests/ --cov=arviz/
- travis-sphinx build -n
- travis-sphinx build --nowarn --source=doc

after_success:
- travis-sphinx deploy
Expand Down
28 changes: 14 additions & 14 deletions arviz/stats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,20 @@ def gradient(weights):

if np.any(weights):
min_ic_i_val = ics[ic_i].iloc[0]
for i in ics.index:
res = ics.loc[i]
for idx, val in enumerate(ics.index):
res = ics.loc[val]
diff = res[ic_i] - min_ic_i_val
d_ic = np.sum(diff)
d_std_err = np.sqrt(len(diff) * np.var(diff))
std_err = ses.loc[i]
weight = weights[i]
df_comp.at[i] = (round(res[ic], round_to),
round(res[p_ic], round_to),
round(d_ic, round_to),
round(weight, round_to),
round(std_err, round_to),
round(d_std_err, round_to),
res['warning'])
std_err = ses.loc[val]
weight = weights[idx]
df_comp.at[val] = (round(res[ic], round_to),
round(res[p_ic], round_to),
round(d_ic, round_to),
round(weight, round_to),
round(std_err, round_to),
round(d_std_err, round_to),
res['warning'])

return df_comp.sort_values(by=ic)

Expand All @@ -220,13 +220,13 @@ def _ic_matrix(ics, ic_i):
rows = len(ics[ic_i].iloc[0])
ic_i_val = np.zeros((rows, cols))

for i in ics.index:
ic = ics.loc[i][ic_i]
for idx, val in enumerate(ics.index):
ic = ics.loc[val][ic_i]
if len(ic) != rows:
raise ValueError('The number of observations should be the same '
'across all models')
else:
ic_i_val[:, i] = ic
ic_i_val[:, idx] = ic

return rows, cols, ic_i_val

Expand Down
4 changes: 4 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_build
example_thumbs/
examples/
generated/
File renamed without changes.
11 changes: 11 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dt:target {
background-color: #E0FFFF;
}

a {
color: #12698A;
}

.navbar-brand img {
height: 150%;
}
File renamed without changes.
Binary file added doc/_static/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
57 changes: 57 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. _api:

.. currentmodule:: arviz

API Reference
=============

.. _plot_api:

Plots
-----

.. autosummary::
:toctree: generated/

autocorrplot
compareplot
densityplot
energyplot
forestplot
kdeplot
parallelplot
posteriorplot
traceplot
pairplot
jointplot
khatplot
ppcplot

.. _stats_api:

Stats
-----

.. autosummary::
:toctree: generated/

bfmi
compare
hpd
loo
r2_score
summary
waic
psislw

.. _diagnostics_api:

Diagnostics
-----------

.. autosummary::
:toctree: generated/

effective_n
gelman_rubin
geweke
49 changes: 29 additions & 20 deletions doc/source/conf.py → doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
import sphinx_bootstrap_theme


# -- General configuration ------------------------------------------------
Expand All @@ -31,19 +31,27 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
sys.path.insert(0, os.path.abspath('sphinxext'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive',
'numpydoc',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting']
'IPython.sphinxext.ipython_console_highlighting',
'gallery_generator',
]

# Generate API documentation when building
autosummary_generate = True
numpydoc_show_class_members = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -95,36 +103,37 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = 'bootstrap'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {'logo_only': True}
html_theme_options = {
'source_link_position': 'footer',
'navbar_title': ' ',
'globaltoc_depth': 0,
'bootswatch_theme': 'paper',
'navbar_pagenav': False,
'navbar_sidebarrel': False,
'navbar_links': [
('Gallery', 'examples/index'),
('Quickstart', 'notebooks/Introduction'),
('API', 'api'),
],
}



# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
html_static_path = ['_static', 'example_thumbs']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}

#html_sidebars = {}

# -- Options for HTMLHelp output ------------------------------------------

Expand Down
Binary file added doc/data/centered_eight_trace.gzip
Binary file not shown.
Binary file added doc/data/non_centered_eight_trace.gzip
Binary file not shown.
File renamed without changes.
76 changes: 76 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
ArviZ: Exploratory analysis of Bayesian models
==============================================
|Build Status|

.. raw:: html


<div style="clear: both"></div>
<div class="container-fluid">
<div class="row">
<div class="col-md-6">


ArviZ includes functions for posterior analysis, sample diagnostics, model checking, and comparison.

It is currently in heavy development. The goal is to provide backend-agnostic tools
for Bayesian inference in Python. Currently `PyMC3
<http://docs.pymc.io/>`_ is best supported,
though many functions will work if the samples are stored in a pandas dataframe, and active work is being
done to support `PyStan
<https://pystan.readthedocs.io/en/latest/>`_ as well.

Contributions and issue reports are very welcome at `the github repository
<https://github.com/arviz-devs/arviz>`_.


.. toctree::
:maxdepth: 1

installation
Example Gallery<examples>
Quickstart<notebooks/Introduction>
api
about


.. raw:: html

</div>
<div class="col-md-6">
<div class="container-fluid hidden-xs hidden-sm">
<a href="examples/energyplot.html">
<div class="col-md-3 thumbnail">
<img src="_static/energyplot_thumb.png">
</div>
</a>
<a href="examples/traceplot.html">
<div class="col-md-3 thumbnail">
<img src="_static/traceplot_thumb.png">
</div>
</a>
<a href="examples/densityplot.html">
<div class="col-md-3 thumbnail">
<img src="_static/densityplot_thumb.png">
</div>
</a>
<a href="examples/compareplot.html">
<div class="col-md-3 thumbnail">
<img src="_static/compareplot_thumb.png">
</div>
</a>
<a href="examples/autocorrplot.html">
<div class="col-md-3 thumbnail">
<img src="_static/autocorrplot_thumb.png">
</div>
</a>
</div>
</div>

</div>
</div>
</div>


.. |Build Status| image:: https://travis-ci.org/arviz-devs/arviz.png?branch=master
:target: https://travis-ci.org/arviz-devs/arviz
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Empty file removed doc/source/_static/.gitignore
Empty file.
7 changes: 0 additions & 7 deletions doc/source/_static/custom.css

This file was deleted.

Binary file removed doc/source/_static/logo.png
Binary file not shown.
12 changes: 0 additions & 12 deletions doc/source/api.rst

This file was deleted.

9 changes: 0 additions & 9 deletions doc/source/api/plots.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/api/stats.rst

This file was deleted.

9 changes: 0 additions & 9 deletions doc/source/api/utils.rst

This file was deleted.

25 changes: 0 additions & 25 deletions doc/source/index.rst

This file was deleted.

0 comments on commit d6a0325

Please sign in to comment.