From 2adb6ba8e9f7698b3f7968292a87c6dde920f42b Mon Sep 17 00:00:00 2001 From: Yoann Schneider <yschneider@teklia.com> Date: Wed, 7 Jun 2023 07:33:51 +0000 Subject: [PATCH] Update doc to mentions development setup --- README.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3ce49e50..32dcab89 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,44 @@ ## Documentation -For more details about this package, make sure to see the documentation available at https://teklia.gitlab.io/atr/dan/. - -## Installation - To use DAN in your own scripts, install it using pip: ```console pip install -e . ``` +For more details about this package, make sure to see the documentation available at https://teklia.gitlab.io/atr/dan/. + +## Development +For development and tests purpose it may be useful to install the project as a editable package with pip. + +* Use a virtualenv (e.g. with virtualenvwrapper `mkvirtualenv -a . dan`) +* Install `dan` as a package (e.g. `pip install -e .`) + +### Linter +Code syntax is analyzed before submitting the code.\ +To run the linter tools suite you may use pre-commit. +```shell +pip install pre-commit +pre-commit run -a +``` + +### Run tests +Tests are executed with `tox` using [pytest](https://pytest.org). +To install `tox`, +```shell +pip install tox +tox +``` + +To reload the test virtual environment you can use `tox -r` + +Run a single test module: `tox -- <test_path>` +Run a single test: `tox -- <test_path>::<test_function>` + +The tests use a large file stored via [Git-LFS](https://docs.gitlab.com/ee/topics/git/lfs/). Make sure to run `git-lfs pull` before running them. + + ## Inference To apply DAN to an image, one needs to first add a few imports and to load an image. Note that the image should be in RGB. -- GitLab