Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 2.62 KB

contributing.md

File metadata and controls

79 lines (52 loc) · 2.62 KB

Contributing

We welcome pull requests improving any aspect of this library! The main ways to contribute to pybaseball are the following:

  • Scraping additional data sources from trusted sites (FanGraphs, Baseball Reference, etc.). Write a function that scrapes the data and returns it in a usable format.
  • Fix an error or broken request/scrape in the existing code
  • Refactoring and style improvements
  • Documentation / README improvements
  • Baseball-specific analysis functions
  • Custom visualization and data preparation tools
  • Share some example code

A good place to start is on our Issues page, specifically good first issues or feature requests.

Guidelines

Generally follow PEP8 for code formatting. Please use Type Annotations for functions. If any of this is foreign, make the PR and we will give guidance in code review.

With each PR, please make sure you address the following:

  1. Include description of the changes. If this addresses an existing issue, please make sure to reference it (add a # with the issue number so Github links the two).
  2. Any new functionalities should have tests. Any amended functionalities should have the existing tests pass or have tests amended to conform the changes.
  3. New/changed functionality should be described in the docs.

Steps

  1. Fork the repository from the main page.

  2. Clone your fork to your computer and add the remote

git clone git@github.com:<your GitHub handle>/pybaseball.git
cd pybaseball
git remote add upstream git@github.com:jldbc/pybaseball.git
  1. Create a branch
git checkout -b my-awesome-new-feature
  1. Run setup.py (strongly recommend in a virtualenv)
pip install -e .
  1. Make your changes

  2. Run the test suite. From the top level pybaseball directory run:

pytest
  1. Add and commit changes with descriptive message
git add file1.py tests/test_file1.py docs/file1.md
git commit -m "My new fancy functionality"
  1. Sync with upstream to pull any recent changes
git fetch upstream
git rebase upstream/master
  1. Push your changes
git push origin my-awesome-new-feature
  1. Click the link that appears in your terminal to make a pull request, or go to your fork of the repository and click the link. Add a summary of your changes and submit!