For any new feature, please ensure the corresponding option in the sample configuration is added, so that others can review/use/extend it as needed.
Before starting to work on the code-level on GaNDLF, please follow the installation instructions to get the environment ready. Once that’s done, please install GaNDLF from the source code using the following commands (this can be skipped if you have installed from sources):
# continue from previous shell
(venv_gandlf) $> git clone https://github.com/mlcommons/GaNDLF.git
cd GaNDLF
pip install -e .
dict
via parameter parserTo update/change/add a dependency in setup, please ensure at least the following conditions are met:
python_requires
variable in setup).GANDLF.models
submodule.global_augs_dict
, defined in GANDLF/data/augmentation/__init__.py
GANDLF.data.augmentation
submodule.torchio.transforms.intensity_transform.IntensityTransform
. For example, please see the threshold/clip functionality in the GANDLF/data/preprocessing/threshold_and_clip.py
file.global_preprocessing_dict
, defined in GANDLF/data/preprocessing/__init__.py
GANDLF.data.preprocessing
submodule.Once you have made changes to functionality, it is imperative that the unit tests be updated to cover the new code. Please see the full testing suite for details and examples.
Once you have the virtual environment set up, tests can be run using the following command:
pytest --device cuda # can be cuda or cpu, defaults to cpu
Any failures will be reported in the file ${GaNDLF_HOME}/testing/failures.log
.
The code coverage for the tests can be obtained by the following command:
coverage run -m pytest --device cuda; coverage report -m