How to contribute

We highly encourage you to contribute to the project. You can do this by forking the project on GitHub and sending us a pull request. We will review your code and merge it into the project if it is good.

Step-by-step guide

If you are new to GitHub, here is a step-by-step guide on how to contribute to the project.

  1. First, fork the BAMT project on GitHub. To do this, click the “Fork” button on the top right of the page. This will create a copy of the project in your own GitHub account.

  2. Clone the repository to your local machine by using GitHub Desktop or the CLI commnad (make sure that you have git installed):

    git clone git@github.com:YourUsername/BAMT.git
    cd path/to/repos/BAMT
    
  3. Create a new branch for your changes, it is not recommended to work on the master branch:

    git checkout -b my-new-feature
    
  4. Make sure that your environment is up to date and set up for development. You can install all the dependencies by running the following command inside the project directory:

    pip install -r requirements.txt
    
  5. Start making changes on your newly created branch, remembering to never work on the master branch! Work on this copy on your computer using Git to do the version control.

  6. When you’re done making changes, check that your changes pass the tests by running the following command inside the project directory or follow the instructions. Note, that you need to have the pytest package installed:

    pip install pytest
    pytest -v -s tests
    
  7. When you are done editing and testing, commit your changes to your local repository with a descriptive message:

    git add modified_files
    git commit -am "Added some feature"
    
  8. Push your local changes to the remote repository on GitHub into your branch:

    git push origin my-new-feature
    

Finally, go to the web page of your fork of the BAMT repo, and click ‘Pull Request’ (PR) to send your changes to the maintainers for review.

If the following instructions look confusing, check git documentation or use GitHub Desktop with GUI. Using GitHUb extension for Visual Studio Code, PyCharm or whatever IDE you use is also a good option.

Before submitting a pull request

Before you submit a pull request for your contribution, please work through this checklist to make sure that you have done everything necessary so we can efficiently review and accept your changes.

If your contribution changes BAMT code in any way, please follow the check list below:

  • Update the documentation to reflect the changes.

  • Update the tests

  • Update the README.rst file if the change affects description of BAMT.

  • Make sure that your code is properly formatted according to the PEP8 standard. You can automatically format your code using the autopep8 package.

  • Make sure your commits are atomic (one feature per commit) and that you have written a descriptive commit message.

If your contribution requires a new dependency, please make sure that you have added it to the requirements.txt file and follow these additional steps:

  • Double-check that the new dependency is easy to install via pip or conda and supports Python 3. If the dependency requires a complicated installation, then we most likely won’t merge your changes because we want to keep BAMT easy to install.

  • Add the required version of the library to requirements.txt

Contribute to the documentation

Take care of the documentation.

All the documentation is created with the Sphinx autodoc feature. Use .. automodule:: <module_name> section which describes all the code in the module.

  • If a new package with several scripts:

    1. Go to docs/source/api and create new your_name_for_file.rst file.

    2. Add a Header underlined with “=” sign. It’s crucial.

    3. Add automodule description for each of your scripts

      $.. automodule:: bamt.your.first.script.path
      $   :members:
      $   :undoc-members:
      $   :show-inheritance:
      
      $.. automodule:: bamt.your.second.script.path
      $   :members:
      $   :undoc-members:
      $   :show-inheritance:
      
    4. Add your_name_for_file to the toctree at docs/index.rst

  • If a new module to the existed package:

    Most of the sections are already described in docs/source/api , so you can:

    • choose the most appropriate and repeat 3-d step from the previous section.

    • or create a new one and repeat 2-3 steps from the previous section.

  • If a new function or a class to the existing module:

    Be happy. Everything is already done for you.

Acknowledgements

This guide document is based at well-written TPOT Framework contribution guide and FEDOT Framework contribution guide.