|
| 1 | +# Guidelines for Contributing |
| 2 | +As part of the PyMC3 library documentation, the guidelines to contribute to |
| 3 | +pymc-examples are based on [PyMC3 contributing guidelines](https://github.com/pymc-devs/pymc3/blob/master/CONTRIBUTING.md). Please refer there |
| 4 | +for a detailed description of the Fork-PR contributing workflow, see "Steps" section, |
| 5 | +and note that you'll need to update the repository URLs and branch names. |
| 6 | + |
| 7 | +This document therefore covers only some specific guidelines specific to this repository, mainly, |
| 8 | +an adapted version of the "Pull Request Checklist" and some extra guidelines for |
| 9 | +efficient collaboration with Jupyter notebooks. |
| 10 | + |
| 11 | +## Before submitting a pull request |
| 12 | +The notebooks in pymc-examples are in the process of being updated and reexecuted. |
| 13 | +The main progress tracker is [this GitHub project](https://github.com/pymc-devs/pymc-examples/projects/1). |
| 14 | + |
| 15 | +### About the notebook tracker project |
| 16 | +This project serves as both tracker and organizer of the work needed on each of the example notebooks in this repo. |
| 17 | +Each notebook will have its own issue where we can point out things to fix and discuss them. |
| 18 | +These issue tickets are placed on one of the columns in this project based on the state of the notebook: |
| 19 | + |
| 20 | +* **To Do:** notebooks in this column are outdated, don't use ArviZ or InferenceData (or do so only partially), use deprecated pymc3 arguments or show other practices that should be updated and improved. |
| 21 | +* **General updates:** notebooks in this column have pymc3 code up to date with v3, but don't use ArviZ (or do so only partially) |
| 22 | +* **ArviZ:** notebooks in this column use ArviZ but still have bad examples of pymc3 usage. |
| 23 | +* **Best practices:** notebooks in this column use ArviZ and pymc3 best practices. This column alone does not represent any extra updates, it is only the place for notebooks fulfilling the requirements to be in both "general updates" and "ArviZ". |
| 24 | +* **v4:** notebooks in this column use ArviZ and have been updated and executed with pymc3 v4. |
| 25 | + |
| 26 | +Therefore, all notebooks will be progressively updated along this path: |
| 27 | + |
| 28 | +``` |
| 29 | + / --> General updates -- \ |
| 30 | +To Do --< >--> Best Practices (--> v4) |
| 31 | + \ --> ArviZ -- / |
| 32 | +``` |
| 33 | + |
| 34 | +Each pull request should update a single notebook 1-2 positions to the right. |
| 35 | +Before starting a work on a pull request look at the tracker issue of the |
| 36 | +notebook you are planning to edit to make sure it is not being updated by someone |
| 37 | +else. |
| 38 | + |
| 39 | +**Note on labels**: The labels on an issue will apply to the most immediate 1 position update. |
| 40 | +One issue can be labeled "good first issue" for updating from "To Do" to "General updates", but |
| 41 | +that does not mean that updating from "To Do"->"ArviZ" or |
| 42 | +"General Updates"->"Best Practices" won't be challenging. |
| 43 | +The same could be true the other way around. |
| 44 | +In case of doubt, don't hesitate to ask and read over the notebook to |
| 45 | +see what changes are expected. |
| 46 | + |
| 47 | +If there are no comments and nobody is working on this notebook, |
| 48 | +comment on the ticket to make it evident to others, we will assign |
| 49 | +the issue to you as soon as possible. |
| 50 | +If the comment if more than two weeks old and there are no signs of |
| 51 | +activity, leave a comment for a maintainer to assign the issue to you. |
| 52 | + |
| 53 | +We encourage you to submit a pull request as soon as possible after commenting |
| 54 | +and being assigned the issue and |
| 55 | +add `[WIP]` in the title to indicate Work in Progress. |
| 56 | + |
| 57 | +### About PR timeline |
| 58 | +You are free and encouraged to work at your own pace as long as you keep |
| 59 | +track of your progress in the issues and PRs. There is no deadline nor |
| 60 | +maximum time an active PR can be open. |
| 61 | + |
| 62 | +There is a maximum time of 2 weeks for inactive PRs, |
| 63 | +if there is no activity for two weeks, |
| 64 | +we will close the PR and the issue will be unassigned. |
| 65 | +We will try to ping you a few days before that happens, |
| 66 | +but not being receiving such ping does not mean you won't get unassigned. |
| 67 | + |
| 68 | +If you know you won't be able to work during two weeks but plan to |
| 69 | +continue your work afterwards, let us know by commenting when you'll be able |
| 70 | +to retake the work. |
| 71 | +Alternatively, you can also contact your reviewers on [Discourse](https://discourse.pymc.io/) |
| 72 | + |
| 73 | +As for review timeline, while you may get some reviews in a few hours or even some minutes |
| 74 | +if we happen to be working on related things, _you should not expect that to be the norm_. |
| 75 | +You should expect to receive review(s) for your PRs in 1-2 days. If two and a half days |
| 76 | +after submitting you still have not received any comment, let us know (i.e. tag whoever |
| 77 | +opened the issue you are addressing in a new PR comment. If at any point we were |
| 78 | +overwhelmed by PRs and delay this timeline, we will comment on your PR with an estimate |
| 79 | +of when you can expect a proper review. |
| 80 | + |
| 81 | +### In the event of a conflict |
| 82 | +In the event of two or more people working on the same issue, |
| 83 | +the general precedence will go to the person who first commented in the issue. |
| 84 | +If no comments it will go to the first person to submit a PR for review. |
| 85 | +Each situation will differ though, and the core contributors will make the best judgement call if needed. |
| 86 | + |
| 87 | +### If the issue ticket has someone assigned to it |
| 88 | +If the issue is assigned then precedence goes to the assignee. |
| 89 | +However if there has been no activity for 2 weeks from assignment date, |
| 90 | +the ticket is open for all again and will be unassigned. |
| 91 | + |
| 92 | +## Pull request checklist |
| 93 | + |
| 94 | +We recommended that your contribution complies with the following guidelines before you submit a pull request: |
| 95 | + |
| 96 | +* 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. For example, use `Use ArviZ in sampler stats notebook` as a title and link to [#46](https://github.com/pymc-devs/pymc-examples/issues/46) in the description. |
| 97 | + * Please do not submit PRs that are not addressing an issue already present in the issue tracker. |
| 98 | + |
| 99 | +* 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. |
| 100 | + |
| 101 | +* Make sure to run the whole notebook sequentially on a fresh kernel. You can do that with the |
| 102 | + "Restart & Run All" option before saving. |
| 103 | + |
| 104 | +* No `pre-commit` errors: see the [Jupyter Notebook style](https://github.com/pymc-devs/pymc3/wiki/PyMC3-Jupyter-Notebook-Style-Guide) (and [Python code style](https://github.com/pymc-devs/pymc3/wiki/PyMC3-Python-Code-Style)) page from our Wiki on how to install and run it. |
| 105 | + |
| 106 | +* Indicate how are you aiming to update the notebook (i.e. what is the target end column in the tracker). The pull request template has a template for this. |
0 commit comments