DavidLeoni / algolab

OLD Algorithms Lab of Scientific Programming course (QCB master, CIBIO, University of Trento)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source code as Jupyter Python worksheets for algorithms lab of Scientific Programming course (QCB master, University of Trento)

Website: http://davidleoni.github.io/algolab

DISCLAIMER: With these worksheets, we pushed the limits of Jupyter, sometimes abusing its functionality to the point of making ugly workarounds when necessary. So code may or may not work depending on your particular version of Jupyter.

Features

  • Generates a (sort of) real website, with sidebar and rudimental navigation bar
  • Presentation friendly: when the browser window is small, the sidebar disappers. To show it again, hover mouse on the left.
  • Automaticalaly generates crude PDFs.
  • Allow easy running of unittest tests in the worksheets
  • Customizable with python, JS, and CSS code common to all worksheets

Installation instructions

  1. Install Python 2.7
  2. Install NetworkX modules:

On Ubuntu:

sudo pip install networkx
sudo pip install nxpd

Install graphviz:

sudo apt-get install graphviz
  1. Install Jupyter
  2. If you also want to build the pdfs, install the program WkHtmlToPdf, at version >= 0.12.4 . In particular, to install it in Ubuntu, run
        sudo apt-get install wkhtmltopdf

Building

To build the website, while in the console, from the root of the directory run

python build.py

Site will be created in target/ folder.

NOTE: to also generate PDFs you will need to install WkHtmlToPdf (See point 3 in previous paragraph The worksheets are meant to create a website and to be browsed online, so generated PDFs won't look that pretty.

Editing the worksheets

First of all, run Jupyter from the root of the directory

    jupyter notebook

Each worksheet must start with this Python code:

import algolab
algolab.init()

Running it will create the sidebar even when editing in Jupyter. If you want to refresh the sidebar, just run again the cell.

Launch unit tests

Inside worksheets you can run unittest tests.

To run all the tests of a test class, write like this

algolab.run(NameOfTheTestClass)

To run a single method, write like this:

algolab.run(NameOfTheTestClass.nameOfTheMethod)

About

OLD Algorithms Lab of Scientific Programming course (QCB master, CIBIO, University of Trento)

License:Other


Languages

Language:Jupyter Notebook 59.6%Language:Python 37.7%Language:JavaScript 2.4%Language:CSS 0.2%