If you are comfortable with GitHub and git
, the command-line program, you can download the workshop materials by cloning my repository:
git clone https://github.com/qszhao/Aalto2023-spopt.git
cd Aalto2023-spopt
If you are not comfortable with GitHub, download the repository to your computer as a zip file from the workshop website. To do this, go to https://github.com/qszhao/Aalto2023-spopt, click on the green button labelled "< > Code ", then click the " Download Zip" option.
To follow along with the workshop material, it is best if you install Anaconda, a scientific python computing environment. If you do not yet have Anaconda installed, you can install miniconda (https://conda.io/miniconda.html) or the (larger) Anaconda distribution (https://www.anaconda.com/download/).
Option 1:
Using the conda
program from your command line or within the anaconda prompt, we recommend using the following terminal commands to set up your environment:
# we want to use only the community-distributed packages on "conda-forge"
conda config --add channels conda-forge
conda config --set channel_priority strict
# and, we want to use the faster implementation of conda, called "mamba"
conda install mamba
# Then, we want to create our actual environment
mamba env create --file environment.yml
# and finally, activate the environment
conda activate spatialopt
Option 2: Alternatively, you can use conda to set up the environment as well.
#Check current conda channel priority
conda config --get channels
# Switch your default conda channel to conda-forge and set it as the highest priority
# we want to use only the community-distributed packages on "conda-forge"
conda config --add channels conda-forge
conda config --set channel_priority strict
#Create new environment
conda create --name spatialopt python=3.11
#Check existing conda environment
conda info --envs
#Make sure that you are going to work in newly created environment
conda activate spatialopt
# Install packages
conda install -c conda-forge jupyterlab
conda install -c conda-forge geopandas
conda install -c conda-forge matplotlib
conda install -c conda-forge shapely
conda install -c conda-forge pyogrio
conda install -c conda-forge libpysal
conda install -c conda-forge spopt
conda install -c conda-forge pulp
#Alternatively run the installation in one line
conda install -c conda-forge jupyterlab geopandas matplotlib shapely pyogrio libpysal spopt pulp
#Start the jupyter lab
jupyter lab
If you are using the "Anaconda Navigator" interface, you can import the workshop environment using the steps described in its documentation.
To start your analysis environment locally, you first must activate the spatialopt environment if you have not done so:
conda activate spatialopt
And then, you must start Juptyer Lab, the next-generation user interface for Project Jupyter. The workshop code is implemented in Jupyter Notebooks, a literate and interactive programming environment for scientific computing.
jupyter lab
This teaching materials have been co-designed with the spopt development team and special thanks to Dr Levi Wolf in University of Bristol, Dr James Gaboardi in ORNL, and Germano Barcelos from Brazil.