Course Style Guide#
Following a style guide is a common requirement in companies to make it so that code written by different people stays easy to read for everyone. Consistent style also makes it easier to onboard new developers join a project and contribute faster.
The following style guide serves as practice for you following a style guide, makes your work easier to read for grading purposes, and holds you accountable to learning deeply and demonstrating that you have learned well.
Hard Requirements#
Warning
All work must adhere to these requirements or it may receive no feedback or credit. Minor misses may receive warnings, but if submitted work does not appear to represent a good faith effort at adhering to this style guide, the only comment will be, “Follow the style guide on the next assignment”
All code must be submitted in a notebook file (.ipynb or myst)
Code must run or have explicit questions and comments about what was done about the errors
Python comments (
# comment text
) inside code cells should only be used to explain complex code that is not explained in the course notes. Using such code requires a citation for the source.Each code cell should represent at most one conceptually complete step in terms of the analysis.
Every code cell must be motivated by text in markdown before it
Every code cell’s output must be interpretted
the
print
function can only be used when it improves the readability over using jupyter’s display, must be justifiedNo deprecated or dangerous code constructs without justification
All assignment questions must be answered in markdown cells
Notebook files may not have extraneous metadata in them
Additional Style#
Important
Mistakes on these will get detailed feedback once and a “see previous feedback” a second time before the whole assignment receives no feedback.
Code should ahdere to PEP8
Markdown syntax should be used to enhance the readability of the text (eg not all headings, bullets where they make sense)
Best practices that are highlighted in class should be followed (this list will expand over the semester)