4. Contributing
We welcome all contributions to this project! Whether it’s reporting bugs, suggesting features, fixing issues, or improving documentation, your input is invaluable.
4.1. Bug Reporting
If you encounter a bug, please report it by creating an issue on GitHub. Include as much detail as possible to help us reproduce and fix the issue.
4.2. Adding Features or Fixing Bugs
If you’ve identified a new feature to add or a bug you can fix, follow these steps:
Clone the
mainbranch.Create a new branch to work on your changes. Use a descriptive name for your branch, such as
fix-issue-123orfeature-add-logging.Use
add,commit, andpushto save your changes to the new branch.Create a pull request (PR). See the “Submitting a Pull Request” section for more details.
4.3. Submitting a Pull Request
To ensure a smooth review process and maintain high code quality, follow these guidelines when submitting a PR:
If applicable, write unit tests for your changes. We use the pytest framework. Every Python module, extension module, or subpackage in the sparsecoding package directory should have a corresponding
test_<name>.pyfile. Pytest examines these files for test methods (namedtest*) and test classes (namedTest*). Add your tests to the appropriatetest_*.py(create this file if it doesn’t already exist).Verify that all tests pass by running
pytest sparsecoding/from the base repository directory.Ensure your code adheres to the formatting guidelines specified in PEP8 and validated by flake8.
Prepare a detailed and clear PR description:
Summarize the purpose of the PR and the changes made.
Include any relevant context, such as links to related issues or discussions.
Specify testing steps or considerations for reviewers.
Submit your PR and assign reviewers as necessary.
Reviewers: Use squash and merge when merging the PR.
Set the merge description to match the PR description.
Squash commits into a single commit to maintain a clean project history.
4.4. Coding Style Guidelines
We follow the NumPy documentation standards.
Format your code according to the flake8 standard.
Use underscores to separate words in non-class names (e.g.,
n_samplesinstead ofnsamples).Avoid single-character variable names.