-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from MunchLab/Updating-contributing-documentation
Lots of cleanup, linting, documentation, especially contributing section
- Loading branch information
Showing
69 changed files
with
2,591 additions
and
14,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Citing | ||
======= | ||
|
||
To cite `ect` please use the following publication: | ||
|
||
Elizabeth Munch. An Invitation to the Euler Characteristic Transform. `arXiv:2310.10395 <https://arxiv.org/abs/2310.10395>`_. 2023. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
Contributing to the `ect` Package | ||
================================= | ||
|
||
*Note this is a draft document and is subject to change.* | ||
|
||
Getting Started | ||
--------------- | ||
|
||
- Prerequisites | ||
- Setting up the development environment | ||
- Forking the `ect` repository | ||
- Cloning the repository | ||
|
||
Contributing Guidelines | ||
----------------------- | ||
|
||
Code style and formatting | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
It is essential for this project to have well documented, clean, and readable code. The following guidelines should be followed when contributing to the `ect` package: | ||
|
||
- Use the PEP 8 style guide for Python code. | ||
- Follow docstring format given below for documenting functions and classes. | ||
- Use the Sphinx documentation system for generating documentation. | ||
- Always include tests for new features and bug fixes. | ||
|
||
|
||
Documentation guidelines | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The `ect` package uses the Sphinx documentation system for generating documentation. There are two things to be doing when contributing to the documentation: | ||
|
||
- First, include docstrings in the code which will be autogenerated into the documentation. When in doubt, write too much. | ||
- Second, write documentation in the `doc_source` directory using the reStructuredText format. This package also supports writing files in markdown, although there are some issues when dealing with autogenerated content so it's a bit of a mix at the moment. Note that when the documentation is generated, everything in the `docs` folder is deleted and overwritten, so do not do your work in there, it will be lost! | ||
|
||
Assuming everything (TODO: Add install list) is set up correctly, you can generate the documentation by running the following command from the top level folder:: | ||
make html | ||
|
||
This will generate the documentation in the ``docs`` directory. You can view the documentation by opening the ``docs/index.html`` file in your browser. | ||
|
||
An example of a docstring for a function is given below. Note the use of indentation since rst is picky about it:: | ||
|
||
def my_function(arg1, arg2): | ||
""" | ||
This is a brief description of the function. | ||
|
||
This is a more detailed description of the function. It should include | ||
information about the arguments and the return value. If the function | ||
raises any exceptions, they should be documented here as well. Math can be included in text by using the math directive, e.g. :math:`y = x^2`. A displayed equation can be added as well using the math block directive. Note that for certain letters that are reserved by rst, you need to escape them with a backslash, e.g. `\\f` in the code below. | ||
.. math:: | ||
|
||
\int_0^1 x^2 dx = \\frac{1}{3} | ||
Code blocks can also be included using the code-block directive: | ||
.. code-block:: python | ||
def my_function(arg1, arg2): | ||
return arg1 + arg2 | ||
Just ending a sentence with two colons also will create a code block:: | ||
def my_function(arg1, arg2): | ||
return arg1 + arg2 | ||
|
||
Parameters | ||
---------- | ||
arg1 (type): | ||
Description of arg1. | ||
arg2 (type): | ||
Description of arg2. | ||
|
||
Returns | ||
------- | ||
type | ||
Description of the return value. | ||
|
||
Raises | ||
------ | ||
ExceptionType | ||
Description of when this exception is raised. | ||
""" | ||
|
||
|
||
|
||
Testing guidelines | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
You should always include tests for new features and bug fixes. The `ect` package uses the `pytest` testing framework. The tests are located in the `tests` directory. To run the tests, you can use the following command:: | ||
|
||
pytest | ||
|
||
or the standard `unittest` python framework by running:: | ||
|
||
make tests | ||
|
||
Get in the habit of writing lots of simple tests. It is better to have too many tests than too few. The tests should be written in a way that they can be run quickly and easily. This will make it easier for you to test your code as you develop it and for others to test your code when they review it. Take a look at the existing tests for examples. | ||
|
||
Note that in order for a function written in the test folder to be run, the function must be prefixed with `test_`. For example, a test function for a function called `my_function` would be called `test_my_function`. | ||
|
||
Issue tracking and pull requests | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
If you find an issue, please post it on the `GitHub issue tracker <https://github.com/MunchLab/ect/issues>`. Provide as much information as possible, including the version of the `ect` package you are using, the operating system you are using, and any other relevant information. | ||
|
||
If you would like to fix an issue and you are a contributor to the project, please create a new branch for the fix. Note that the ``main`` branch is protected so you will not be able to push directly to that branch. Once you are ready to open discussion, you will create a pull request. The pull request should include a description of the issue and the fix. There is a template for pull requests that you can use to fill out helpful information. | ||
|
||
- Note that in order for the `pip install` command to work, the version number in the `pyproject.toml` file must be updated. | ||
- You should also make sure to update the version number to match in the ``doc_source/conf.py`` file. This will ensure that the documentation is updated with the correct version number. | ||
- Be sure to run ``make all`` before committing to ensure that the code is cleaned, the documentation is up to date, and the tests all pass. | ||
|
||
If you are not a contributor, you will need to fork the code and create a pull request from your fork. | ||
Note that all pull requests need to be approved by Liz Munch before they can be merged. | ||
|
||
Conclusion | ||
---------- | ||
|
||
- Acknowledgements | ||
- Future development plans | ||
- Contact information and support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Installation | ||
============ | ||
|
||
Prerequisites | ||
------------- | ||
|
||
Before installing `ect`, make sure you have the following prerequisites: | ||
|
||
- Python (version 3.7 or higher) | ||
- Pip (Python package installer) | ||
|
||
Installing `ect` | ||
---------------- | ||
|
||
To install `ect`, run the following in a terminal. | ||
|
||
.. code-block:: bash | ||
pip install ect | ||
Alternatively, you can install directly from the source by cloning the repository and running the following command: | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/MunchLab/ect | ||
cd ect | ||
pip install . | ||
Uninstalling `ect` | ||
------------------ | ||
|
||
To uninstall `ect`, simply run the following command: | ||
|
||
.. code-block:: bash | ||
pip uninstall ect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: e5078083e1e4dc0826581f131d0ee9a3 | ||
config: 323577bb763e1ae020bcf349ad4827a5 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Oops, something went wrong.