Skip to content

Developer Setup

Vineet Bansal edited this page Aug 27, 2024 · 4 revisions

To contribute to CLM, follow these guidelines to set up a local environment for running the application.

Prerequisites

  • Conda (miniconda or anaconda)

Setting up the Environment

  1. Create a new conda environment named clm with Python version 3.10.

    conda create --name clm python=3.10 pip
    
  2. Activate the environment.

    conda activate clm
    

    The command prompt will change to indicate the new conda environment by prepending (clm).

  3. When you are done with the development, deactivate the clm environment and return to (base) by the following command:

    conda deactivate
    

Installation

  1. Clone the repository and enter it:

    git clone git@github.com:skinniderlab/CLM.git
    cd CLM
    
  2. Install the package in editable mode and any optional dependencies:

    pip install -e .[dev]
    

Run Unit Tests

This step is crucial to see if clm is working correctly.

cd <path/to/repo/clone>
pytest

Contributing to clm

  • Make sure that clm is installed in editable mode as described above. Start a new branch, prefixed with your initials (e.g. jd/)
cd <path/to/repo/clone>
git checkout -b jd/my_awesome_branch
  • Install the pre-commit hook. This will allow you to identify style/formatting/coding issues every time you commit your code. Pre-commit automatically formats the files in your repository according to certain standards, and/or warns you if certain best practices are not followed.
pre-commit install
  • Tweak/modify the code, make clm better! Send a PR towards the master branch.

Our CI will automatically run the pre-commit and pytest steps for PRs towards the protected branches, so running these steps on your local installation will prevent surprises for you later.

Clone this wiki locally