Commit eaa3a9da authored by nd-02110114's avatar nd-02110114
Browse files

📝 update docs

parent c9af5e5b
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
# Contributing to DeepChem

We actively encourage community contributions to DeepChem. The first place to start getting involved is by running our examples locally. Afterwards, we encourage contributors to give a shot to improving our documentation. While we take effort to provide good docs, there's plenty of room for improvement. All docs are hosted on Github, either in `README.md` file, or in the `docs/` directory.
We actively encourage community contributions to DeepChem. The first place to start getting involved is [the tutorials](https://deepchem.readthedocs.io/en/latest/get_started/tutorials.html). Afterwards, we encourage contributors to give a shot to improving our documentation. While we take effort to provide good docs, there's plenty of room for improvement. All docs are hosted on Github, either in `README.md` file, or in the `docs/` directory.

Once you've got a sense of how the package works, we encourage the use of Github issues to discuss more complex changes, raise requests for new features or propose changes to the global architecture of DeepChem. Once consensus is reached on the issue, please submit a PR with proposed modifications. All contributed code to DeepChem will be reviewed by a member of the DeepChem team, so please make sure your code style and documentation style match our guidelines!


## Pull Request Process

Every contribution, must be a pull request and must have adequate time for review by other committers.

A member of the Technical Steering Committee will review the pull request. The default path of every contribution should be to merge. The discussion, review, and merge process should be designed as corrections that move the contribution into the path to merge. Once there are no more corrections, (dissent) changes should merge without further process.

On successful merge the author will be added as a member of the DeepChem organization.

## Code Style Guidelines
DeepChem uses [yapf](https://github.com/google/yapf) to autoformat code.
## Coding Conventions

``` bash
pip install yapf==0.22.0
cd <git_root>
yapf -i <python_files changed>
```
DeepChem uses these tools or styles for keeping our codes healthy.

Our integration tests will fail if code is not formatted correctly
- [YAPF](https://github.com/google/yapf) (code format)
- [Flake8](https://flake8.pycqa.org/en/latest/) (code style check)
- [mypy](http://mypy-lang.org/) (type check)
- [Numpy Doctsring](https://numpydoc.readthedocs.io/en/latest/index.html) (API documents)
- [doctest](https://docs.python.org/3/library/doctest.html) (interactive examples)

## Documentation Style Guidelines
DeepChem uses [NumPy style documentation](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt). Please follow these conventions when documenting code, since we use [Sphinx+Napoleon](http://www.sphinx-doc.org/en/stable/ext/napoleon.html) to automatically generate [docs](https://deepchem.readthedocs.io/en/latest).
Before making a PR, please check your codes using them.
You can confirm how to check your codes from [Coding Conventions](https://deepchem.readthedocs.io/en/latest/development_guide/coding.html).

## The Agreement
Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to DeepChem, and DeepChem agrees to accept said Contributions, under the terms of the open source license [The MIT License](https://opensource.org/licenses/MIT)

Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to DeepChem, and DeepChem agrees to accept said Contributions, under the terms of the open source license [The MIT License](https://opensource.org/licenses/MIT)

The Contributor understands and agrees that DeepChem shall have the irrevocable and perpetual right to make and distribute copies of any Contribution, as well as to create and distribute collective works and derivative works of any Contribution, under [The MIT License](https://opensource.org/licenses/MIT).


DeepChem understands and agrees that Contributor retains copyright in its Contributions. Nothing in this Contributor Agreement shall be interpreted to prohibit Contributor from licensing its Contributions under different terms from the [The MIT License](https://opensource.org/licenses/MIT) or this Contributor Agreement.

## DeepChem Technical Steering Committee

The Technical Steering Committee admits and oversees all top-level of DeepChem.

The TSC exercises autonomy in setting up and maintaining procedures, policies, and management and administrative structures as it deems appropriate for the maintenance and operation of these projects and resources.
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ about: Report an installation problem with DeepChem
## Environment

* OS:
* Pacakge manager (PyPI or Conda):
* Package manager (PyPI or Conda):
* Python version:
* TensorFlow version:
* DeepChem version:
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ jobs:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        os: [ubuntu-latest, windows-latest]
        python-version: [3.7]
        include:
          - os: ubuntu-latest
+22 −4
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@ Coding Conventions
Code Formatting
---------------

.. _`yapf`: https://github.com/google/yapf
.. _`YAPF`: https://github.com/google/yapf

We use `yapf`_ to format all of the code in DeepChem.  Although it sometimes
We use `YAPF`_ to format all of the code in DeepChem.  Although it sometimes
produces slightly awkward formatting, it does have two major benefits.  First,
it ensures complete consistency throughout the entire codebase.  And second, it
avoids disagreements about how a piece of code should be formatted.
@@ -18,12 +18,30 @@ checking it in.

  yapf -i <modified file>

Yapf is run on every pull request to make sure the formatting is correct, so if
YAPF is run on every pull request to make sure the formatting is correct, so if
you forget to do this the continuous integration system will remind you.
Because different versions of yapf can produce different results, it is
Because different versions of YAPF can produce different results, it is
essential to use the same version that is being run on CI.  At present, that
is 0.22.  We periodically update it to newer versions.

Linting
-------

.. _`Flake8`: https://github.com/google/yapf

We use `Flake8` to check our code syntax. Lint tools basically provide these benefits.

- Prevent things like syntax errors or typos
- Save our review time (no need to check unused codes or typos)

Actually, we could remove a tons of unused codes by introducing Flake8 to DeepChem.
Whenever you modify a file, run :code:`flake8` on it.

.. code-block:: bash

  flake8 <modified file> --count --show-source --statistics

If the command return 0, it means your code pass Flake8 check.

Docstrings
----------
+8 −8
Original line number Diff line number Diff line
# Release
# Release (WIP)

This note explains how to release deepchem packages.

## How to release

1. Create and merge a release PR (just modify the version in `deepchem/__init__.py`)
2. Push a new tag in a merge commit -> release in PyPI 
2. Push a new tag in the merge commit -> release in PyPI
3. Create and merge a release PR in the [feedstock repository](https://github.com/conda-forge/deepchem-feedstock) -> release in conda forge
4. Create and merge a PR for updating the Dockerfile (`docker/conda-forge/Dockerfile`)
5. Build and publish a new docker image -> release in DockerHub 
@@ -15,13 +15,13 @@ This note explains how to release deepchem packages.

### Nightly build

We publish the nightly build only when merging a PR to the master and passing all CI checks in a merge commit.
We publish a nightly build only when merging a PR to the master and passing all CI checks in a merge commit.
**If some CI check doesn't pass in a merge commit, the nightly build package will not be published.**
The publish process is automated by GitHub Actions and it is in `deploy` section of `.github/workflows/main.yml`.

### Major version build

We publish the major version build only when pushing a new tag.
We publish a major version build only when pushing a new tag.
The publish process is automated by GitHub Actions and it is in `.github/workflows/release.yml`.

## Conda Forge
@@ -35,14 +35,14 @@ After merging a PR, we could publish a new package.

### Nightly build

The latest tag (deepchemio/deepchem:latest) is the nightly build and the image is built by `docker/master/Dockerfile`.
We publish the nightly build only when merging a PR to the master.
The latest tag (deepchemio/deepchem:latest) is a nightly build and the image is built by `docker/master/Dockerfile`.
We publish a nightly build only when merging a PR to the master.
The publish process is automated by [Docker Hub](https://docs.docker.com/docker-hub/builds/).

### Major version build

The specific tag (deepchemio/deepchem:2.3.0) is the major version build and the image is built by `docker/conda-forge/Dockerfile`.
After publishing the new conda package, we need to modify `docker/conda-forge/Dockerfile`, build and publish the new image manually.
The specific tag (deepchemio/deepchem:2.3.0) is a major version build and the image is built by `docker/conda-forge/Dockerfile`.
After publishing a new conda package, we need to modify `docker/conda-forge/Dockerfile`, build and publish a new image manually.

```bash
$ cd docker/conda-forge