Developer Guide

Library architecture

ArviZ is organized in modules (the folders in arviz directory). The main 3 modules are data, plots and stats. Then we have 3 more folders. The tests folder contains tests for all these 3 modules.

The static folder is only used to store style and CSS files to get HTML output for InferenceData. Finally we have the wrappers folder that contains experimental (not tested yet either) features and interacts closely with both data and stats modules.

In addition, there are some files on the higher level directory: utils.py, sel_utils.py, rcparams.py and labels.py.

Plots

ArviZ supports multiple backends. While adding another backend, please ensure you meet the following design patterns.

Code Separation

Each backend should be placed in a different module per the backend. See arviz.plots.backends for examples.

The code in the root level of arviz.plots should not contain any opinion on backend. The idea is that the root level plotting function performs math and constructs keywords, and the backends code in arviz.plots.backends perform the backend specific keyword argument defaulting and plot behavior.

The convenience function get_plotting_function available in arviz.plots.get_plotting_function should be called to obtain the correct plotting function from the associated backend. If adding a new backend follow the pattern provided to programmatically call the correct backend.

Test Separation

Tests for each backend should be split into their own module See tests.test_plots_matplotlib for an example.

Documentation

Docstring style

See the corresponding section in the contributing guide.