Skip to content

Commit 6470f96

Browse files
Update Contribution types, Reference, and In depth explanations in Contributing guide (#2521)
* Update pages under Contribution types section * Change version from 1.0.0 to 1.0 * Use 'package' instead of 'subpackage' when refering to arviz-* packages. * Typo * Unify TODO * Remove architecture.md and developing_in_docker.md * Simplify pull request checklist * Update pages in 'Reference' * Update in-depth explanations * Fix references and add h5py to doc environment * Restore miniatures to branch base * Update docs/source/contributing/contributing_prs.md Co-authored-by: Oriol Abril-Pla <[email protected]> * Update docs/source/contributing/docstrings.md Co-authored-by: Oriol Abril-Pla <[email protected]> * Update docs/source/contributing/contributing_prs.md Co-authored-by: Oriol Abril-Pla <[email protected]> * Update docs/source/contributing/diataxis_for_arviz.md Co-authored-by: Oriol Abril-Pla <[email protected]> * Incorporate feedback * run tox check --------- Co-authored-by: Oriol Abril-Pla <[email protected]>
1 parent a948237 commit 6470f96

18 files changed

+176
-256
lines changed

docs/source/contributing/architecture.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/source/contributing/content_structure.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
(content_structure)=
22
# Documentation content structure
33

4+
:::{caution} Some content in this page may be outdated.
5+
:::
6+
47
ArviZ documentation has the {doc}`diataxis:index` as a North Star.
58
This page assumes basic familiarity with Diátaxis.
69

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Contributing code via pull requests
22

33
While issue reporting is valuable, we strongly encourage users who are
4-
inclined to do so to submit patches for new or existing issues via pull
5-
requests. This is particularly the case for simple fixes, such as typos
6-
or tweaks to documentation, which do not require a heavy investment
7-
of time and attention.
4+
inclined to do so to submit patches for new or existing issues via pull requests.
5+
This is particularly the case for simple fixes, such as typos or tweaks to documentation,
6+
which do not require a heavy investment of time and attention.
87

98
Contributors are also encouraged to contribute new code to enhance ArviZ's
109
functionality, also via pull requests.
@@ -13,10 +12,21 @@ to ensure that any new contribution does not strongly overlap with existing
1312
functionality and open a "Feature Request" issue before starting to work
1413
on the new feature.
1514

16-
(steps_before_working)=
15+
:::{note}
16+
Since version 1.0, ArviZ is organized as a metapackage that brings together functionality
17+
from three packages: [`arviz-base`](https://github.com/arviz-devs/arviz-base),
18+
[`arviz-stats`](https://github.com/arviz-devs/arviz-stats), and
19+
[`arviz-plots`](https://github.com/arviz-devs/arviz-plots).
20+
21+
As a result, contributing to ArviZ typically means contributing to one of these packages rather
22+
than to the main ArviZ repository itself.
23+
When browsing issues or pull requests, keep in mind that most activity happens in the
24+
corresponding package repositories.
25+
:::
1726

27+
(steps_before_working)=
1828
## Steps before starting work
19-
Before starting work on a pull request double-check that no one else
29+
Before starting work on a pull request, double-check that no one else
2030
is working on the ticket in both issue tickets and pull requests.
2131

2232
ArviZ is a community-driven project and always has multiple people working
@@ -25,50 +35,67 @@ that we all make the most of our time and we don't have two contributors
2535
working on the same changes. Let's see what to do when you encounter the following scenarios:
2636

2737
### If an issue ticket exists
28-
If an issue exists check the ticket to ensure no one else has started working on it. If you are first to start work, comment on the ticket to make it evident to others. If the comment looks old or abandoned leave a comment asking if you may start work.
38+
If an issue exists, check the ticket to ensure no one else has started working on it.
39+
If you are first to start work, comment on the ticket to make it evident to others.
40+
If the comment looks old or abandoned, leave a comment asking if you may start work.
2941

3042
### If an issue ticket doesn't exist
31-
Open an issue ticket for the issue and state that you'll be solving the issue with a pull request. Optionally create a pull request and add `[WIP]` in the title to indicate Work in Progress.
43+
Open an issue ticket for the issue and state that you'll be solving the issue with a pull request.
44+
Optionally create a pull request and add `[WIP]` in the title to indicate Work in Progress.
3245

3346
### In the event of a conflict
34-
In the event of two or more people working on the same issue, the general precedence will go to the person who first commented on the issue. If no comments it will go to the first person to submit a PR for review. Each situation will differ though, and the core contributors will make the best judgment call if needed.
47+
In the event of two or more people working on the same issue,
48+
the general precedence will go to the person who first commented on the issue.
49+
If there are no comments, it will go to the first person to submit a PR for review.
50+
Each situation will differ though, and the core contributors will make the best judgment call if needed.
3551

3652
### If the issue ticket has someone assigned to it
37-
If the issue is assigned then precedence goes to the assignee. However, if there has been no activity for 2 weeks from the assignment date, the ticket is open for all again and can be unassigned.
53+
If the issue is assigned, then precedence goes to the assignee.
54+
However, if there has been no activity for 2 weeks from the assignment date,
55+
the ticket is open for all again and can be unassigned.
3856

3957
(dev_summary)=
40-
## Development process - summary
58+
## Development process
4159

42-
## Code Formatting
43-
For code generally follow the
44-
[TensorFlow's style guide](https://www.tensorflow.org/community/contribute/code_style)
45-
or the [Google style guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md).
46-
Both more or less follow PEP 8.
60+
TODO: Details and sections to be added...
4761

48-
Final formatting is done with [black](https://github.com/ambv/black).
4962

5063
(docstring_formatting)=
51-
# Docstring formatting and type hints
64+
## Docstring formatting
5265

53-
Docstrings should follow the
54-
[numpy docstring guide](https://numpydoc.readthedocs.io/en/latest/format.html).
66+
Docstrings should follow the [numpy docstring guide](https://numpydoc.readthedocs.io/).
5567
Extra guidance can also be found in
5668
[pandas docstring guide](https://pandas.pydata.org/pandas-docs/stable/development/contributing_docstring.html).
57-
Please reasonably document any additions or changes to the codebase,
58-
when in doubt, add a docstring.
69+
Please reasonably document any additions or changes to the codebase; when in doubt, add a docstring.
70+
71+
While ArviZ does not include type hints in function and method definitions,
72+
it uses [Docstub](https://docstub.readthedocs.io) to generate `.pyi` files
73+
from numpydoc-style docstrings.
74+
For this reason, clear and complete docstrings are important,
75+
as they are used to generate type information for third-party tools such as type checkers and IDEs.
5976

60-
The different formatting and aim between numpydoc style type description and
61-
[type hints](https://docs.python.org/3/library/typing.html)
62-
should be noted. numpydoc style targets docstrings and aims to be human
63-
readable whereas type hints target function definitions and `.pyi` files and
64-
aim to help third party tools such as type checkers or IDEs. ArviZ does not
65-
require functions to include type hints
66-
however contributions including them are welcome.
6777

6878
## Documentation for user facing methods
69-
If changes are made to a method documented in the {ref}`ArviZ API Guide <api>`
70-
please consider adding inline documentation examples.
71-
You can refer to {func}`az.plot_posterior <arviz.plot_posterior>` for a good example.
7279

73-
### Tests
74-
Section in construction
80+
If changes are made to a method documented in {ref}`ArviZ-base API <arviz_base:api_reference>`,
81+
{ref}`ArviZ-stats API <arviz_stats:api_reference>`, or {ref}`ArviZ-plots API <arviz_plots:api_reference>`;
82+
please consider adding inline examples, See Also links,
83+
References when relevant (e.g., if it implements a published method),
84+
and Notes with implementation details that might be relevant to users.
85+
You can refer to {func}`~arviz_plots.plot_dist` and {func}`~arviz_plots.plot_forest` for good examples.
86+
87+
## Tests
88+
89+
:::{caution} Section in construction
90+
:::
91+
92+
Tests are run through dedicated tox tasks, however, due to differences in architecture,
93+
combinations of optional dependencies we might want to test and scope differences between libraries,
94+
each library defines their own testing tasks.
95+
96+
Moreover, we also have package specific test organization and some extra pytest customization available in some cases.
97+
Consequently, each library has its own contributing page on how to run the test suite or contribute to it:
98+
99+
* ArviZ-base: coming soon
100+
* {ref}`ArviZ-stats <arviz_stats:contributing_testing>`
101+
* {ref}`ArviZ-plots <arviz_plots:contributing_testing>`

docs/source/contributing/developing_in_docker.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

docs/source/contributing/diataxis_for_arviz.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ which can nor should follow the Diátaxis framework.
3333
ArviZ is a library with a strong visualization component.
3434
This translates for example into some duplicity when it comes to reference content.
3535

36-
Both the {ref}`example_gallery` and the {ref}`api` pages are reference content.
36+
Both the {ref}`arviz_plots:example_gallery` and the {ref}`arviz_plots:api_reference` pages are reference content.
3737
The API reference indexes by name and contains the description of each object,
3838
whereas the Example Gallery indexes by image and to avoid excessive duplication,
3939
links to the respective API page.

docs/source/contributing/doc_toolchain.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
(doc_toolchain)=
22
# Documentation toolchain
33

4+
:::{caution} Some content in this page may be outdated.
5+
:::
6+
47
ArviZ documentation is built using a Python documentation tool, [Sphinx](https://www.sphinx-doc.org/en/master/).
58
Sphinx converts `rst`(restructured text) files into HTML websites.
69
There are different extensions available for converting other types of files
7-
like markdown, jupyter notebooks, etc. into HTML websites.
10+
like markdown, Jupyter notebooks, etc. into HTML websites.
811

912
ArviZ [docs](https://github.com/arviz-devs/arviz/tree/main/doc/source) consist of `.rst`, `.md` and `.ipynb` files.
1013
It uses `myst-parser` and `myst-nb` for `.md` and `.ipynb` files.

docs/source/contributing/docstrings.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# Docstring style
33

44
Docstrings should follow the
5-
[numpy docstring guide](https://numpydoc.readthedocs.io/en/latest/format.html). Read more about it {ref}`docstring_formatting`.
6-
In ArviZ docs, docstrings consit of five main sections, i.e.,
5+
[numpy docstring guide](https://numpydoc.readthedocs.io/en/latest/format.html).
6+
7+
In ArviZ docs, docstrings consist of five main sections, i.e.,
78
1. Short summary
89
2. Parameters
910
3. Returns
@@ -17,19 +18,25 @@ Docstrings follow the same guide for adding references as the other docs.
1718
For adding references to external libraries functions and objects, see {ref}`reference_external_libs`. For referencing ArviZ objects, follow {ref}`reference_arviz_objects`.
1819

1920
## See Also
20-
In ArviZ docs, we have a lot of interconnected functions both within the library and with external libraries and it can take a lot of time to search for the related functions. It is crucial to add the See Also section to save users time.
21-
For adding the _See Also_ docstring section, you just need to add the function name. Sphinx will
22-
automatically add links to other ArviZ objects and functions listed in the _See Also_
21+
In ArviZ docs, we have a lot of interconnected functions both within the library and with external
22+
libraries and it can take a lot of time to search for the related functions.
23+
It is crucial to add the See Also section to save users time.
24+
For adding the _See Also_ docstring section, you just need to add the function name.
25+
Sphinx will automatically add links to other ArviZ objects and functions listed in the _See Also_
2326
section.
2427

25-
For example, let's add {func}`~arviz.hdi` and {func}`~arviz.plot_ppc` in the _See Also_ section.
28+
For example, let's add {func}`~arviz_stats.hdi` and {func}`~arviz_plots.plot_ppc_dist` in the _See Also_ section.
2629

2730
```
2831
See Also
2932
--------
30-
hdi : Calculate highest density interval (HDI) of array for given probability.
31-
plot_ppc : plot for posterior/prior predictive checks.
33+
arviz_stats.hdi : Calculate highest density interval (HDI) of array for given probability.
34+
arviz_plots.plot_ppc_dist : plot for posterior/prior predictive checks.
3235
```
3336

3437
## Kwargs parameters
35-
All the kwargs parameters in {ref}`plots <plot_api>` modules are passed to the matplotlib or bokeh functions. While writing their description, the functions to which they are being passed must be mentioned. In order to check or add those functions, the process is the same for all the kwargs arguments. Let's read the step-by-step guide for `backend_kwargs` as an example, [here](https://github.com/arviz-devs/arviz/wiki/ArviZ-Hacktoberfest-2021).
38+
39+
All the kwargs parameters in the {doc}`arviz_plots:api/index` modules are passed to the
40+
Matplotlib or Bbokeh functions. While writing their description, the functions to which they are
41+
being passed must be mentioned. In order to check or add those functions, the process is the same
42+
for all the kwargs arguments.

docs/source/contributing/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,9 @@ how_to_add_to_example_gallery
160160
:caption: Reference
161161

162162
pr_checklist
163-
architecture
164163
content_structure
165164
docstrings
166165
syntax_guide
167-
developing_in_docker
168166
:::
169167

170168
:::{toctree}
@@ -173,5 +171,4 @@ developing_in_docker
173171

174172
doc_toolchain
175173
diataxis_for_arviz
176-
plotting_backends
177174
:::

docs/source/contributing/issue_reports.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
# Issue reports
33

44
We appreciate being notified of problems with the existing ArviZ code.
5-
We prefer that issues be filed on the
6-
[Github Issue Tracker](https://github.com/arviz-devs/arviz/issues),
7-
rather than on social media or by direct email to the developers.
5+
We prefer that issues be shared on a Github Issue Tracker rather than on social media or by direct email to the developers.
6+
If you are unsure if your issue corresponds to a specific package of the ArviZverse,
7+
you can open an issue in the [main ArviZ repository issue tracker](https://github.com/arviz-devs/arviz/issues).
8+
On the other hand, if you are certain the issue corresponds to a specific pacakge, use the relevant issue tracker: of the corresponding package repository:
9+
10+
* [ArviZ-base](https://github.com/arviz-devs/arviz-base/issues)
11+
* [ArviZ-stats](https://github.com/arviz-devs/arviz-stats/issues)
12+
* [ArviZ-plots](https://github.com/arviz-devs/arviz-stats/issues)
13+
814

915
Please verify that your issue is not being currently addressed by other
1016
issues or pull requests by using the GitHub search tool to look for keywords

0 commit comments

Comments
 (0)