Workspace Setup¶
We suggest two options for setting up the course workspace.
Online IDE¶
MiniTorch can be run entirely on an online IDE for simplicity. Each module is configured to work directly with the Repl.it environment which you can setup through the Github page. You will need to signup for a Repl.it account and create an environment repo through the link. Dependencies and the environment should be setup automatically. Tests will run with the play button.
For training and visualization, you may need to run the following command.
>>> pip install -U -r requirements.extra.txt
Make sure that everything is installed by running python and then checking:
>>> import minitorch
Standard Setup¶
Alternatively, you can set things up in a standard Python environment.
MiniTorch requires Python 3.6 or higher. Please follow directions online to help get this set up, as it will vary depending on your system. To check your version of Python, run either:
>>> python --version
>>> python3 --version
We recommend creating a global MiniTorch workspace directory that you will use for all modules.
>>> mkdir workspace; cd workspace
We also highly recommand seting up a virtual environment. The virtual environment lets you install packages that are only used for your assignments and do not impact the rest of the system. We suggest venv or anaconda.
For example, if you choose venv, run the following command:
>>> python -m venv venv
>>> source venv/bin/activate
The first line should be run only once, whereas the second needs to be run whenever you open a new terminal to get started for the class. You can tell if the second line works by checking if your terminal starts with (venv). (See https://docs.python.org/3/library/venv.html for further instructions on how this works.)
Each assignment is distributed through a Git repo. We assume the knowledge of git throughout the course. (See https://guides.github.com for a tutorial about using git and GitHub.)
You should fork the template of the assignment and then edit yours in your forked repo. Once you have forked the template code, you can clone your own version by running the following command:
>>> git clone {{STUDENT_ASSIGNMENT_URL}}
>>> cd {{STUDENT_ASSIGNMENT_NAME}}
The last step is to install packages. There are several packages used throughout these assignments, and you can install them in your virtual enviroment by running:
>>> python -m pip install -r requirements.txt
>>> python -m pip install -r requirements.extra.txt
>>> python -m pip install -Ue .
Ignore errors on pytest-astropy if shown when installing packages from requirements.txt.
For anaconda users, you need to run an extra command to install llvmlite:
>>> conda install llvmlite
Make sure that everything is installed by running python and then checking:
>>> import minitorch