Thank you for your interest in contributing to Valori! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Process
- Coding Standards
- Testing
- Documentation
- Pull Request Process
- Issue Reporting
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to team@Valori.com.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/varshith-Git/valori.git cd valori - Set up the development environment (see below)
- Create a branch for your feature or bugfix:
git checkout -b feature/your-feature-name
- Python 3.8 or higher
- Git
- Virtual environment tool (venv, virtualenv, or conda)
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -r requirements-dev.txt pip install -e . -
Install pre-commit hooks:
pre-commit install
-
Verify setup:
python -m pytest tests/ -v
We welcome several types of contributions:
- Bug fixes: Fix existing issues
- New features: Add new functionality
- Documentation: Improve docs, examples, or comments
- Tests: Add or improve test coverage
- Performance: Optimize existing code
- Refactoring: Improve code structure without changing functionality
- Check existing issues and pull requests to avoid duplication
- Create an issue for significant changes to discuss the approach
- Fork and clone the repository
- Create a feature branch from
main - Make your changes following our coding standards
- Add tests for new functionality
- Update documentation as needed
- Run the test suite and ensure all tests pass
- Submit a pull request
We follow PEP 8 with some modifications:
- Line length: 88 characters (Black default)
- Import order: Use
isortfor consistent import sorting - Type hints: Use type hints for all function signatures
- Docstrings: Use Google-style docstrings
We use automated tools for code formatting:
# Format code with Black
black src/ tests/
# Sort imports with isort
isort src/ tests/
# Check formatting
black --check src/ tests/# Lint with flake8
flake8 src/ tests/
# Type checking with mypy
mypy src/
# Security check with bandit
bandit -r src/- Unit tests: Test individual components in isolation
- Integration tests: Test component interactions
- Performance tests: Benchmark critical operations
# Run all tests
python -m pytest tests/
# Run with coverage
python -m pytest tests/ --cov=src/vectordb --cov-report=html
# Run specific test file
python -m pytest tests/test_storage.py
# Run tests in parallel
python -m pytest tests/ -n auto
# Run only fast tests
python -m pytest tests/ -m "not slow"- Test naming: Use descriptive test names
- Test isolation: Each test should be independent
- Mocking: Use mocks for external dependencies
- Fixtures: Use pytest fixtures for common setup
- Assertions: Use specific assertions with helpful messages
Example test:
def test_memory_storage_store_vector():
"""Test storing a vector in memory storage."""
storage = MemoryStorage({})
storage.initialize()
vector = np.array([1.0, 2.0, 3.0])
vector_id = "test_vector"
metadata = {"category": "test"}
success = storage.store_vector(vector_id, vector, metadata)
assert success
retrieved_vector, retrieved_metadata = storage.retrieve_vector(vector_id)
assert np.array_equal(retrieved_vector, vector)
assert retrieved_metadata == metadata- Docstrings: All public functions and classes need docstrings
- Comments: Explain complex logic, not obvious code
- Type hints: Use type hints for better IDE support
- Sphinx: We use Sphinx for API documentation
- Examples: Include usage examples in docstrings
- Parameter descriptions: Document all parameters and return values
- README: Keep README.md updated
- Examples: Maintain examples in
examples/directory - Tutorials: Add tutorials for complex features
-
Run the full test suite:
python -m pytest tests/
-
Check code quality:
black --check src/ tests/ flake8 src/ tests/ mypy src/
-
Update documentation if needed
-
Add tests for new functionality
When submitting a PR, include:
- Description: What changes were made and why
- Related issues: Link to any related issues
- Testing: How the changes were tested
- Breaking changes: Note any breaking changes
- Documentation: Note any documentation updates needed
- Automated checks must pass (CI/CD)
- Code review by maintainers
- Approval from at least one maintainer
- Merge by maintainers
When reporting bugs, include:
- Valori version:
python -c "import vectordb; print(vectordb.__version__)" - Python version:
python --version - Operating system: OS and version
- Steps to reproduce: Minimal code example
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full traceback if applicable
For feature requests, include:
- Use case: Why is this feature needed?
- Proposed solution: How should it work?
- Alternatives: Other ways to solve the problem
- Additional context: Any other relevant information
- Modular design: Keep components loosely coupled
- Interface-based: Use abstract base classes for extensibility
- Configuration-driven: Use configuration dictionaries
- Error handling: Provide meaningful error messages
- Benchmarking: Benchmark critical paths
- Memory usage: Be mindful of memory consumption
- Scalability: Consider large dataset scenarios
- Optimization: Profile before optimizing
- Input validation: Validate all inputs
- Error handling: Don't expose sensitive information
- Dependencies: Keep dependencies up to date
- Security scanning: Run security tools regularly
- GitHub Issues: For bug reports and feature requests
- GitHub Discussions: For questions and general discussion
- Email: team@Valori.com for private matters
- Documentation: Check the docs first
Contributors will be recognized in:
- Contributors list in README.md
- Release notes for significant contributions
- Documentation for code contributions
By contributing to Valori, you agree that your contributions will be licensed under the MIT License.
Thank you for your interest in contributing to Valori! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Process
- Coding Standards
- Testing
- Documentation
- Pull Request Process
- Issue Reporting
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to varshith.gudur17@gmail.com.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/varshith-Git/valori.git cd valori - Set up the development environment (see below)
- Create a branch for your feature or bugfix:
git checkout -b feature/your-feature-name
- Python 3.8 or higher
- Git
- Virtual environment tool (venv, virtualenv, or conda)
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -r requirements-dev.txt pip install -e . -
Install pre-commit hooks:
pre-commit install
-
Verify setup:
python -m pytest tests/ -v
We welcome several types of contributions:
- Bug fixes: Fix existing issues
- New features: Add new functionality
- Documentation: Improve docs, examples, or comments
- Tests: Add or improve test coverage
- Performance: Optimize existing code
- Refactoring: Improve code structure without changing functionality
- Check existing issues and pull requests to avoid duplication
- Create an issue for significant changes to discuss the approach
- Fork and clone the repository
- Create a feature branch from
main - Make your changes following our coding standards
- Add tests for new functionality
- Update documentation as needed
- Run the test suite and ensure all tests pass
- Submit a pull request
We follow PEP 8 with some modifications:
- Line length: 88 characters (Black default)
- Import order: Use
isortfor consistent import sorting - Type hints: Use type hints for all function signatures
- Docstrings: Use Google-style docstrings
We use automated tools for code formatting:
# Format code with Black
black src/ tests/
# Sort imports with isort
isort src/ tests/
# Check formatting
black --check src/ tests/# Lint with flake8
flake8 src/ tests/
# Type checking with mypy
mypy src/
# Security check with bandit
bandit -r src/- Unit tests: Test individual components in isolation
- Integration tests: Test component interactions
- Performance tests: Benchmark critical operations
# Run all tests
python -m pytest tests/
# Run with coverage
python -m pytest tests/ --cov=src/vectordb --cov-report=html
# Run specific test file
python -m pytest tests/test_storage.py
# Run tests in parallel
python -m pytest tests/ -n auto
# Run only fast tests
python -m pytest tests/ -m "not slow"- Test naming: Use descriptive test names
- Test isolation: Each test should be independent
- Mocking: Use mocks for external dependencies
- Fixtures: Use pytest fixtures for common setup
- Assertions: Use specific assertions with helpful messages
Example test:
def test_memory_storage_store_vector():
"""Test storing a vector in memory storage."""
storage = MemoryStorage({})
storage.initialize()
vector = np.array([1.0, 2.0, 3.0])
vector_id = "test_vector"
metadata = {"category": "test"}
success = storage.store_vector(vector_id, vector, metadata)
assert success
retrieved_vector, retrieved_metadata = storage.retrieve_vector(vector_id)
assert np.array_equal(retrieved_vector, vector)
assert retrieved_metadata == metadata- Docstrings: All public functions and classes need docstrings
- Comments: Explain complex logic, not obvious code
- Type hints: Use type hints for better IDE support
- Sphinx: We use Sphinx for API documentation
- Examples: Include usage examples in docstrings
- Parameter descriptions: Document all parameters and return values
- README: Keep README.md updated
- Examples: Maintain examples in
examples/directory - Tutorials: Add tutorials for complex features
-
Run the full test suite:
python -m pytest tests/
-
Check code quality:
black --check src/ tests/ flake8 src/ tests/ mypy src/
-
Update documentation if needed
-
Add tests for new functionality
When submitting a PR, include:
- Description: What changes were made and why
- Related issues: Link to any related issues
- Testing: How the changes were tested
- Breaking changes: Note any breaking changes
- Documentation: Note any documentation updates needed
- Automated checks must pass (CI/CD)
- Code review by maintainers
- Approval from at least one maintainer
- Merge by maintainers
When reporting bugs, include:
- Valori version:
python -c "import vectordb; print(vectordb.__version__)" - Python version:
python --version - Operating system: OS and version
- Steps to reproduce: Minimal code example
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full traceback if applicable
For feature requests, include:
- Use case: Why is this feature needed?
- Proposed solution: How should it work?
- Alternatives: Other ways to solve the problem
- Additional context: Any other relevant information
- Modular design: Keep components loosely coupled
- Interface-based: Use abstract base classes for extensibility
- Configuration-driven: Use configuration dictionaries
- Error handling: Provide meaningful error messages
- Benchmarking: Benchmark critical paths
- Memory usage: Be mindful of memory consumption
- Scalability: Consider large dataset scenarios
- Optimization: Profile before optimizing
- Input validation: Validate all inputs
- Error handling: Don't expose sensitive information
- Dependencies: Keep dependencies up to date
- Security scanning: Run security tools regularly
- GitHub Issues: For bug reports and feature requests
- GitHub Discussions: For questions and general discussion
- Email: varshith.gudur17@gmail.com for private matters
- Documentation: Check the docs first
Contributors will be recognized in:
- Contributors list in README.md
- Release notes for significant contributions
- Documentation for code contributions
By contributing to Valori, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Valori! 🚀
7e031a3ed51860decae0bed4384a35e961caa2ae