All analysis code related to the Bison Lab project at Earthshot Institute.
Code can run online using Binder
or locally using the setup below
- An Anaconda Python distribution is required as this simplifies the installation. Either
MinicondaorCondaare suitable: please follow the conda installation guide.
- In terminal/command line, navigate to your preferred software directory and clone this reposity to your local computer
# with SSH key
git clone git@github.com:earthshot-institute/bison-lab.git
# or with username/password
git clone https://github.com/earthshot-institute/bison-lab.git
Create a Conda (see prerequisites above if you don't have Conda installed) environment called bison-lab in which we can install all libraries/dependencies for this repository:
- Change directory into the bison-lab project directory you cloned from GitHub with
cd bison-lab. - Run the Conda command to create an environment based on the environment.yml configuration file in the bison-lab project directory.
conda env create -f environment.yml- Before running any code activate this conda environment:
conda activate bison-lab- (Optional) If you want to use the
Jupyter Labinterface, first make sure the environment is activated (step 3), then install the widget to enable leaflet maps.
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet🎉 You're ready to go! 🎉
The environment can be deactivated with:
conda deactivateTo run code quality tooling on every commit, we need to install the pre-commit Git hook:
pre-commit installNow on every commit, the hooks configured in the .pre-commit-config.yaml will be executed.
If new Python libraries/packages are required, they should be added to the environment.yml file. These new packages are only installed with the creation of a new environment, however, you can update your existing Conda environment using this command:
conda env update --prefix ./bison-lab --file environment.yml --pruneTo remove the bison-lab conda environment:
conda env remove -n bison-labRun Jupyter from the notebooks directory.
You have the option of using JupyterLab:
jupyter labor the "classic" Jupyter notebook:
jupyter notebook notebooks/