Environment setup#

Pre-requisites#

GitHub account#

To contribute you’ll need a GitHub account. You can create one from this link

Install Git#

Instructions with installation commands for most Linux distributions can be found on the Git project website

Instructions with installation commands for macosx can be found on the Git project website

The recommended way to install Git is using Git for Windows.

Install conda#

We recommend you install miniconda and follow the steps below to install only the libraries you’ll need.

Miniconda installation instructions for linux are available on the conda website

Miniconda installation instructions for macosx are available on the conda website

Miniconda installation instructions for windows are available on the conda website

Text editor#

You might already have a text editor installed. Check if you have any editor from the list below, otherwise install one, any will do:

Fork the pymc repo#

Fork the project repository by clicking on the ‘Fork’ button near the top right of the main repository page.

fork_button

This creates a copy of the code under your GitHub user account. You should now see that https://github.com/<your GitHub handle>/pymc/ exists

Open a command line interface#

This should come with your operative system or have been installed when setting up Git and miniconda.

Clone the pymc repo#

Clone your fork. This will create a pymc folder wherever you are, make sure to be at the location where you want the folder to be created.

git clone git@github.com:<your GitHub handle>/pymc.git

This command should start immediately but it can take a while to finish. Its output should look similar to the prompt below (the exact numbers can change and it will be in the language or your computer which probably won’t be Catalan):

S'està clonant a «pymc»...
remote: Enumerating objects: 53490, done.
remote: Counting objects: 100% (212/212), done.
remote: Compressing objects: 100% (154/154), done.
remote: Total 53490 (delta 104), reused 107 (delta 58), pack-reused 53278
S'estan rebent objectes: 100% (53490/53490), 728.53 MiB | 10.04 MiB/s, fet.
S'estan resolent les diferències: 100% (39445/39445), fet.

Enter inside the directory containing your local clone of the pymc repo, then tell git this is a fork of the one in the pymc-devs organization:

cd pymc
git remote add upstream git@github.com:pymc-devs/pymc.git

None of these commands generate any output. To check they have worked type

git remote

and check that the output is:

origin
upstream

Install PyMC#

conda env create -f conda-envs/environment-dev.yml
conda env create -f conda-envs/environment-dev.yml
conda env create -f conda-envs/windows-environment-dev.yml

This command can also take a while, but should start writing output immediately. If it finishes successfully, the last lines printed will be:

done
#
# To activate this environment, use
#
#     $ conda activate pymc-dev
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Activate the environment and install pymc:

conda activate pymc-dev

This command has no output, but generally adds the environment name to the start of the command line. If you want, you can check it has worked with the command conda list which should print all the packages installed, starting with:

# packages in environment at /home/oriol/miniconda3/envs/pymc-dev:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
aeppl                     0.0.18             pyhd8ed1ab_0    conda-forge
aesara                    2.3.2            py38hdc754fd_0    conda-forge

Install PyMC:

pip install -e .

We already installed all the dependencies so this should not take long. If successful, the last printed line will be

Successfully installed pymc-4.0.0b2

Then activate pre-commit. It will help auto formatting the code for you.

pre-commit install

on success will show

pre-commit installed at .git/hooks/pre-commit

Your system is now ready! You are ready to do your first PR.

Go and choose an issue to work on at TODO: add link!