-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Contributing guidelines improvements #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LGTM. Thanks for writing this up. |
@thunderfish24 @adriesse any objections or suggestions for these proposed changes to |
Sorry, where/what is |
The latest "official" version of the rendered documentation is here: http://pvlib-python.readthedocs.io/en/latest/contributing.html And the proposal in this pull request is rendered here: https://wholmgren-pvlib-python-new.readthedocs.io/en/contributing/contributing.html |
docs/sphinx/source/contributing.rst
Outdated
@@ -15,9 +19,13 @@ Here are a few ideas for you can contribute, even if you are new to | |||
pvlib-python, git, or Python: | |||
|
|||
* Make `GitHub issues <https://github.com/pvlib/pvlib-python/issues>`_ | |||
and contribute to the conversation about how to resolve them. | |||
and contribute to the conversations about how to resolve them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the broader sense, answering questions on stackoverflow and/or discussing on the google group would be contributions as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, absolutely!
docs/sphinx/source/contributing.rst
Outdated
The best way to ensure that a pull request will be reviewed and merged in | ||
a timely manner is to: | ||
|
||
#. Start with an issue. The issue should be well-defined and actionable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start by creating an issue.
Seems fine to me. |
I should be able to take a real look over lunch today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the guidelines.
A general comment: Is there a place for using gist's instead of PR's for contributors that want to get a preliminary discussion about architecture and implementation options/choices/changes?
There is a lot of material in this section, aimed at a variety of | ||
contributors from novice to expert. Don't worry if you don't (yet) | ||
understand parts of it. | ||
|
||
|
||
Easy ways to contribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the word "how" is missing on line 18: " Here are a few ideas for you can contribute, ..."
functions, PVSystem/Location, and ModelChain. We recommend that | ||
contributors focus their work on only one or two of those layers in a | ||
single pull request. New models are *not* required to be available to | ||
the higher-level API! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to see a ton of value in adding models that aren't accessible to (perhaps many?) users through the higher-level API. Perhaps touch on this point here: What is the value and/or subsequent steps to make a new model "fully" accessible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with what Will wrote here. At the last workshop we heard from a broad sample of users that pvlib (either MATLAB or python) serves two primary roles: as a reference library of algorithms (our original intent), and as a platform for research or custom modeling to supplement commercial applications. ModelChain
is valuable, although not essential, to these use cases. So it's OK, from my point of view, to add model functions and expose them at the PVSystem/Location
level but not the ModelChain
level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Cliff said it well. I'd add that I'm not sure that ModelChain
is going to exist in anything like its current form in 3-5 years, but I am sure that most of the core functions will remain fairly similar to what they are now.
docs/sphinx/source/contributing.rst
Outdated
expanding the scope of your pull request. We'd rather see small | ||
additions to the project's technical debt than see a pull request | ||
languish because its scope expanded beyond what the reviewer community | ||
is capable of processing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes it's hard for reviewers to be immediately available, so the "right" amount of patience is to be expected. That said, interested reviewers should do their best to not wait until the last minute to put in their two cents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. I added your suggestion to a new section: "Pull request reviews".
docs/sphinx/source/contributing.rst
Outdated
Questions about related issues frequently come up in the process of | ||
addressing implementing code for a pull request. Please try to avoid | ||
expanding the scope of your pull request. We'd rather see small | ||
additions to the project's technical debt than see a pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to say "well-documented additions".
docs/sphinx/source/contributing.rst
Outdated
<https://www.python.org/dev/peps/pep-0008/>`_. Maximum line length for code | ||
is 79 characters. | ||
|
||
Documentation must be written in `numpydoc format <https://numpydoc.readthedocs.io/>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about this specific format. Thanks!
My other big issue here has been knowing that my markup is going to look and link correctly in the eventual documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some text about building documentation on readthedocs. Not sure if it's sufficient since I can't actually walk through it because my account is already set up. I could add something about building it locally but it's somewhat cumbersome.
docs/sphinx/source/contributing.rst
Outdated
Set your editor to strip extra whitespace from line endings. This helps | ||
keep the commit history clean. | ||
|
||
pvlib python does not use ``logging``. Remove any logging calls that you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider "Remove and logging calls and print
statements that you..."
|
||
|
||
Testing | ||
~~~~~~~ | ||
|
||
pvlib's unit tests can easily be run by executing ``py.test`` on the | ||
pvlib's unit tests can easily be run by executing ``pytest`` on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 196 below says "avoid using print
. Do you mean don't commit code with print statements, or is there a better way to log extra info when a test fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 206 should replace "layer" by "layer(s)", because a change could have testing ramifications in multiple layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarified and fixed.
docs/sphinx/source/contributing.rst
Outdated
readability of formulae. | ||
|
||
Set your editor to strip extra whitespace from line endings. This helps | ||
keep the commit history clean. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to mention something about what happens to the PR's commit history when it is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I added a few sentences.
@@ -220,5 +319,5 @@ This documentation | |||
|
|||
If this documentation is unclear, help us improve it! Consider looking | |||
at the `pandas | |||
documentation <http://pandas.pydata.org/pandas-docs/version/0.18.1/ | |||
documentation <http://pandas.pydata.org/pandas-docs/stable/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between "stable" and "latest"? It seems that sometimes "latest" refers to master, but other times to the latest tag, which might not actually be the highest tag. (For example, Docker has some subtleties here, if I recall correctly.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most python projects configure readthedocs such that stable is the most recently released version (git tag), whereas latest uses the current state of the master branch.
.github/PULL_REQUEST_TEMPLATE.md
Outdated
- [ ] New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary. | ||
The following items must be addressed before the code can be merged. Please don't hesitate to ask for help if you're unsure of how to accomplish any of the items below: | ||
|
||
- [ ] Closes #xxxx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove "issue"? I think that might confuse a newbie: Closes what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning behind this change is that github will automatically close an issue if a pull request is merged that has "closes #xxxx", but github will not do that for "closes issue #xxxx". But now that I think about it I agree that the change is a net negative.
Thanks @adriesse and @thunderfish24 for your reviews!
If by "place" you mean "is it ok to share code like this?" this yes, absolutely. I've done that a number of times, though it's hard for me to say how effective it's been because I usually don't get comments on them. But if you're asking about something like an "organization gist" then, no, not that I am aware of. I only know of gist.github.com which I believe is specific to your personal account and cannot be used with organizations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes.
docs/sphinx/source/contributing.rst
Outdated
the corresponding issue. | ||
ignore. Alternatives to incomplete pull requests include creating a | ||
`gist <https://gist.github.com>`_ or experimental branch and linking to | ||
it in the corresponding issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this first time, I think. +1
docs/sphinx/source/contributing.rst
Outdated
@@ -162,20 +196,39 @@ pvlib python generally follows the `PEP 8 -- Style Guide for Python Code | |||
<https://www.python.org/dev/peps/pep-0008/>`_. Maximum line length for code | |||
is 79 characters. | |||
|
|||
Documentation must be written in `numpydoc format <https://numpydoc.readthedocs.io/>`_. | |||
Code must be compatible with python 2.7 and 3.4+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but do we have a plan/statement about when we will stop 2.7 support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thunderfish24 #501
I'm going to go ahead and merge, but I will be happy to consider further improvements in new issues/PRs. |
It's become clear to me that our contributing guidelines are insufficient, out-of-date, and/or unknown. My hope is that improved, more visible guidelines will allow for a more productive, enjoyable experience for everyone. So, here are some proposed changes. They are aimed at everyone from novice to expert, first time contributor to project maintainer. I stress that these are guidelines, not hard rules.
I wrote these guidelines in response to pull requests that are valuable but languishing, pull requests that are active but represent a huge review burden, and discussions in other issues. Please review the changes knowing that my intention is only to help set more useful, concrete guidelines. I do not mean to criticize any prior work or approaches. Nor do I expect all contributions can be made to fit within these guidelines.
That being said, the contributing page with proposed changes is rendered here:
https://wholmgren-pvlib-python-new.readthedocs.io/en/contributing/contributing.html
The diff does not quite show the first couple of unchanged sentences, but I don't want them to be forgotten:
"Encouraging more people to help develop pvlib-python is essential to our success. Therefore, we want to make it easy and rewarding for you to contribute."
Note that I also reordered the checklist in the pull request template and added a new item: "I am familiar with the contributing guidelines". My hope is that even the most frequent contributors (myself included) will occasionally choose to follow the link if it's right in front of them. The new checklist is used below, though much of it does not apply for a documentation-only update.
I also added a new
.github/CONTRIBUTING.md
file that only links to the rendered documentation. It's another one of those special github files, see here. I don't know if it's ultimately useful or not, but I don't think it hurts.I am very interested in suggestions for how to improve this document.
docs/sphinx/source/api.rst
for API changes.docs/sphinx/source/whatsnew
file for all changes.git diff upstream/master -u -- "*.py" | flake8 --diff