Thank you for your interest in contributing to MechaPulse! This document explains how to set up a development environment, submit changes, and follow the project's coding standards.
- Code of Conduct
- Getting Started
- Development Workflow
- Branch Naming
- Commit Messages
- Pull Request Guidelines
- Coding Standards
- Testing
- Reporting Bugs
- Requesting Features
Please be respectful and constructive in all interactions. We welcome contributors of all experience levels.
-
Fork the repository on GitHub.
-
Clone your fork locally:
git clone https://github.com/<your-username>/MechaPulse.git cd MechaPulse
-
Add the upstream remote so you can pull in future changes:
git remote add upstream https://github.com/AkinduID/MechaPulse.git
-
Set up the relevant component following
docs/SETUP_GUIDE.md.
main ← feature/your-feature (PR)
← fix/your-fix (PR)
-
Create a new branch from
main:git checkout main git pull upstream main git checkout -b feature/your-descriptive-name
-
Make your changes in small, logical commits (see Commit Messages).
-
Push your branch to your fork:
git push origin feature/your-descriptive-name
-
Open a Pull Request against the
mainbranch of the upstream repository.
| Prefix | Usage |
|---|---|
feature/ |
New functionality |
fix/ |
Bug fixes |
docs/ |
Documentation-only changes |
refactor/ |
Code restructuring without behavior change |
test/ |
Adding or updating tests |
Use concise, imperative-mood commit messages:
Add FFT feature extraction to firmware
Fix model path resolution on Windows
Update API reference for /predict endpoint
- Limit the first line to 72 characters.
- Add a blank line followed by a more detailed description when necessary.
- Keep PRs focused — one logical change per PR.
- Fill in the PR description template, including the motivation for the change.
- Reference any related issues with
Closes #<issue-number>in the PR description. - Ensure the code builds and tests pass before requesting review.
- Respond to review comments within a reasonable timeframe.
- Follow PEP 8 style guidelines.
- Use type hints for function signatures where practical.
- Keep functions short and single-purpose.
- Document public functions and classes with docstrings.
def extract_features(signal: np.ndarray, sample_rate: int) -> dict:
"""Extract time- and frequency-domain features from an audio signal.
Args:
signal: 1-D NumPy array of audio samples.
sample_rate: Sample rate in Hz.
Returns:
Dictionary with keys RMS, Mean, MA1, MA2, MA3, F1, F2, F3.
"""
...- Follow the existing indentation style in
src/main.cpp(2-space indent). - Prefer
constexpr/constover#definefor constants. - Add a comment for each configuration constant.
- Avoid blocking the main loop for extended periods; use
millis()-based timing where possible.
Run the FastAPI server locally and exercise endpoints with curl or the Swagger UI at http://localhost:8000/docs.
Automated tests (if added):
cd desktop-app
pytestUse the PlatformIO unit test framework:
cd device-firmware
pio testRe-run all notebook cells from top to bottom to verify they execute without errors:
jupyter nbconvert --to notebook --execute notebooks/*.ipynbOpen a GitHub Issue with:
- A clear title describing the problem.
- Steps to reproduce.
- Expected vs. actual behavior.
- Environment details (OS, Python version, hardware).
Open a GitHub Issue with the enhancement label and describe:
- The use case or problem being solved.
- A proposed solution or API design.
- Any alternatives considered.