Thank you for considering contributing to GSP-Py, a Python implementation of the Generalized Sequential Pattern algorithm! Contributions, whether they're reporting bugs, suggesting improvements, or submitting code, are greatly appreciated. Please review this document to understand how you can contribute effectively.
Here are some ways to contribute to the project:
- Report Bugs: If you encounter any issues, please let us know by submitting a bug report.
- Suggest Enhancements: Suggest new features or improvements.
- Fix Bugs or Add Features: Help fix issues or implement features based on the project's roadmap or your own ideas.
- Improve Documentation: Correct typos, add usage examples, or expand explanations in the documentation.
- Write Tests: Testing is an essential component to ensure a reliable library.
If you'd like to contribute code or documentation, please follow these steps:
- Visit the GSP-Py repository and click "Fork."
Clone the forked repository to your local machine:
git clone https://github.com/<your-username>/gsp-py.git
cd gsp-py
Create a new branch for your work:
git checkout -b feature/my-feature
Use a descriptive branch name, such as fix/issue-123
or feature/custom-filter-support
.
- Edit and test your code locally.
- Ensure any new features include unit tests.
Before submitting your changes, ensure the code passes all tests:
pytest
If you're adding a new feature, include tests for it in the tests/
directory.
Push your changes to your forked repository:
git add .
git commit -m "Add a brief but descriptive commit message"
git push origin feature/my-feature
- Navigate to the main repository's GitHub page and select Pull Requests.
- Click New Pull Request and provide details about your changes, including:
- A clear summary of your contribution.
- Any relevant references (e.g., a related issue or feature request).
- Be sure to reference the associated issue (if applicable) in your PR description (e.g., "Closes #12").
To maintain consistency and code quality, please follow these coding guidelines:
-
Formatting:
- Follow PEP 8 for Python code style conventions.
- Use tools like
pylint
orflake8
to ensure your code is formatted correctly:pylint path/to/file.py
-
Commit Messages:
- Write clear and concise commit messages.
- Begin your commit message with an action verb, such as "Add," "Fix," "Improve," "Update," etc.
- For example:
Fix candidate pruning for short sequences
.
-
Tests:
- Write tests for new features or bug fixes.
- Use
pytest
as the testing framework. - Place tests in the
tests/
directory using descriptive test names.
-
Documentation:
- Update documentation (
README.md
,CHANGELOG.md
, comments in code) related to your changes. - If a new feature is added, provide usage examples and explanation.
- Update documentation (
To get familiar with the existing code, follow these steps:
-
Setup Environment: This project uses Rye for managing dependencies and the virtual environment. Follow these instructions to set it up:
-
Install Rye (if not already installed):
curl -sSf https://rye.astral.sh/get | bash
Make sure Rye's binary directory is added to your
PATH
:export PATH="$HOME/.rye/bin:$PATH"
-
Install project dependencies using Rye:
rye sync
This command reads the dependencies specified in the
pyproject.toml
file and installs them into a local environment managed by Rye.
-
-
Run Tests: Use Rye to run tests and verify the baseline state:
rye run test
The
test
script is defined in thepyproject.toml
under[tool.rye.scripts]
and usespytest
. -
Explore the Code: The main entry point for the GSP algorithm is in the
gsppy
module. The libraries for support counting, candidate generation, and additional utility functions are also within this module.
- No need to create a
venv
or install dependencies manually withpip
; Rye handles everything based on thepyproject.toml
file. - If you’re unfamiliar with Rye, refer to its documentation.
To report a bug or suggest an enhancement, open an issue on GitHub:
- Go to the Issues page.
- Select New Issue and choose the appropriate issue template:
- Bug report
- Feature request
- Include as much detail as possible:
- Steps to reproduce (for bugs).
- Clear description of the feature or enhancement (for feature requests).
We welcome all suggestions or feedback for improving this project! You can reach out by opening an issue or submitting a pull request.
Let’s build a great tool together! 😊
Please note that this project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainer.
Thank you for contributing! 🙌