Skip to content

Latest commit

 

History

History
85 lines (72 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

85 lines (72 loc) · 3.39 KB

Python Tensor Toolbox Contributor Guide

Issues

If you are looking to get started or want to propose a change please start by checking current or filing a new issue.

Working on PYTTB locally

  1. clone your fork and enter the directory

    $ git clone [email protected]:<your username>/pyttb.git
    $ cd pyttb
    
    1. setup your desired python environment as appropriate
  2. install dependencies

    $ pip install -e ".[dev]"
    $ make install_dev # shorthand for above
    
  3. Checkout a branch and make your changes

    git checkout -b my-new-feature-branch
    
  4. Formatters and linting

    1. Run autoformatters from root of project (they will change your code)
      $ isort .
      $ black .
      
      1. We optionally support pre-commit hooks for this
    2. Pylint and mypy coverage is work in progress (these only raise errors)
      mypy pyttb/
      pylint pyttb/file_name.py  //Today only tensor is compliant
      
  5. Run tests (at desired fidelity)

    1. Just doctests (enabled by default)
      pytest
      
    2. Functional tests
      pytest .
      
    3. All tests (linting and formatting checks)
      pytest . --packaging
      
    4. With coverage
      pytest . --cov=pyttb --cov-report=term-missing
      

GitHub Workflow

Proposing Changes

If you want to propose a change to Python Tensor Toolbox, follow these steps:

  1. Create an Issue

    • Use the Issues tab of the Python Tensor Toolbox GitHub repository and click on the "New issue" button.
  2. Fork the Repository and Create a New Branch

    • Navigate to the main page of the Python Tensor Toolbox GitHub repository and click on the "Fork" button to create a copy of the repository under your own account.
    • Clone the forked repository to your local machine.
    • In your local repository, create a new branch for your proposed changes.
  3. Update the Code

    • Make the necessary updates in your local environment.
    • After making your changes, stage and commit them with an informative message.
  4. Push your Changes and Create a Pull Request

    • Push your changes to the new branch in your fork of the repository.
    • Navigate to the main page of the Python Tensor Toolbox repository and click on the "New pull request" button.
    • In the "base repository" dropdown, select the original Python Tensor Toolbox repository. In the "base" dropdown, select the branch where you want your changes to be merged.
    • In the "head repository" dropdown, select your forked repository. In the "compare" dropdown, select the branch with your changes.
    • Write a title and description for your pull request.
  5. Review Process

    • After creating a pull request, wait for the Github CI tests to pass.
    • If any test fails, review your code, make necessary changes, and push your code again to the same branch in your forked repository.
    • If there are any comments or requested changes from the Python Tensor Toolbox team, address them and push any additional changes to the same branch.
    • Once your changes are approved, a repository admin will merge your pull request.