Skip to content

Commit 6caabff

Browse files
committed
restructure contributing docs
1 parent dfa05bd commit 6caabff

17 files changed

+293
-75
lines changed

docs/source/about/citing_pymc.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
(citing_pymc)=
22
# Citing PyMC
33

4+
TODO: extend advise, copy info from readme, explain citing paper plus specific zenodo version...
5+
46
If you use PyMC in your reseach please cite: Salvatier J., Wiecki T.V., Fonnesbeck C. (2016) Probabilistic programming in Python using PyMC. PeerJ Computer Science 2:e55 [DOI: 10.7717/peerj-cs.55](https://doi.org/10.7717/peerj-cs.55).
57

68
The BibTeX entry is:
79

8-
.. code-block:: none
9-
10-
@article{pymc,
11-
title={Probabilistic programming in Python using PyMC3},
12-
author={Salvatier, John and Wiecki, Thomas V and Fonnesbeck, Christopher},
13-
journal={PeerJ Computer Science},
14-
volume={2},
15-
pages={e55},
16-
year={2016},
17-
publisher={PeerJ Inc.}
18-
}
10+
```bibtex
11+
@article{pymc,
12+
title={Probabilistic programming in Python using PyMC3},
13+
author={Salvatier, John and Wiecki, Thomas V and Fonnesbeck, Christopher},
14+
journal={PeerJ Computer Science},
15+
volume={2},
16+
pages={e55},
17+
year={2016},
18+
publisher={PeerJ Inc.}
19+
}
20+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
:::{card}
2+
:class-body: small
3+
:link: https://www.spacex.com/
4+
5+
**SpaceX**
6+
^^^
7+
> At SpaceX PyMC helped us estimate supplier delivery uncertainty and quantify which suppliers were consistent in sending us rocket parts and which suppliers we needed to partner with to understand how we could reduce variability
8+
9+
_Ravin Kumar_
10+
:::
11+
12+
:::{card}
13+
:class-body: small
14+
:link: https://www.salesforce.com
15+
16+
**Salesforce**
17+
^^^
18+
> PyMC is my primary tool for statistical modeling at Salesforce. I use it to combine disparate sources of information and pretty much anywhere that quantifying uncertainty is important. We've also been experimenting with gaussian processes to model time series data for forecasting.
19+
20+
_Eddie Landesberg. Manager, Data Scientist_
21+
:::
22+
23+
:::{card}
24+
:class-body: small
25+
**[Novartis Institutes for Biomedical Research](https://www.novartis.com/our-science/novartis-institutes-biomedical-research)**
26+
^^^
27+
> At the Novartis Institutes for Biomedical Research, we use PyMC for a wide variety of scientific and business use cases. The API is incredible, making it easy to express probabilistic models of our scientific experimental data and business processes, such as models of electrophysiology and molecular dose response.
28+
29+
_Eric J. Ma_
30+
:::
31+
32+
:::{card}
33+
:class-body: small
34+
**[Intercom](https://www.intercom.com)**
35+
^^^
36+
> At Intercom, we've adopted PyMC as part of our A/B testing framework. The API made it easy to integrate into our existing experimentation framework and the methodology has made communication of experiment results much more straightforward for non technical stakeholders.
37+
38+
_Louis Ryan_
39+
:::
40+
41+
:::{card}
42+
:class-body: small
43+
**[Channel 4](http://www.channel4.co.uk)**
44+
^^^
45+
> Used in research code at Channel 4 for developing internal forecasting tools.
46+
47+
_Peader Coyle_
48+
:::

docs/source/about/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ PyMC strives to make Bayesian modeling as simple and painless as possible, allo
3434
citing_pymc
3535
history_and_versions
3636
pymc_for_enterprise
37+
testimonials
3738
:::

docs/source/about/testimonials.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(testimonials)=
2+
# Testimonials
3+
4+
TODO: move testimonials from wiki to here

docs/source/community.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Discourse is the best place to interact with the PyMC community and its team
1111

1212
## Conferences
1313

14-
[PyMCon](https://pymc-devs.github.io/pymcon/) was a conference organized by the PyMC developer community in 2020.
14+
The PyMC community organizes [PyMCon](https://pymc-devs.github.io/pymcon/), whose last edition was in 2020.
15+
Follow Discourse or Twitter to be updated about the next edition!
1516

1617
PyMC talks have been given at a number of conferences, including [PyCon](https://us.pycon.org/),
1718
[PyData](https://pydata.org/events/), and [ODSC](https://odsc.com/) events.

docs/source/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,16 @@
110110

111111
# List of patterns, relative to source directory, that match files and
112112
# directories to ignore when looking for source files.
113-
exclude_patterns = ["_build", "**.ipynb_checkpoints", "pymc-examples/.github"]
113+
exclude_patterns = [
114+
"_build",
115+
"**.ipynb_checkpoints",
116+
"pymc-examples/.github",
117+
"about/featured_testimonials.md",
118+
]
114119

115120
# myst and panels config
116121
jupyter_execute_notebooks = "off"
117-
myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath"]
122+
myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath", "substitution"]
118123
panels_add_bootstrap_css = False
119124

120125
# The reST default role (used for this markup: `text`) to use for all
@@ -227,7 +232,7 @@
227232
# Add any paths that contain custom static files (such as style sheets) here,
228233
# relative to this directory. They are copied after the builtin static files,
229234
# so a file named "default.css" will overwrite the builtin "default.css".
230-
html_static_path = ["_static", "nb_tutorials/_images", "nb_examples/_images"]
235+
# html_static_path = ["_static", "nb_tutorials/_images", "nb_examples/_images"]
231236

232237
# Add any extra paths that contain custom files (such as robots.txt or
233238
# .htaccess) here, relative to this directory. These files are copied
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Build documentation locally
2+
3+
To build the docs, run these commands at pymc repository root:
4+
5+
TODO: fix makefile
6+
7+
```bash
8+
$ pip install -r requirements-dev.txt # Make sure the dev requirements are installed
9+
$ cd docs/source
10+
$ make html # Build docs
11+
$ python -m http.server --directory ../_build/html # Render docs
12+
```
13+
14+
Check the printed url where docs are being served and open it.

docs/source/contributing/developer_guide_implementing_distribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Implementing a Distribution (developer guide)
1+
# Implementing a Distribution
22

33
This guide provides an overview on how to implement a distribution for version 4 of PyMC.
44
It is designed for developers who wish to add a new distribution to the library.

docs/source/contributing/index.md

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,57 @@
11
# Contributing
22

3-
PyMC is an open source, collective effort. There are many ways in which you can help make it better.
4-
5-
## Help develop PyMC
3+
PyMC is an open source, collective effort.
4+
There are many ways in which you can help make it better.
5+
And all of them are welcome!
6+
7+
## Contribute as an individual
8+
PyMC is a joint effort of many people, each contributing to the areas they like
9+
and have some expertise in, coordinating to try and cover all tasks.
10+
11+
Coding and documentation are the most common types of contributions, but
12+
there are many more things that you can do to help PyMC which are just as
13+
important. Moreover, both code and docs require submitting PRs via GitHub
14+
to some of the repositories under the [pymc-devs](https://github.com/pymc-devs) organization, and
15+
while we have a {ref}`pr_tutorial` guide available, GitHub might not be
16+
everyone's cup of tea. If that is your case, don't worry, you will be
17+
more than welcome if you want to help.
18+
19+
:::{tip}
20+
Contact us on [Discourse](https://discourse.pymc.io/) if you want to contribute to the project but are not sure where you can contribute or how to start
21+
:::
622

7-
Learn about developing PyMC in our Developer's section.
23+
Below there are some examples of non code nor doc contributions that could serve as an inspiration.
24+
If you have other ideas let us know on [Discourse](https://discourse.pymc.io/) to see if we can make it happen too.
825

9-
Report a bug or make a suggestion for improvement by [opening an issue in Github](https://github.com/pymc-devs/pymc/issues/new/choose)
26+
* Report a bug or make a suggestion for improvement by [opening an issue in Github](https://github.com/pymc-devs/pymc/issues/new/choose)
27+
* Answer questions on [Discourse](https://discourse.pymc.io/)
28+
* Teach about PyMC and advertise best practices by writing blogs or giving talks
29+
* Help plan PyMCon
30+
* Help with outreach and marketing. This could include for example reaching out to potential sponsor
31+
companies, to people who could use PyMC in their work or making sure that academics who use PyMC
32+
cite it correctly in their work
33+
* Help with our fundraising efforts
1034

35+
### Code related contributions
1136
Join the discussion or submit a solution for an open issue. [See open issues](https://github.com/pymc-devs/pymc/issues)
1237

13-
## Help improve the documentation
38+
39+
### Documentation related contributions
1440

1541
See all open issues in documentation [here](https://github.com/pymc-devs/pymc/issues?q=is%3Aissue+is%3Aopen+label%3A%22docs%22+)
1642

1743
New to the open source space? Find a good beginner friendly documentation issue you can help with [here](https://github.com/pymc-devs/pymc/issues?q=is%3Aissue+is%3Aopen+label%3A%22beginner+friendly%22+label%3A%22docs%22) or [here](https://github.com/pymc-devs/pymc-examples/issues?q=is%3Aopen+label%3Adocs+label%3A%22good+first+issue%22).
1844

19-
You will need to express your interest in the issue by commenting on it using your Github account, and you will need to use some beginner level Git to complete the Pull Request process, but don't worry! There are plenty of good [Github tutorials](https://guides.github.com/activities/hello-world/) out there, and PyMC reviewers are happy to help.
45+
You will need to express your interest in the issue by commenting on it using your GitHub account, and you will need to use some beginner level Git to complete the Pull Request process, but don't worry! There are plenty of good [Github tutorials](https://guides.github.com/activities/hello-world/) out there, and PyMC reviewers are happy to help.
2046

2147

2248
## Contribute as an institution
2349

24-
Institutions can contribute in two main ways:
50+
Institutions can contribute in the following ways:
2551

2652
- By becoming [Institutional Partners](https://github.com/pymc-devs/pymc/blob/main/GOVERNANCE.md#institutional-partners-and-funding)
2753
- By becoming [Sponsors](https://github.com/pymc-devs/pymc/blob/main/GOVERNANCE.md#sponsors)
54+
- By subscribing to {ref}`Tidelift <pymc_for_enterprise>`
2855

2956
Contact PyMC at [email protected] for more information.
3057

@@ -34,18 +61,37 @@ TODO: Add https://github.com/pymc-devs/pymc/blob/main/CONTRIBUTING.md
3461
:::{toctree}
3562
:hidden:
3663
:maxdepth: 1
37-
:caption: Style guides
64+
:caption: Tutorials
65+
66+
pr_tutorial
67+
:::
68+
69+
:::{toctree}
70+
:hidden:
71+
:maxdepth: 1
72+
:caption: How-to guides
73+
74+
developer_guide_implementing_distribution
75+
build_docs
76+
running_the_test_suite
77+
:::
78+
79+
:::{toctree}
80+
:hidden:
81+
:maxdepth: 1
82+
:caption: Reference content
3883

3984
python_style
4085
jupyter_style
86+
pr_checklist
87+
release_checklist
4188
:::
4289

4390

4491
:::{toctree}
4592
:hidden:
4693
:maxdepth: 1
47-
:caption: Developer content
94+
:caption: In depth explanations
4895

4996
developer_guide
50-
developer_guide_implementing_distribution
5197
:::

docs/source/contributing/jupyter_style.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# PyMC Jupyter Style Guide
1+
(jupyter_style)=
2+
# Jupyter Style Guide
23

34
These guidelines should be followed by all notebooks in the documentation, independently of
45
the repository where the notebook is in (pymc or pymc-examples).
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
(pr_checklist)=
2+
# Pull request checklist
3+
4+
We strongly recommended that all contribution comply with the following guidelines before being merged:
5+
6+
* If your pull request addresses an issue, please use the pull request title to describe the issue and mention the issue number in the pull request description. This will make sure a link back to the original issue is created.
7+
8+
:::{caution}
9+
Adding the related issue in the PR title generates no link and is therefore
10+
not useful as nobody knows issue numbers. Please mention all related
11+
issues in the PR but do so only in the PR description.
12+
:::
13+
14+
* All public methods must have informative docstrings with sample usage when appropriate.
15+
16+
* Please prefix the title of incomplete contributions with `[WIP]` (to indicate a work in progress). WIPs may be useful to (1) indicate you are working on something to avoid duplicated work, (2) request broad review of functionality or API, or (3) seek collaborators.
17+
18+
* All other tests pass when everything is rebuilt from scratch. See {ref}`running_the_test_suite`
19+
20+
* When adding additional functionality, consider adding also one example notebook at [pymc-examples](https://github.com/pymc-devs/pymc-examples). Open a [proposal issue](https://github.com/pymc-devs/pymc-examples/issues/new/choose) in the example repo to discuss the specific scope of the notebook.
21+
22+
* Documentation and high-coverage tests are necessary for enhancements to be accepted.
23+
24+
* Run any of the pre-existing examples in [pymc-examples](https://github.com/pymc-devs/pymc-examples) that contain analyses that would be affected by your changes to ensure that nothing breaks. This is a useful opportunity to not only check your work for bugs that might not be revealed by unit test, but also to show how your contribution improves PyMC for end users.
25+
26+
You can also check for common programming errors with the following
27+
tools:
28+
29+
* Code with good test **coverage** (at least 80%), check with:
30+
31+
```bash
32+
$ pip install pytest pytest-cov coverage
33+
$ pytest --cov=pymc pymc/tests/<name of test>.py
34+
```
35+
36+
* No `pre-commit` errors: see the {ref}`python_style` and {ref}`jupyter_style` page on how to install and run it.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Pull request step-by-step
2+
The preferred workflow for contributing to PyMC is to fork the [GitHub repository](https://github.com/pymc-devs/pymc/), clone it to your local machine, and develop on a feature branch.
3+
4+
## Steps
5+
6+
1. Fork the [project repository](https://github.com/pymc-devs/pymc/) by clicking on the 'Fork' button near the top right of the main repository page. This creates a copy of the code under your GitHub user account.
7+
8+
2. Clone your fork of the PyMC repo from your GitHub account to your local disk, and add the base repository as a remote:
9+
10+
```bash
11+
$ git clone [email protected]:<your GitHub handle>/pymc.git
12+
$ cd pymc
13+
$ git remote add upstream [email protected]:pymc-devs/pymc.git
14+
```
15+
16+
3. Create a ``feature`` branch to hold your development changes:
17+
18+
```bash
19+
$ git checkout -b my-feature
20+
```
21+
22+
23+
:::{attention}
24+
Always use a ``feature`` branch. It's good practice to never routinely work on the ``main`` branch of any repository.
25+
:::
26+
27+
4. Project requirements are in ``requirements.txt``, and libraries used for development are in ``requirements-dev.txt``. The easiest (and recommended) way to set up a development environment is via [miniconda](https://docs.conda.io/en/latest/miniconda.html):
28+
29+
```bash
30+
$ conda env create -f conda-envs/environment-dev-py37.yml # or py38 or py39
31+
$ conda activate pymc-dev-py37
32+
$ pip install -e .
33+
```
34+
35+
_Alternatively_ you may (probably in a [virtual environment](https://docs.python-guide.org/dev/virtualenvs/)) run:
36+
37+
```bash
38+
$ pip install -e .
39+
$ pip install -r requirements-dev.txt
40+
```
41+
42+
Yet another alternative is to create a docker environment for development. See: [Developing in Docker](#Developing-in-Docker).
43+
44+
5. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:
45+
46+
```bash
47+
$ git add modified_files
48+
$ git commit
49+
```
50+
51+
to record your changes locally.
52+
After committing, it is a good idea to sync with the base repository in case there have been any changes:
53+
```bash
54+
$ git fetch upstream
55+
$ git rebase upstream/main
56+
```
57+
58+
Then push the changes to your GitHub account with:
59+
60+
```bash
61+
$ git push -u origin my-feature
62+
```
63+
64+
6. Go to the GitHub web page of your fork of the PyMC repo. Click the 'Pull request' button to send your changes to the project's maintainers for review. This will send an email to the committers.
65+
66+
:::{tip}
67+
Now that your PR is ready, read the {ref}`pr_checklist` to make sure it follows best practices.
68+
:::

docs/source/contributing/python_style.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(python_style)=
12
# Python style guide
23

34
## Pre commit checks

0 commit comments

Comments
 (0)