You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very detailed docstring here. Look to other functions for examples.
86
+
"""
85
87
# stuff done here
86
88
return df
87
89
88
90
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``.
91
93
92
94
This function should be implemented in ``functions.py``, and should have a test
93
95
accompanying it in ``tests/functions/test_<function_name_here>.py``.
94
96
95
97
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
97
99
imported and used in the test.
98
100
99
101
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.
143
145
144
146
4. Create a branch for local development:
145
147
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.
147
149
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:
149
151
150
152
$ git checkout -b name-of-your-bugfix-or-feature dev
151
153
152
154
Now you can make your changes locally.
153
155
154
156
5. When you're done making changes, check that your changes are properly formatted and that all tests still pass::
155
157
156
-
$ make lint
157
158
$ make format
159
+
$ make lint
158
160
$ py.test
159
161
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
+
160
164
All of these commands are available when you create the development environment.
161
165
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.
163
167
164
168
6. Commit your changes and push your branch to GitHub::
165
169
166
170
$ git add .
167
171
$ git commit -m "Your detailed description of your changes."
168
172
$ git push origin name-of-your-bugfix-or-feature
169
173
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``.
0 commit comments