{"id":447,"date":"2015-06-02T12:15:20","date_gmt":"2015-06-02T12:15:20","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=447"},"modified":"2015-08-05T02:47:05","modified_gmt":"2015-08-05T02:47:05","slug":"literate-programming-with-ipython-notebooks","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2015\/06\/02\/literate-programming-with-ipython-notebooks\/","title":{"rendered":"Literate programming with IPython notebooks"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www-cs-faculty.stanford.edu\/~uno\/don.gif\" alt=\"Donald Knuth\" title=\"Donald E. Knuth\" \/><a href=\"http:\/\/en.wikipedia.org\/wiki\/Literate_programming\">Literate programming<\/a> is a concept promoted by Donald Knuth, the famous computer scientist (and the author of the <em>Art of Computer Programming<\/em>.) According to this concept, computer programs should be written in a combination of the programming language (the usual source code) and the natural language, which explains the logic of the program.<\/p>\n<p>When it comes to scientific programming, using comments for natural-language explanations is not always convenient. Moreover, it is limited, because such explanations may require figures, equations, and other common elements of scientific texts. IPython\/Jupyter notebooks provide a convenient tool for combining different text elements with code. See the notebook at <a href=\"https:\/\/github.com\/sfomel\/ipython\/blob\/master\/LiterateProgramming.ipynb\">https:\/\/github.com\/sfomel\/ipython\/blob\/master\/LiterateProgramming.ipynb<\/a> for an example on how to implement literate programming using an IPython notebook with reproducible SConstruct data-analysis workflows in Madagascar.<\/p>\n<p>Related posts:<br \/>\n* <a href=\"\/blog\/2014\/07\/10\/madagascar-in-the-cloud\/\">Madagascar in the cloud<\/a><br \/>\n* <a href=\"\/blog\/2013\/08\/06\/reproducible-research-and-ipython-notebooks\/\">Reproducible research and IPython notebooks<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Literate programming is a concept promoted by Donald Knuth, the famous computer scientist (and the author of the Art of Computer Programming.) According to this concept, computer programs should be written in a combination of the programming language (the usual source code) and the natural language, which explains the logic of the program. When it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"local","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-447","post","type-post","status-publish","format-standard","hentry","category-systems"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":4,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"predecessor-version":[{"id":930,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/447\/revisions\/930"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}