π» Work environment and submission workflow
Class 2 β Thursday, August 27
In addition to theory π this course has a strong βοΈ practical component, with hands-on exercises and a semester-long project. To follow the course effectively you need a local development environment to interact with the course materials, and to write and run code.
This class also sets up the workflow you will use to submit every homework: a pull request to the course repository.
PrerequisitesΒΆ
You have a fairly modern computer: desktop or laptop, Windows or Mac or Linux
You have administrative access to this computer (can install programs)
Python and AnacondaΒΆ
The Anaconda distribution is an easy way to install:
Python
Jupyter Notebook
Scientific programming libraries
The course uses numpy, scipy, matplotlib and sympy. All of these ship with
Anaconda; no other frameworks are required.
Git and Git GUIΒΆ
Git is the command line version control software
A GUI makes Git a lot more practical
Recommended options:
VS Code editor (has Git built in)
GitHubΒΆ
Social coding network website
hosting code
version control and integrations
community of coders and open source projects
free hosting for static web pages β this book is one
Register on GitHub if you have not yet
be mindful about using your personal data when registering
Course materials and all homework are distributed and collected through the course GitHub repository
Text editorΒΆ
A good text editor is invaluable for editing source files
Editing could be done in Jupyter or other default editors, but it is less convenient
Essential for bigger coding projects β such as your course project
Good options are:
Sublime Text (paid)
PyCharm (full IDE)
Jupyter notebooksΒΆ
An excellent way to present and discuss code
this entire course is taught using notebooks
A good instrument to develop new ideas
especially together with coauthors
Saved to disk as JSON files with multiple sections
text
math and formulas in LaTeX
code (different languages are possible)
output from the code
Jupyter notebooks have limitations
NOT a good way to store developed code β use libraries (modules)
NOT good for version control
changes in metadata are tracked
changes in output are tracked
merging changed files may break the JSON format
Require additional tools to work well with Git
We donβt worry about this for most of the course, but you should for your project
Homework submission workflowΒΆ
Every homework in this course is submitted as a pull request to the course repository. The mechanics are the same every time:
Fork the course repository to your own GitHub account (once, at the start of the semester)
Clone your fork to your machine
git clone <address copied from the GitHub page>Branch for each assignment:
git checkout -b hw1-yournameWork in your own folder β
submissions/yourname/hw1/β so that submissions never collide with each otherCommit with a meaningful message:
git add . && git commit -m "HW1: inventory model solver"Push the branch to your fork:
git push origin hw1-yournameOpen a pull request against the course repository before the deadline
Homework is discussed at the start of the class that follows it, with one student presenting the solution at the board. The presenter rotates, so plan on presenting several times over the semester β including code that does not work yet, which is usually the more instructive case.