Development
Contribution Guidelines
To ensure a smooth and collaborative development process, follow these guidelines:
Branching Strategy: - Use a descriptive branch name for new features or fixes:
Feature branches:
feature/<feature-name>
Bugfix branches:
bugfix/<issue-description>
Always base your branch off the
develop
branch:git checkout develop git checkout -b feature/<feature-name>
Pull Requests: - Submit pull requests (PRs) to the
develop
branch. - Provide a clear description of your changes, including:The purpose of the changes.
Any relevant issue numbers.
Instructions for testing your feature.
Code Reviews: - All PRs must be reviewed and approved by at least one other contributor before merging. - Address all review comments before requesting a re-review.
Code Style
Maintain a consistent and clean codebase by adhering to the following standards:
PEP 8 Guidelines: - Follow the Python style guide: PEP 8.
Formatting: - Use
black
for automatic code formatting:black .
Linting: - Run
flake8
to check for linting issues:flake8 .
Docstrings: - Use Google-style docstrings to document functions, classes, and modules.
Example:
def example_function(param1: int, param2: str) -> str: """ Concatenate an integer and a string. Args: param1 (int): An integer to convert to a string. param2 (str): A string to concatenate. Returns: str: The concatenated result. """ return f"{param1}{param2}"
Workflow for Adding Features
Create a Branch:
git checkout -b feature/<feature-name>
Develop Your Feature: - Write modular, reusable, and well-documented code.
Test Your Changes: - Run your changes locally or in an environment like Colab.
Submit a Pull Request: - Push your branch:
git push origin feature/<feature-name>
Open a pull request on GitHub to merge into the
develop
branch.
Best Practices
Commit Messages: - Use meaningful and concise commit messages:
Example:
Add support for ViTL16 model
Example:
Fix bug in DenseNet training loop
Modularity: - Write code that is modular and reusable across different parts of the project.
Documentation: - Update or add documentation for all new features in the
README.md
ordocs/
directory.Performance: - Profile new features to ensure they do not degrade performance.