Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit...

48
Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH [email protected] @dyjh

Transcript of Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit...

Page 1: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Wissenschaftliches Publizieren mit Python

Pycon DE 2013, Köln

Yves HilpischContinuum Analytics Europe GmbH

[email protected]@dyjh

Page 2: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Agenda

• Fortschritt und Sprache

• Python Ecosystem

• Python Tools

• Case Study

• Open, Collaborative Research

Page 3: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Fortschritt und Sprache

Page 4: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Fortschritt im Allgemeinen

• Effizienz: Etwas Gegebenes besser machen100m schneller laufen.

• Effektivität: Mehr machen mit dem Gegebenen

Den Speer weiter werfen.

• Qualität: Neues machen, schaffenAlleine um die Welt segeln

(1895–1898 Joshua Slocum, erste Alleinumseglung der Erde.)

Page 5: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Wissenschaftlicher Fortschritt

„Scientific progress is the idea that science increases its problem-solving ability through the application of the scientific method.“

http://en.wikipedia.org/wiki/Scientific_progress

Page 6: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Wissenschaftliche Methode

„The scientific method is a body of techniques [and tools] for investigating phenomena, acquiring new knowledge, or correcting and integrating previous knowledge.To be termed scientific, a method of inquiry must be based on empirical and measurable evidence subject to specific principles of reasoning.“

http://en.wikipedia.org/wiki/Scientific_method

Page 7: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Die Rolle der Sprache

"It is argued that language plays an active role in the development of scientific ideas. ...

And is mathematics somehow more or less than a language? ...

A particular characteristic of mathematics which appears in one aspect to differentiate it from language is its appeal to visual thinking."

Alan Ford and F. David Peat (1988): "The Role of Language in Science."

Page 8: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sprachen in der Wissenschaft

• Englisch - geschriebene/gesprochene Sprache

• Mathematik - Symbolsprache, Logik

• Code - „Pseudo-Code“, ComputerspracheCode + Struktur + Highlighting/Coloring

Page 9: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Python Ecosystem

Page 10: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Python Ecosystem

• Python: Basissystem bzw. Interpreter

• Scientific Stack: NumPy, SciPy, pandas, Cython, matplotlib, scikit-learn

• Tools: IPython, Spyder, Sphinx, Latex

Page 11: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Python spielt vierfache Rolle

• Python: Programmiersprache zur Erarbeitung von Forschungsergebnissen

• Kommunikation: Python zur Kommunikation von z.B. Algorithmen

• Dokumentation: Python zur Dokumentation von Algorithmen und Dartstellung von Ergebnissen

• Publikation: Tools zur Publikation

Page 12: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Python Tools

Page 13: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Python Tools

• Spyder: Integrierte Entwicklungsumgebung

• IPython: Pythons Killer App, insbesondere die Notebook Variante

• Sphinx: Dokumentationsumgebung und flexibles Autorensystem

• PythonTEX: Python für den Latex-Compiler

Page 14: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Spyder

• Code Editor mit Highlighting

• Code Checking, z.B. für PEP8

• Debugging

• Object und Variable Inspector

• Python CLI

• IPython Integration

Page 15: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Spyder

Page 16: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython

• Interaktive Python Shell

• Vielzahl von „%magic“ Funktionen

• Command Line Historie

• Shell, QT version und Notebook (Browser)

• Parallele Programmausführung (ipcluster)

• viele Konvertierungsmöglichkeiten

Page 17: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython Shell

Page 18: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython QT Console

Page 19: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython Notebook

Page 20: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx

• Umgebung zur Dokumentation von Python-Projekten und vielem mehr ...

• Syntax basiert i.W. auf reStructuredText (.rst)

• Source Code comilierbar in verschiedene Formate (HTML, Latex/PDF)

• Gute Erweiterbarkeit (extensions) und Anpassbarkeit (CSS)

• Integration mit IPython (über extension)

Page 21: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

PythonTEX ­ Source Code

Page 22: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

PythonTEX ­ Output

Page 23: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

PythonTEX ­ Output

Page 24: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Case Study

Page 25: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Case Study

Einfaches Beispiel aus dem Finanzbereich, das

• Text

• Struktur

• Code

• Graphiken

• Formeln

aufweist.

Page 26: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython Notebook Umsetzung

Page 27: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Das IPython Notebook (ipynb)

Page 28: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython Notebook Markdown

Page 29: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython HTML output im Browser

Page 30: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython HTML5 Slides (mit reveal.js)

Page 31: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

IPython Latex und PDF Output

Page 32: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Umsetzung

Page 33: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Source Code

Page 34: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Source Code (Analytics)

Page 35: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Source Code (Graphics)

Page 36: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx HTML Output

Page 37: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Customized HTML Site

Page 38: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Sphinx Latex und PDF Output

Page 39: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Open, Collaborative Research

Page 40: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Open Research in Physik mit IPython

Page 41: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Das Forschungspapier auf arxiv.orghttp://arxiv.org/abs/1303.2690

Page 42: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Das Github Repository

https://github.com/forero/LG_Kinematics

Page 43: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Das IPython Notebook

Page 44: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Collaborative Research mit Wakari.io

Page 45: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Wakari.io

Wakari ist eine vollständige Python Umgebung

• Linux Server inkl. Shell & File Manager

• Cloud- & Browser-basiert

• Python, Anaconda, IPython

• Packaging & Sharing von IPython Notebooks

• Skalierbar (Zuschalten von Nodes)

• Wakari Enterprise ab November 2013

Page 46: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Wakari.io als Python Umgebung

Page 47: Wissenschaftliches Publizieren mit Python · 2013. 10. 15. · Wissenschaftliches Publizieren mit Python Pycon DE 2013, Köln Yves Hilpisch Continuum Analytics Europe GmbH yves@continuum.io

Teilen von ganzen IPYNB Projekten