Thank you for your interest in contributing to phased-array-systems! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions. We welcome contributors of all experience levels.
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/phased-array-systems.git cd phased-array-systems -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install in development mode:
pip install -e ".[dev,docs,plotting]" -
Verify the installation:
pytest tests/ -v
# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=phased_array_systems
# Run a specific test file
pytest tests/test_link_budget.py -vWe use ruff for linting and formatting, and mypy for type checking:
# Lint the codebase
ruff check .
# Auto-format code
ruff format .
# Type check
mypy src/phased_array_systems-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes with clear, atomic commits
-
Push to your fork and create a Pull Request
Write clear, descriptive commit messages:
Add support for triangular array geometry
- Implement triangular element positioning
- Add tests for new geometry type
- Update documentation with examples
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Tests: Add tests for new functionality
- Documentation: Update docs if adding new features
- Small PRs: Keep changes focused; large changes should be split into multiple PRs
Look for issues labeled good first issue - these are ideal for newcomers.
- New models: Additional propagation models, antenna patterns
- Documentation: Tutorials, examples, API docs improvements
- Testing: Increase test coverage, add edge case tests
- Performance: Optimization of batch evaluation, caching improvements
- Visualization: New plot types, interactive visualizations
Before starting on a large feature:
- Check existing issues to avoid duplicates
- Open an issue describing the feature
- Wait for discussion/approval before implementing
- Follow PEP 8 (enforced by ruff)
- Use type hints for all public functions
- Use Google-style docstrings
- Keep functions focused and under 50 lines when possible
def compute_link_margin(
eirp_dbw: float,
path_loss_db: float,
required_snr_db: float,
) -> dict[str, float]:
"""Compute the communications link margin.
Calculates received SNR and margin to the required threshold
for a point-to-point link.
Args:
eirp_dbw: Effective Isotropic Radiated Power in dBW.
path_loss_db: Total path loss in dB.
required_snr_db: Required SNR for demodulation in dB.
Returns:
Dictionary containing:
- snr_db: Received signal-to-noise ratio
- margin_db: Margin above required SNR (positive = passes)
Raises:
ValueError: If any input is NaN or infinite.
Example:
>>> result = compute_link_margin(50.0, 150.0, 10.0)
>>> print(f"Margin: {result['margin_db']:.1f} dB")
"""- Test both happy path and edge cases
- Use descriptive test names:
test_extract_pareto_with_empty_dataframe - Use pytest fixtures for shared setup
- Mock external dependencies (e.g.,
phased-array-modeling)
# Install docs dependencies
pip install -e ".[docs]"
# Serve locally with live reload
mkdocs serve
# Build static site
mkdocs builddocs/getting-started/- Installation and quickstartdocs/user-guide/- Detailed usage guidesdocs/tutorials/- Step-by-step tutorialsdocs/api/- API reference (auto-generated from docstrings)docs/theory/- Background theory and equations
Releases are managed by maintainers:
- Update
__about__.pywith new version - Update
CHANGELOG.md - Create a GitHub release with tag
vX.Y.Z - GitHub Actions will publish to PyPI
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Security: Email maintainers directly (do not open public issues)
Contributors are recognized in:
- The GitHub contributors page
- Release notes for significant contributions
- The project README for major contributions
Thank you for contributing to phased-array-systems!