If you are interested in contributing to Sinergym, your contributions will fall into two categories:
- You want to propose a new Feature and implement it
- Create an issue about your intended feature (use our issue template), and we shall discuss the design and implementation. Once we agree that the plan looks good, go ahead and implement it.
- You want to implement a feature or bug-fix for an outstanding issue
- Look at the outstanding issues here: https://github.com/ugr-sail/sinergym/issues
- Pick an issue or feature and comment on the task that you want to work on this feature.
- If you need more context on a particular issue, please ask and we shall provide.
Once you finish implementing a feature or bug-fix, please send a Pull Request to
https://github.com/ugr-sail/sinergym main branch. Please, follow our pull request template for this purpose
(it will appear in text box so you only have to complete it). Please, be sure that you include the number of your issue (for instance "123") as Fixes #123
(the placeholder is already in the template) so the issue will be closed when the pull request is accepted.
You can create a pull request when the issue is not finished yet and work on it. If you prefer to work in this way, please, select Draft pull request and select ready for review when you are ready.
If you are not familiar with creating a Pull Request, here are some guides:
- http://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request
- https://help.github.com/articles/creating-a-pull-request/
Please, follow the issue templates whenever possible (GitHub interface will offer you those templates). If your issue does not fit any of the templates, then you can generate a blank issue and provide the information as clearly and concisely as possible.
To develop Sinergym on your machine, here are some alternatives:
-
Local computer
- Clone a copy of Sinergym from source (your forked repository):
git clone https://github.com/ugr-sail/sinergym.git cd sinergym/
- Install Sinergym in extra mode, with support for building the docs, running tests, execute DRL algorithms, etc:
pip install -e .[extra]
- Install Energyplus and BCVTB into your computer (see README.md for more information about this).
-
Local docker container (recommended)
- This is our recommendation, since you have not to care of Python version, dependencies, Energyplus engine, etc.
- If you are using Visual Studio Code you can build a container and develop with Github from there using remote container extension (very comfortable).
- If you don't want to use that editor extension, you can build a container using Dockerfile traditionally and init github credentials manually into container.
If you want to update our documentation, you have to pass sphinx build and spelling compilation. Workflows will check that and report errors in Pull Request. If spelling doesn't pass due to a word that is not in default dictionary, you have to add in docs/sources/spelling_wordlist.txt
(Please, respect alphabetical order).
- We are using autopep8 codestyle (max line length of 79 characters) 2 level aggressive.
- We are using isort to sort imports in our code.
- We are using pytype to control input and output types in our code, check that your contribution pass this or pull request will be denied automatically by a workflow (
pytest -d import-error sinergym/
).
Please run autopep8
to reformat your code, if you are using Visual Studio Code editor you can auto-format code on save file automatically: https://code.visualstudio.com/docs/python/editing#_formatting.
Please document each function/method using docstring Google standard format (called napoleon):
def my_function(arg1: type1, arg2: type2) -> returntype:
"""[summary]
Args:
arg1 (type1): [description]
arg2 (type2): [description]
Returns:
returntype: [description]
"""
...
return my_variable
Note: Python Docstring Generator extension could be very interesting for you in order to follow this standard.