{ "cells": [ { "cell_type": "markdown", "metadata": { "toc": true }, "source": [ "
Yesterday:\n", "
In this lecture:\n", "
Next Week:\n", "
@James Percival
in #General & #Random, or DM me.pip
or conda
to install sphinx
on your computer. docs
directory inside your module and add conf.py
and index.rst
files based on the ones given above.sphinx-build
to generate html
documentation for your project.index.rst
file to add more text.Create your own venv
environment, giving it a name of your choice. Activate it. Note the difference it makes to your command prompt.
Double check the linstalled package list using pip list
. Install a package into the virtual environment (such as matplotlib
) using pip
. Check that the list of installed packages inside the environment changes.
Install the package you wrote into your virtual environment.
\n", "\n", "Try and write your own attempt at TTD for the following problems:\n", "\n", "
Write an implementation of a [fizz buzz](https://en.wikipedia.org/wiki/Fizz_buzz) function. This is a children's game, where players count around a circle in order. \n", "
Your function should accept an integer, x, and return either x, 'fizz'
, 'buzz'
or 'fizz buzz'
according to the rules above.
numpy
array, $X$, into order of size.\n",
" Y[i,...]<[j,...]
for all i<j
.Y[k,i..]<[k,j,..]
for all i<j
and fixed k [[..[x_1, .., x_n], [x_n+1, .., x_2n], .., x_N]]
x_n< x_n+i
for all i>0
.Write a function to accept or reject a string as a candidate for a password based on the following criteria:\n", "
@<>!
Remember, you should come up with a test first, then write only enough new code to satisfy it, and fix your previous tests, before moving on to another test. Once the test passes, remember to have a look at your code to see if anything needs to be refactored.
\n", "\n", "The goal here is to concentrate on the TDD process, but for completeness, [model answers](https://msc-acse.github/ACSE-1/lectures/lecture10-solutions.html) are available.
\n", " \n", "Write some tests using the doctest module inside your own module or script.
\n", "\n", "You can use some of the modules you wrote earlier in the week, or else write some new code.
\n", "\n", "pytest
and run the tests..py
files..travis.yml
file.