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:
Start from a miniconda parent image.
Create a new conda environment named
a4-env
using anenvironment.yml
file and install the following packages along with Python version3.12.5
:numpy=1.26.4
,scipy=1.13.1
,matplotlib=3.9.2
, andjupyterlab=4.2.5
.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)
Create a Jupyter notebook.
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.5Generate array
y
that is thecosine
ofx
Generate array
z
that is thesine
ofx
Create a new plot with the following:
Plot both
z
andy
vsx
on the same axisAdd a legend to the plot to name
z
andy
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.