This repo contains a worked example of running MapReader, designed for the Spatial Humanities conference 2024.
Follow the instructions below to set up the notebook on Google Colab (recommended), in Docker or locally.
- Set up - Google Colab (short version)
- Detailed instructions for setting up on Google Colab
- Set up - Docker
- Set up - Local
If you are familiar with Google Colab, you can set up the notebook by following these steps. If you are new to Google Colab, please refer to the detailed instructions below.
- Open Google Colab
- In the "Open notebook" window, click the "GitHub" option
- Paste the URL of this repository into the search bar and press Enter
- Open
mapreader-spatial-humanities-workshop.ipynb
-
In your browser, navigate to Google Colab.
An "Open notebook" window should appear automatically. If it doesn't, click
File
>Open notebook...
. -
In the "Open notebook" window, click the "GitHub" option:
-
Paste the URL of this repository into the search bar and press
Enter
. -
After pressing
Enter
, a list of notebooks in the repository should appear. Click onmapreader-spatial-humanities-workshop.ipynb
to open it. -
The notebook should now be opened and look like this:
Note that Google may display a warning that the notebook is not authored by Google. You can ignore this warning.
-
You can now run the notebook by clicking the play button on the left of each cell.
Note that the first cell will install all requirements for the notebook to run. It will take some time, and will display some warnings. Those can be ignored. At the bottom, you will see a message that the installation was successful.
By default, Google Colab uses a CPU runtime. If you want to use a GPU runtime, you can change this by clicking Runtime
> Change runtime type
and selecting GPU
from the Hardware accelerator
dropdown.
-
Click
Runtime
>Change runtime type
. -
In the "Change runtime type" window, select
GPU
from theHardware accelerator
dropdown. ClickSave
to apply the changes.After you save the changes, the runtime will be changed to GPU and the core needs to be restarted. Click
OK
to restart the runtime. -
The runtime type should now be changed to GPU.
Clone the repository and navigate to the root directory of the repository.
git clone https://github.com/maps-as-data/spatial-humanities-mapreader-workshop
cd spatial-humanities-mapreader-workshop
To create the Docker image, run the following command:
docker build -t mapreader-workshop .
To run the Docker container, run the following command:
docker run -p 8888:8888 --mount source=workshop_outputs,target=/app mapreader-workshop
Click the link that appears in the terminal to open the notebook in your browser.
To run the notebook locally, follow the instructions here to set up your MapReader python environment.
You can then install the required packages for this notebook by running:
pip install -r requirements.txt
You can then run the notebook by running:
jupyter notebook mapreader-spatial-humanities-workshop.ipynb