This repository template is useful for developing research-oriented coding projects as Python packages.
To cite the work that this code is associated with, use:
@inproceedings{TODO_citation_key,
title={TODO},
author={TODO},
booktitle={TODO},
year={TODO}
}
Clone the repo:
git clone [email protected]:eringrant/coding-project-template.git
cd coding-project-template/
To install a Conda environment with the requisite packages on CPU:
conda env create --file environment-cpu.yml
To test that the package can be imported successfully:
conda activate TODO_package_name
python -c "import TODO_package_name"
Any of the following installation methods will allow you to activate the environment with
conda activate TODO_package_name
.
To install via Mamba (recommended) or Conda, do:
conda env create --file environment-cpu.yml
To install via Mamba (recommended) or Conda with GPU support, do:
conda env create --file environment-gpu.yml
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:
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.
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!)
# Transient output.
export SCRATCH_HOME="..."
.pre-commit-config.yaml
has been configured to run several autoformatters,
including the Black autoformatter as well as Flake8.
Run the following to install, update, and cache all pre-commit tools:
pre-commit install && pre-commit run