All kinds of contributions are welcome, including but not limited to the following:
- Fixes of any type, either to the code or the docs.
- New optical flow models.
- Support for other datasets.
- Finding parameters that successfully train some of the available models.
- Uninstall existing ptlflow packages
pip uninstall ptlflow
-
Fork the ptlflow repository and clone it to your working machine.
-
Checkout a new branch with a meaning name, for example.
git checkout -b feat/foo_feature
# or
git checkout -b fix/foo_bug
-
Commit your changes to your fork.
-
Create a Pull Request on GitHub to merge your fork to ptlflow. Make sure that the fork is up to date with the main branch of ptlflow.
Note: If you plan to develop something that involve large changes, it is encouraged to open an issue for discussion first.
The code should be compatible with the following library versions:
- Python >= 3.8
- PyTorch >= 1.8
- PyTorch Lightning == 1.9.X
When writing your code, please adhere to these guidelines:
-
Use meaningful names for variables, functions, and classes.
-
Always use type hints. These make it much easier to understand what is expect to come in or out of each function.
- Please note that we use Python >= 3.6 as the minimum requirement. Therefore, you cannot use built-in collection types such as
list
anddict
, which were introduced only in Python 3.9. Instead, you have to use their equivalents imports fromtyping
, such asList
andDict
.
- Please note that we use Python >= 3.6 as the minimum requirement. Therefore, you cannot use built-in collection types such as
-
Write docstrings for all public methods, functions, classes, and modules.
- We adopt the numpydoc standard for docstrings.
-
Use f-strings to format your strings.
-
Write small incremental changes.
- Create a commit for each meaningful, small change you make. Do not just create a huge commit with everything, since it will be much harder to understand and to revert small bugs.
-
Add tests (for pytest) when you develop new code.
- Tests are stored in the
tests
folder. The folder structure should mimic the structure of the source code.
- Tests are stored in the
-
Consider using
logging
instead ofprint
whenever possible (read about logging). For each module that uses logging, you should callconfig_logging
at the beginning to keep the logging format consistent across the platform.
# File foo.py
import logging
from ptlflow.utils.utils import config_logging
config_logging()
# Your code here
- Use black to format your code.
These contribution guidelines are based on those from https://github.com/open-mmlab/mmcv and https://github.com/kornia/kornia.