Thank you for considering contributing to Sinergym! 🎉
Your contributions can fall into two main categories:
- Create an issue using our issue template to propose your feature.
- Discuss the design and implementation with the maintainers.
- Once approved, implement the feature and submit a Pull Request.
- Browse open issues: Sinergym Issues.
- Claim an issue by commenting on it.
- If you need more context, feel free to ask—we're happy to help!
- Target the
mainbranch of Sinergym. - Follow the Pull Request template (it will appear in the PR textbox).
- Reference the issue number in your PR description using
Fixes #123to auto-close it when merged. - If your work is still in progress, use a Draft PR (learn more).
Need help with PRs? Check out:
- Use our GitHub issue templates when possible.
- If your issue doesn't fit any template, submit a blank issue with a clear and concise description.
-
Clone the repository:
git clone https://github.com/ugr-sail/sinergym.git cd sinergym/ -
Install Sinergym with developer kit (for tests, docs, DRL algorithms, etc.):
poetry install --no-interaction --with dev
Alternatively, you can use pip for installation, but please note that this approach is intended for package distribution rather than development—some development dependencies will not be installed.
pip install -e.[extras]
-
Install EnergyPlus and include EnergyPlus Python API in Python path (see INSTALL.md).
😎 Why? No need to manage Python versions, dependencies, or EnergyPlus installation.
- If using Visual Studio Code, use the Remote Containers extension for an easy setup.
- Alternatively, build the container manually using the provided
Dockerfile.
- Ensure the documentation builds successfully with Sphinx:
cd docs && make spelling && make html
- If a word isn't recognized, add it to
docs/sources/spelling_wordlist.txt(in alphabetical order).
Follow the Google-style docstrings (Napoleon):
def my_function(arg1: type1, arg2: type2) -> return_type:
"""Brief summary of the function.
Args:
arg1 (type1): Description of arg1.
arg2 (type2): Description of arg2.
Returns:
return_type: Description of return value.
"""
...
return my_variable💡 Tip: Use the Python Docstring Generator extension in VS Code to automatically generate docstrings in the correct format.
Note: Configuration for these tools is automatically applied and included in the pyproject.toml definition.
- Code formatting: Use black (max 88 characters per line).
- Import sorting: Use ruff.
- Type checking: Run pyright.
📝 Before submitting a PR, ensure your code passes:
black --check .ruff check .pyright sinergym/pytest tests/ -vvv
📎 Git Hooks Setup: To ensure code quality standards are met before committing, we recommend setting up the provided git hooks:
chmod +x hooks/*
git config core.hooksPath hooksThis will automatically run black, ruff, and pyright (with project's specific settings) checks before each commit.
📋 Workflows in the pull request will check it, in any case.
📝 Before pushing your code, make sure it meets the following criteria:
Indicate the type of change your PR introduces by marking an x in the relevant box:
- 🐛 Bug fix (non-breaking change that fixes an issue)
- ✨ New feature (non-breaking change that adds functionality)
- 💥 Breaking change (change that affects existing functionality)
- 📖 Documentation (updates to documentation)
- 🚀 Improvement (enhancing an existing feature)
- 🔄 Other (please specify)
- ✅ I have read the CONTRIBUTING.md guide (required).
- ✅ My changes require updates to the documentation.
- ✅ I have updated the necessary documentation accordingly.
- ✅ I have added or updated the necessary tests.
- ✅ I have reformatted the code using
black. - ✅ I have sorted imports using
ruff. - ✅ If I modified documentation, I verified that
cd docs && make spelling && make htmlpasses. - ✅ I ensured that
pytest tests/ -vvruns successfully (required). - ✅ I checked that
pyright sinergym/runs successfully (required).
💡 Need help? If you're unsure about anything, feel free to ask in your PR or open an issue.
Happy coding! 🚀