make conda_env_init
conda activate silk
make dev_install
make conda_update
- Add the new dependency to
requirements.txt
(with version constraint). - Run
make dev_install
to re-install the package in dev mode. - Run
make conda_export
to update the conda environment (don't forget to commit it).
- Run your conda command
conda install ...
. - Run
make conda_export
to update the conda environment (don't forget to commit it).
make conda_update
./bin/run_tests
- Add a file named
<module>_test.py
next to the module<module>.py
that you want to test. - Implement the tests in that new file using the unittest module.
- Run your tests like you would any other python file (
python <path>/<module>_test.py
) to make sure it works well. - By adopting this naming convention, this new test file will be executed when running
./bin/run_tests
.
Please run ./bin/linter
before committing your code.
All common python code will be in lib/
:
- Models should be in
lib/models
. - Custom pytorch modules should be in
lib/layers
. - Custom transforms (non-differentialble) should be in
lib/transforms
. - Datasets should be in
lib/datasets
. - Data Classes should be in
lib/data
. - Serialization/File/Networking should be in
lib/io
. - Training loop stuff (pytorch lightning) will be in
lib/train
. - 3D environment specific code should be in
lib/env3d
. - Visual Query specific code should be in
lib/visual_query
.
When implementing a binary command line, it should be in bin/
.
Example : We might need to build a simple python tool that extract keypoints from a list of images.
This could become a python script like this bin/extract_keypoints
, and this script would be using the silk
library.
We do use pdoc3 for automatically generating the documentation. pdoc3
is compatible with several formats (markdown, numpydoc, Google-style docstrings, ...).
When commenting our code, we should follow the numpydoc format as it is easy to read and fairly exhaustive.
make doc
When debugging, I cannot get the debugger call stack when ./bin/silk-cli
crashes raising an exception.
That's because silk-cli
catches all exceptions by default. To avoid that problem, run silk-cli
with this additional argument : debug=true
.
Example : ./bin/silk-cli [...] debug=true