Contributing
We welcome contributions to the Nenya project! This page provides guidelines for contributing to the codebase.
Getting Started
Fork the repository on GitHub
Clone your fork to your local machine
Create a branch for your changes
Make your changes following the coding guidelines
Write tests for your changes
Submit a pull request
Development Setup
To set up a development environment:
# Clone the repository
git clone https://github.com/yourusername/nenya.git
cd nenya
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
Coding Guidelines
Follow PEP 8 for code style
Use type hints for function parameters and return values
Document your code with docstrings following NumPy/Google style
Write clear commit messages
Keep functions focused on a single task
Use meaningful variable names
Documentation
All new features should include:
Docstrings for all functions, classes, and methods
Examples showing how to use the feature
Updates to the appropriate .rst files in the documentation
Example docstring format:
def my_function(param1, param2=None):
"""Brief description of the function.
More detailed description of what the function does.
Args:
param1 (type): Description of param1
param2 (type, optional): Description of param2. Defaults to None.
Returns:
type: Description of return value
Raises:
ExceptionType: When and why this exception is raised
Example:
>>> result = my_function('value', param2='other_value')
>>> print(result)
Expected output
"""
# Function implementation...
Testing
We use pytest for testing. Tests should be placed in the tests/ directory.
Unit tests should test individual components
Integration tests should test interactions between components
Test both success cases and error cases
Use fixtures where appropriate
Example test:
def test_my_function():
# Setup
input_value = 'test'
# Exercise
result = my_function(input_value)
# Verify
assert result == expected_result
# Teardown - if needed
Pull Request Process
Update documentation if needed
Ensure all tests pass
Add yourself to the list of contributors if you’re not already there
Submit the PR with a clear description of the changes and their purpose
Code Review
Pull requests will be reviewed based on:
Functionality: Does it work as expected?
Code quality: Is the code clean, well-structured, and maintainable?
Tests: Are there adequate tests for the changes?
Documentation: Is the documentation updated to reflect the changes?
Versioning
We follow semantic versioning:
MAJOR version for incompatible API changes
MINOR version for backward-compatible functionality additions
PATCH version for backward-compatible bug fixes
License
By contributing to Nenya, you agree that your contributions will be licensed under the same license as the project.
Questions?
If you have questions about contributing, please open an issue on GitHub or contact the maintainers directly.