Skip to content

Commit 24aa3c5

Browse files
zbarryericmjl
andcommitted
[DOC] various doc changes incl contributing (pyjanitor-devs#353)
* various doc changes * Update LICENSE Co-Authored-By: Eric Ma <[email protected]>
1 parent 77a0de8 commit 24aa3c5

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

CONTRIBUTING.rst

+27-23
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ documentation fix before contributing a code fix. Doing so has manyfold benefits
2828
5. You can choose between getting set up locally first (recommended), or instead directly making edits on the GitHub web UI (also not a problem).
2929
6. Every newcomer is equal in our eyes, and it's the most egalitarian way to get started, regardless of experience.
3030

31-
Remote contributors outside of sprints, and prior contributors who are joining
31+
Remote contributors outside of sprints, and prior contributors who are joining
3232
us at the sprints need not adhere to this rule, as a good prior
3333
assumption is that you are a motivated user of the library already. If you have
3434
made a prior PR to the library, we would like to encourage you to mentor newcomers
35-
in lieu of coding contributions.
35+
in lieu of coding contributions.
3636

3737
Documentation can come in many forms. For example, you might want to contribute:
3838

39-
- fixes for a typographical, grammatical, or spelling error.
40-
- changes for a docstring that was unclear.
41-
- clarifications for installation/setup instructions that are unclear.
42-
- rephrasing of a sentence/phrase/word choice that didn't make sense.
43-
- new example/tutorial notebooks using the library.
44-
- reworking of existing tutorial notebooks with better code style.
39+
- Fixes for a typographical, grammatical, or spelling error.
40+
- Changes for a docstring that was unclear.
41+
- Clarifications for installation/setup instructions that are unclear.
42+
- Rephrasing of a sentence/phrase/word choice that didn't make sense.
43+
- New example/tutorial notebooks using the library.
44+
- Reworking of existing tutorial notebooks with better code style.
4545

46-
In particular, contributing new tutorial notebooks, and improving the clarity of existing ones,
47-
is a great way to get familiar with the library and find pain points that you can
46+
In particular, contributing new tutorial notebooks and improving the clarity of existing ones
47+
are a great ways to get familiar with the library and find pain points that you can
4848
propose as fixes or enhancements to the library.
4949

5050
Report Bugs
@@ -62,38 +62,40 @@ Fix Bugs
6262
~~~~~~~~
6363

6464
Look through the GitHub issues for bugs. Anything tagged with ``bug``
65-
and ``available to hack on`` is open to whoever wants to implement it.
65+
and ``available to hack on`` is open to whoever wants to implement it.
6666

6767
Do be sure to claim the issue for yourself by indicating, "I would like to
6868
work on this issue." If you would like to discuss it further before going forward,
69-
we are more than welcome to discuss on the GitHub issue tracker.
69+
you are more than welcome to discuss on the GitHub issue tracker.
7070

7171
Implement Features
7272
~~~~~~~~~~~~~~~~~~
7373

7474
Look through the GitHub issues for features. Anything tagged with ``enhancement``
75-
and ``available to hack on`` is open to whoever wants to implement it.
75+
and ``available to hack on`` are open to whoever wants to implement it.
7676

7777
Implementing a feature generally means writing a function that has the
7878
following form:
7979

8080
.. code-block:: python
8181
8282
@pf.register_dataframe_method
83-
def function(df, *args, **kwargs):
84-
"""Very detailed docstring here."""
83+
def function(df: pd.DataFrame, *args, **kwargs) -> pd.DataFrame:
84+
"""
85+
Very detailed docstring here. Look to other functions for examples.
86+
"""
8587
# stuff done here
8688
return df
8789
8890
The function signature should take a pandas dataframe as the input, and return
89-
a pandas dataframe as the output. Any manipulation to the dataframe should be
90-
implemented inside the function.
91+
a pandas ``DataFrame`` as the output. Any manipulation to the dataframe should be
92+
implemented inside the function. The standard functionality of ``pyjanitor`` methods that we're moving towards is to not modify the input ``DataFrame``.
9193

9294
This function should be implemented in ``functions.py``, and should have a test
9395
accompanying it in ``tests/functions/test_<function_name_here>.py``.
9496

9597
When writing a test, the minimum acceptable test is an "example-based test".
96-
Under ``tests/conf.py``, you will find a suite of example dataframes that can be
98+
Under ``tests/conf.py``, you will find a suite of example dataframes that can be
9799
imported and used in the test.
98100

99101
If you are more experienced with testing, you can use Hypothesis to
@@ -143,31 +145,33 @@ Ready to contribute? Here's how to set up `pyjanitor` for local development.
143145

144146
4. Create a branch for local development:
145147

146-
New features added to pyjanitor should be done in a new branch you have based off of the latest version of the `dev` branch. The protocol for pyjanitor branches for new development is that the `master` branch mirrors the current version of pyjanitor on PyPI, whereas `dev` branch is for additional features for an eventual new official version of the package which might be deemed slightly less stable. Once more confident in the reliability / suitability for introducing a batch of changes into the official version, the `dev` branch is then merged into `master` and the PyPI package is subsequently updated.
148+
New features added to ``pyjanitor`` should be done in a new branch you have based off of the latest version of the `dev` branch. The protocol for ``pyjanitor`` branches for new development is that the ``master`` branch mirrors the current version of ``pyjanitor`` on PyPI, whereas ``dev`` branch is for additional features for an eventual new official version of the package which might be deemed slightly less stable. Once more confident in the reliability / suitability for introducing a batch of changes into the official version, the ``dev`` branch is then merged into ``master`` and the PyPI package is subsequently updated.
147149

148-
To base a branch directly off of `dev` instead of `master`, create a new one as follows:
150+
To base a branch directly off of ``dev`` instead of ``master``, create a new one as follows:
149151

150152
$ git checkout -b name-of-your-bugfix-or-feature dev
151153

152154
Now you can make your changes locally.
153155

154156
5. When you're done making changes, check that your changes are properly formatted and that all tests still pass::
155157

156-
$ make lint
157158
$ make format
159+
$ make lint
158160
$ py.test
159161

162+
``format`` will apply code style formatting, ``lint`` checks for styling problems (which must be resolved before the PR can be accepted), and ``py.test`` runs all of ``pyjanitor``'s unit tests to probe for whether changes to the source code have potentially introduced bugs. These tests must also pass before the PR is accepted.
163+
160164
All of these commands are available when you create the development environment.
161165

162-
When you run the test locally, the tests in ``chemistry.py`` are automatically skipped if you don't have the optional dependencies (e.g. ``rdkit``) installed.
166+
When you run the test locally, the tests in ``chemistry.py`` & ``biology.py`` are automatically skipped if you don't have the optional dependencies (e.g. ``rdkit``) installed.
163167

164168
6. Commit your changes and push your branch to GitHub::
165169

166170
$ git add .
167171
$ git commit -m "Your detailed description of your changes."
168172
$ git push origin name-of-your-bugfix-or-feature
169173

170-
7. Submit a pull request through the GitHub website where when you are picking out which branch to merge into, you select `dev` instead of `master`.
174+
7. Submit a pull request through the GitHub website where when you are picking out which branch to merge into, you select ``dev`` instead of ``master``.
171175

172176

173177
PyCharm Users

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Eric Ma
3+
Copyright (c) 2018-onwards pyjanitor devs
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ statements, can be replaced with method chains that allow one to read off the
4646
logical order of actions taken. Let us see the annotated example below. First,
4747
off, here's the textual description of a data cleaning pathway:
4848

49-
1. Create a dataframe.
49+
1. Create a ``DataFrame``.
5050
2. Delete one column.
5151
3. Drop rows with empty values in two particular columns.
5252
4. Rename another two columns.
@@ -211,6 +211,8 @@ The final way is to use the `pipe()` method:
211211
Contributing
212212
------------
213213

214+
See ``CONTRIBUTING.rst`` for a full description of the process of contributing to ``pyjanitor``.
215+
214216
Adding new functionality
215217
~~~~~~~~~~~~~~~~~~~~~~~~
216218

0 commit comments

Comments
 (0)