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¶
Update version number. The version number is defined in chunkflow/__version__.py, increase the version number before releasing.
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¶
Take a look of the existing simple operators, such as
chunkflow/flow/create_chunk.py
.Create your own operator file in the flow folder.
Create your own operator class such as MyOperator, and this class should inherit from the .base.OperatorBase.
Define the job of you operator in __call__(self, chunk, *other_args, **kwargs).
add the import operator code in
chunkflow/flow/operators/__init__.py
.Add unit test in
tests/flow/
.Run your unit test by
pytest tests/flow/my_operator.py
Add documentation in API Reference.