Contribute
+++++++++++++

REHO is an open-source, documented, and collaborative decision support tool for energy system modeling.

We articulate our philosophy and provide guidelines for contributing, making it accessible for anyone to get involved.
Whether you are addressing a bug, enhancing documentation, or proposing new features, your contributions have the potential to positively impact the success of REHO and its community.

In addition to this documentation website, offering a first glance at the features implemented by the model,
two platforms support the development of REHO: the GitHub repository, and the Mattermost channel.

.. note::
    In the following section, we provide information on the roles, structure, and guidelines to follow when joining the community.

    Even without immediate contributions, everyone is welcome to clone the repository and generate results using the tool, without forgetting to cite it properly.


Repository
============

The GitHub repository (https://github.com/IPESE/REHO) contains the codes and algorithms, some default data and examples scripts,
as well as the documentation. It is also useful to track the status of reported bugs or new features under development, and to participate to ongoing discussions.


People involved
------------------

- **Administrators**: Responsible for ensuring repository rules are respected. Have most rights and manage user permissions.
- **Developers**: Contribute new features on separate branches, participate in peer-reviews.
- **Users**: Contribute by forking the code, producing results, and giving feedback on the tool's functionality.

Branches
------------

The repository consists of three types of branches:

- ``main``: Contains a stable and interoperable version of the code. Protected branch, only *Administrators* can push.
- ``documentation``: Contains additions and corrections to the tool documentation (this may concern .rst files, but also the DocStrings for the Python functions and classes). Anyone can push.
- **Others**: Used by *Developers* to collaborate and develop advanced features, or by *Users* to generate results.

Reporting issues
-------------------

Issues can be reported on the repository. An issue can consist of a bug identification, but also of a suggestion for enhancement or new feature.
This section can therefore be used to discuss any idea or question related to REHO.
To report an issue:

1. Navigate to the `Issues section <https://github.com/IPESE/REHO/issues>`_ of the repository.
2. Click on the green "New Issue" button.
3. Provide details about the problem or suggestion.
4. Always specify an *Assignee* and a *Label*.
5. Submit the issue.

.. warning::
    Ensure to review existing issues to prevent duplicates, and furnish comprehensive details to facilitate the community in understanding and addressing your concern effectively.

Always bear in mind that your contributions, whether in the form of code, documentation, or issue reporting, are instrumental in the ongoing development and enhancement of REHO.

Pull requests
----------------

Everyone can contribute to the development by:

1. Creating your own branch from the `main branch <https://github.com/IPESE/REHO/tree/main>`_
2. Developing the code
3. Creating a pull request in the appropriate `Pull requests section <https://github.com/IPESE/REHO/pulls>`_
4. Getting accepted by an Administrator

.. warning::
    Remember to adhere to the guidelines outlined in the repository to ensure your pull request is accepted.


Documentation
----------------

The purpose of the documentation is to consolidate all the knowledge generated by the REHO community.
It is created using Sphinx and is an integral part of the repository. As such, it is open for modification by all users.

Feel free to edit the .rst files in the ``reho/documentation`` directory, or to modify the docstrings for the Python functions and classes as needed.

If you are not familiar with Sphinx, you can look at `Getting started with Sphinx <https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html>`_.

Communication
================

In addition to the GitHub repository for exchanging ideas on the development of the tool, a communication platform is available to quick chat with other Users and Developers. We welcome new members to join our `REHO community on Mattermost <https://ipese-mattermost.epfl.ch/signup_user_complete/?id=6ukmwrxfufgmdcajm8ok6krfxo&md=link&sbr=su>`_.

You can also use this chat to directly contact one of the Administrators (@dorsan or @cedric_terrier) if you have any questions.
