Development

Install

Install with development mode (preferably in a python virtual environment):

git clone https://github.com/seung-lab/chunkflow.git
cd chunkflow
pip3 install -r requirements.txt
python3 setup.py develop

Note

we support python version >=3.5

Release

  1. Update version number. The version number is defined in chunkflow/__version__.py, increase the version number before releasing.

  2. Create a new release in PyPi.

Our travis build/test system can automatically release/update a version if you tag the commit. It is recommended to use travis system for new version release.

git tag v1.0.0
git push origin v1.0.0

Of course, you can also do it manually.

python setup.py sdist
twine upload dist/chunkflow-version.tar.gz

Note

If you would like to include/exclude some files/folders, please edit the MANIFEST.in file.

Documentation

We use Sphinx with reStructuredText to make documentation. You can make it locally for tests:

cd docs
pip3 install -r requirements.txt
make html

You can also make other formats, such as pdf and epub. Checkout it out with make help.

Add a New Operator

  1. Take a look of the existing simple operators, such as chunkflow/flow/create_chunk.py.

  2. Create your own operator file in the flow folder.

  3. Create your own operator class such as MyOperator, and this class should inherit from the .base.OperatorBase.

  4. Define the job of you operator in __call__(self, chunk, *other_args, **kwargs).

  5. add the import operator code in chunkflow/flow/operators/__init__.py.

  6. Add unit test in tests/flow/.

  7. Run your unit test by pytest tests/flow/my_operator.py

  8. Add documentation in API Reference.