zk0

Contributing to Federated Learning for Robotics AI

Thank you for your interest in contributing to this project! We welcome contributions from the community to help improve our federated learning implementation for robotics AI tasks.

Table of Contents

Ways to Contribute

There are several ways you can contribute to this project:

  1. Node Operators: Join the federated network with your hardware and data
  2. Code Contributors: Improve the codebase, add features, fix bugs
  3. Documentation: Help improve documentation and tutorials
  4. Testing: Report bugs, test new features, improve test coverage
  5. Feedback: Share your experience and suggestions

Code Contributors

We welcome code contributions to improve the project. Here’s how to get started:

Development Setup

  1. Prerequisites:
    • Python 3.10+
    • Conda or virtualenv
    • Git
  2. Clone and Setup:
    git clone <repository-url>
    cd <project-directory>
    conda create -n zk0 python=3.10 -y
    conda activate zk0
    pip install -e .
    
  3. Environment Configuration:
    cp .env.example .env
    # Edit .env with your configuration
    
  4. VSCode Configuration:
    • Open the project in VSCode
    • The .vscode/settings.json is configured to automatically use the zk0 conda environment
    • If VSCode doesn’t automatically detect the environment, you can manually select it:
      • Open Command Palette (Ctrl+Shift+P)
      • Select “Python: Select Interpreter”
      • Choose the zk0 conda environment
  5. Verify Setup:
     python -c "import src; print('Setup successful')"
    

Code Style and Guidelines

Code Formatting

We use the following tools for code quality:

Run formatting before committing:

black src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/

Testing

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

# Run specific test categories
pytest tests/unit/ -v
pytest tests/integration/ -v

Writing Tests

Example test structure:

import pytest
from unittest.mock import Mock

def test_federated_client_initialization():
    """Test that FederatedClient initializes correctly."""
    config = {"num_clients": 10, "rounds": 100}
    client = FederatedClient(config)

    assert client.num_clients == 10
    assert client.rounds == 100

Submitting Changes

Pull Request Process

  1. Fork the Repository: Create your own fork of the project
  2. Create a Branch: Use descriptive branch names
    git checkout -b feature/add-new-algorithm
    git checkout -b bugfix/fix-memory-leak
    git checkout -b docs/update-contributing-guide
    
  3. Make Changes: Implement your changes following the guidelines above
  4. Test Thoroughly: Ensure all tests pass and add new tests if needed
  5. Update Documentation: Update README.md or other docs if necessary
  6. Commit Changes: Write clear, concise commit messages
    git commit -m "feat: add support for FedProx algorithm
    
    - Implement FedProx aggregation strategy
    - Add configuration parameters
    - Update tests and documentation"
    
  7. Push to Branch: Push your changes to your fork
    git push origin feature/add-new-algorithm
    
  8. Create Pull Request:
    • Go to the original repository
    • Click “New Pull Request”
    • Select your branch
    • Fill out the PR template with:
      • Clear description of changes
      • Screenshots/videos for UI changes
      • Test results
      • Breaking changes (if any)

PR Review Process

Reporting Issues

Bug Reports

When reporting bugs, please include:

Feature Requests

For new features, please provide:

Issue Labels

We use the following labels to categorize issues:

Community Guidelines

Code of Conduct

We are committed to providing a welcoming and inclusive environment for all contributors. Please:

Communication Channels

Getting Help

If you need help getting started:

  1. Check the README.md for basic setup instructions
  2. Search existing issues for similar problems
  3. Ask questions in GitHub Discussions
  4. Contact maintainers directly for sensitive matters

License

By contributing to this project, you agree that your contributions will be licensed under the same license as the project (see LICENSE file). This ensures that the project remains open source and accessible to the community.


Thank you for contributing to Federated Learning for Robotics AI! Your efforts help advance the field of federated robotics and make this technology more accessible to everyone.