Skip to content

Latest commit

 

History

History
92 lines (74 loc) · 3.54 KB

CONTRIBUTING.md

File metadata and controls

92 lines (74 loc) · 3.54 KB

Contributing to CPSM

Thank you for your interest in contributing to CPSM!

Getting Started

  1. Make sure you have a GitHub account.
  2. Fork this repository on GitHub.
  3. On your local machine, clone your fork of the repository.
  4. Once you have cloned the repo, create a virtual environment (e.g. with virtualenv or python's venv module) and run:
    pip install -e .
    
    to install cpsm in development mode.

Project Organization

.
├── bin               // executables
├── cpsm              // main project directory
│   └── templates     // Jinja templates
└── docs              // project website

Making Changes

  1. Add some really awesome code to your local fork. It's usually a good idea to make changes on a branch with the branch name relating to the feature you are going to add.
  2. When you commit your code, husky will automatically run various formatters on the code.
  3. When you are ready for others to examine and comment on your new feature, navigate to your fork of cpsm on GitHub and open a pull request (PR). Note that after you launch a PR from one of your fork's branches, all subsequent commits to that branch will be added to the open pull request automatically.
  4. Once you mark the "Ready to go" box in your Pull Request message, your code will be reviewed and commented on, and (hopefully) eventually merged!

Example Workflows

Adding a Config Variable to cpsm_config.py

  1. Add the variable to cpsm/templates/cpsm_config_template.j2
  2. Add the variable to get_init_options in cpsm.py
  3. Add logic, in a mode such as save or start, that makes use of the config variable.
  4. Add the variable to the cpsm_config.py example under Customization in README, and add info about it elsewhere if applicable.

Adding a new Mode

  1. Decide what command line arguments are needed for the mode.
  2. Add the mode, its command line arguments, and help message to MODES in cpsm.py
  3. Document the mode in README, particularly under the Examples and Usage section.
  4. Decide what config variables (if any) are needed for the mode, and add them using the instructions above
  5. Add a function to cpsm.py that takes in args and then figures out what to do for the new mode.
  6. Add the mode name and the function to the mode_functions dictionary in main in cpsm.py.

Resources

Below are some useful resources related to the creation of CPSM: