Skip to content

Commit

Permalink
more detailed README
Browse files Browse the repository at this point in the history
  • Loading branch information
eringrant committed Nov 14, 2023
1 parent f987b0f commit 3671b49
Showing 1 changed file with 63 additions and 15 deletions.
78 changes: 63 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding-project-template

This repository template is useful for developing Python packages with pre-commit autoformatting.
This repository template is useful for developing research-oriented coding projects as Python packages.

## Citation

To cite the work that this code is associated with, use:

Expand All @@ -13,28 +15,74 @@ To cite the work that this code is associated with, use:
}
```

## Installation
## Quickstart

### Option #1: Conda install
Clone the repo:

To install via [Conda](https://docs.conda.io/), do:
```sh
git clone git@github.com:eringrant/coding-project-template.git
cd coding-project-template/
```

```bash
git clone git@github.com:eringrant/TODO_package_name.git
cd TODO_package_name
conda env create --file environment.yml
To install a Conda environment with the requisite packages **on CPU**:

```sh
conda env create --file environment-cpu.yml
```

The Conda environment can then be activated via `conda activate TODO_package_name`.
To test that the package can be imported successfully:

### Option: pip install
```sh
conda activate TODO_package_name
python -c "import TODO_package_name"
```

To install via [pip](https://pip.pypa.io/), do:
## Setup

```bash
git clone git@github.com:eringrant/TODO_package_name.git
cd TODO_package_name
pip install -e .
### Installing packages

Any of the following installation methods will allow you to activate the environment with
`conda activate TODO_package_name`.

#### Option #1: Conda install (CPU-only)

To install via [Mamba](https://mamba.readthedocs.io/) (recommended)
or [Conda](https://docs.conda.io/), do:

```sh
conda env create --file environment-cpu.yml
```

#### Option #2: Conda install on GPU on a local machine

To install via [Mamba](https://mamba.readthedocs.io/) (recommended)
or [Conda](https://docs.conda.io/) with GPU support, do:

```sh
conda env create --file environment-gpu.yml
```

#### Option #3: Conda install on GPU on a SLURM cluster

If working on the head node of a SLURM cluster, you will need
to create a GPU-compatible environment on a compute node with an available GPU via:

```sh
srun --partition=gpu --gres=gpu:1 conda env create -f environment-gpu.yml
```

Note that you may have to adapt the `partition` name to the available partitions on your cluster;
run `sinfo -s` to display details about partitions.

### Storage locations

To avoid using up too much disk space in your home directory, make sure to point some packages to
alternative locations by adding the following to a shell configuration file, such as
`~/.bashrc` or `~/.zshrc`. (Remember to replace the ellipsis `...` with your desired locations!)

```sh
# Transient output.
export SCRATCH_HOME="..."
```

## Devtools
Expand Down

0 comments on commit 3671b49

Please sign in to comment.