Contributing to EMGIO¶
We welcome contributions to EMGIO! This guide will help you get started with the development process.
Development Setup¶
- 
Clone the repository:
 - 
Install for development:
 - 
Install test dependencies:
 
Code Structure¶
The EMGIO codebase is organized as follows:
emgio/
├── emgio/              # Main package directory
│   ├── __init__.py     # Package initialization
│   ├── core/           # Core functionality
│   │   ├── emg.py      # Main EMG class
│   ├── importers/      # Data import modules
│   │   ├── base.py     # Base importer class
│   │   ├── trigno.py   # Trigno importer
│   │   ├── eeglab.py   # EEGLAB importer
│   │   ├── otb.py      # OTB importer
│   │   ├── edf.py      # EDF importer
│   ├── exporters/      # Data export modules
│   │   ├── edf.py      # EDF/BDF exporter
│   ├── utils/          # Utility functions
│   ├── analysis/       # Analysis methods
│   ├── tests/          # Test suite
├── examples/           # Example scripts
├── docs/               # Documentation
Testing¶
Running Tests¶
EMGIO uses pytest for testing. To run the full test suite:
To run tests with coverage:
Writing Tests¶
When adding new features, please include appropriate tests. Tests should be placed in the emgio/tests directory, with a naming convention of test_*.py.
Example test:
def test_channel_selection():
    # Create a test EMG object
    ...
    # Run the function being tested
    ...
    # Assert the expected outcome
    assert ...
Documentation¶
Building Documentation¶
Documentation is built using MkDocs with the Material theme:
- 
Install documentation dependencies:
 - 
Build and serve the documentation locally:
 - 
Open your browser at http://127.0.0.1:8000/
 
Writing Documentation¶
- API documentation is generated automatically from docstrings
 - Use NumPy-style docstrings for all functions and classes
 - Add examples to the examples directory and reference them in the documentation
 - Update the appropriate section of the user guide when adding new features
 
Pull Request Process¶
- Fork the repository on GitHub
 - Create a feature branch (
git checkout -b feature/my-new-feature) - Make your changes and add tests
 - Ensure all tests pass (
pytest) - Make sure the documentation builds without errors (
mkdocs build) - Commit your changes (
git commit -am 'Add new feature') - Push to your branch (
git push origin feature/my-new-feature) - Create a new Pull Request on GitHub
 
Coding Style¶
EMGIO follows PEP 8 guidelines. We recommend using tools like flake8 or pylint to check your code style before submitting a pull request.
Some specific style guidelines: - Use 4 spaces for indentation (not tabs) - Maximum line length of 100 characters - Use docstrings for all public methods and classes - Use meaningful variable and function names
Adding New Importers¶
To add support for a new EMG format:
- Create a new file in 
emgio/importers/(e.g.,new_format.py) - Implement a class that inherits from 
BaseImporter - Implement the required methods
 - Add the new importer to 
__init__.py - Add tests in 
tests/test_importers.py - Document the new format in the user guide
 
License¶
By contributing to EMGIO, you agree that your contributions will be licensed under the BSD 3-Clause License.