Thank you for your interest in contributing to nERdy! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Pull Request Process
- Reporting Issues
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone. Please be kind and considerate in all interactions.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/nERdy.git cd nERdy - Add the original repository as upstream:
git remote add upstream https://github.com/NanoscopyAI/nERdy.git
- Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
We welcome contributions in the following areas:
- Bug fixes: Fix issues in the existing codebase
- Documentation: Improve README, docstrings, or add tutorials
- New features: Add new analysis methods or model architectures
- Tests: Add or improve test coverage
- Performance: Optimize existing code
- Examples: Add example notebooks or scripts
- Check existing issues to avoid duplicating work
- For major changes, open an issue first to discuss your proposal
- Make sure your contribution aligns with the project's goals
- Python 3.8 or higher
- CUDA-capable GPU (recommended for training)
- Conda or pip for package management
# Create a virtual environment
conda create -n nerdy-dev python=3.10
conda activate nerdy-dev
# Install the package in development mode
pip install -e ".[dev]"
# Or using pip with requirements
pip install -r requirements.txt
pip install pytest pytest-cov black flake8 isort# Run all tests
pytest
# Run with coverage
pytest --cov=nERdy --cov=analysis --cov-report=html
# Run specific test file
pytest test/test_graph_metrics_plotter.pyWe follow PEP 8 guidelines with the following tools:
- Black for code formatting (line length: 100)
- isort for import sorting
- flake8 for linting
# Format code
black .
isort .
# Check for issues
flake8 .- All public functions and classes should have docstrings
- Use Google-style docstrings:
def function_name(param1: type, param2: type) -> return_type:
"""Brief description of function.
Args:
param1: Description of param1.
param2: Description of param2.
Returns:
Description of return value.
Raises:
ExceptionType: Description of when this exception is raised.
Example:
>>> function_name(value1, value2)
expected_output
"""- Use clear, descriptive commit messages
- Start with a verb in present tense (Add, Fix, Update, Remove, etc.)
- Reference issues when applicable:
Fix #123: description
Examples:
Add support for multi-channel input images
Fix memory leak in batch processing
Update documentation for inference module
Remove deprecated preprocessing function
-
Update your branch with the latest changes from upstream:
git fetch upstream git rebase upstream/main
-
Run tests to ensure nothing is broken:
pytest
-
Format your code:
black . isort .
-
Push your changes:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub with:
- Clear title describing the change
- Description of what was changed and why
- Reference to any related issues
- Screenshots/examples if applicable
-
Address review feedback promptly
Before submitting your PR, ensure:
- Code follows the project's style guidelines
- All tests pass
- New code is covered by tests (when applicable)
- Documentation is updated (when applicable)
- Commit messages are clear and descriptive
When reporting bugs, please include:
-
Environment information:
- OS and version
- Python version
- PyTorch/CUDA version
- Package versions (
pip freeze)
-
Steps to reproduce the issue
-
Expected behavior vs actual behavior
-
Error messages or tracebacks (if any)
-
Sample data or code to reproduce (if possible)
For feature requests, please describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
- Whether you're willing to implement it
If you have questions about contributing, feel free to:
- Open an issue with the "question" label
- Contact the maintainers directly
Thank you for contributing to nERdy!