Assignment 4#

Due: Wednesday Oct 9th at 11:59 pm ET

The goal of this assignment is to work with Conda, Docker and JupyterLab.

You should submit this assignment to your existing geog213-assignments or geog313-assignments GitHub repository under a new directory named assignment-4.

Create a Dockerized Conda Environment#

In this part, you will develop a Dockerfile that creates a conda environment using an environment.yml file. Your Dockerfile should:

  1. Start from a miniconda parent image.

  2. Create a new conda environment named a4-env using an environment.yml file and install the following packages along with Python version 3.12.5: numpy=1.26.4, scipy=1.13.1, matplotlib=3.9.2, and jupyterlab=4.2.5.

  3. Activate the a4-env, and launch JupyterLab from /home/assignment/ when the container is run.

Make a new commit, and push this part of the assignment to your GitHub repository.

Create a Notebook#

In this part, you will create a Jupyter notebook that visualizes some data. Your Jupyter notebook should run inside a container based on the Dockerfile from the previous section (the notebook should be accessed using the mount option, and should not be included in the Docker image)

  1. Create a Jupyter notebook.

  2. Write appropriate code in this notebook to do the following:

  • Generate array x that contains a sequence of numbers from -100 to 100 (inclusive) with steps of 0.5

  • Generate array y that is the cosine of x

  • Generate array z that is the sine of x

  1. Create a new plot with the following:

  • Plot both z and y vs x on the same axis

  • Add a legend to the plot to name z and y

  • Add appropriate x- and y-axes labels

Make a new commit, and push this part of the assignment to your GitHub repository. Make sure you run all cells in your notebook, and save it before committing it so that the plot is included in your commit and its rendered on GitHub.

Documentation#

Finally, create a README.md file inside the assignment-4 directory that provides a step-by-step guide on how to run a container using your Dockerfile and execute the notebook you created. Commit and push this file to GitHub.