Skip to content

Commit 1767f67

Browse files
Merge pull request #9 from eduardo-rodrigues/master
Added section for particle physics packages. Also miscellaneous info.
2 parents bbbbba0 + b2716dd commit 1767f67

File tree

1 file changed

+37
-23
lines changed

1 file changed

+37
-23
lines changed

README.md

+37-23
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
[![Join the chat at https://gitter.im/HSF/PyHEP](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/HSF/PyHEP?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![DOI](https://zenodo.org/badge/144829348.svg)](https://zenodo.org/badge/latestdoi/144829348)
55

6-
Python libraries of interest to particle physicists. This is meant to be a living document. Therefore, if you have suggestions, click the edit button then make a pull request with your proposed change.
6+
Python libraries of interest to particle physicists. This is meant to be a living document. Therefore, if you have suggestions, click the edit button then make a pull request with your proposed change(s).
7+
8+
You are more than welcome to join the [HSF/PyHEP Gitter channel](https://gitter.im/HSF/PyHEP) and contribute to the informal discussions there.
79

810
## New to Python
911

1012
If you are new to Python, the following contains general information on using Python in Science.
1113

12-
| Name | Use |
14+
| Name | Use |
1315
| ------------ | --------------- |
1416
| [Software Carpentry Python Lesson ](http://swcarpentry.github.io/python-novice-inflammation/) | Lesson aimed at people who have never used Python before. |
1517
| [Scipy tutorials](https://scipy2017.scipy.org/ehome/220975/493423/) | You'll want the beginner courses, the intermediate/advanced courses are actually quite advanced. Setup instructions are linked on the page, videos are [here](https://www.youtube.com/playlist?list=PLYx7XA2nY5GfdAFycPLBdUDOUtdQIVoMf) |
16-
| [Dive into Python 3](http://www.diveintopython3.net/index.html) | Very useful for learning python, though it's a bit old and doesn't cover any of the scientific python stuff you really need. |
18+
| [Dive into Python 3](http://www.diveintopython3.net/index.html) | Very useful for learning python, though it's a bit old and doesn't cover any of the scientific python stuff you really need. |
1719
| [Code academy](https://www.codecademy.com/learn/python) | |
1820
| Many EdX and Coursera courses | Often introductory CS courses which can teach other useful skills (algorithms and datastructures) |
1921
| [The python docs](https://docs.python.org/3/) | |
@@ -35,43 +37,56 @@ Some more advanced talks of interested:
3537

3638
## Getting Python
3739

38-
| Name | Use |
40+
| Name | Use |
3941
| ------------ | --------------- |
4042
| [Anaconda Package Manager](https://conda.io/docs/user-guide/getting-started.html) | Anaconda packages most scientific Python libraries while also living purely in user space. Therefore, you don't need special permissions to setup. |
41-
| [pipenv](https://pipenv.readthedocs.io/en/latest/) | Official Python way |
43+
| [pipenv](https://pipenv.readthedocs.io/en/latest/) | Official Python way. |
4244
| [ripa](https://github.com/tunnell/ripa) | ripa solves the packaging issue by letting you install packages (or requirements.txt) where priority given to conda channels, otherwise fetches from PyPI. (Works but rough) |
4345

4446

4547
## Scientific Python Stack
4648

4749
The packages that are used in Physics and/or data science within Python grew somewhat organically before forming the current ecosystem. Detailed information on what exists can be found [here](https://scipy.org/about.html), but we will summarize here.
4850

49-
| Name | Use |
51+
| Name | Use |
5052
| ------------ | --------------- |
5153
| [jupyter notebook](https://jupyter.org) | Main one way of doing interactive and/or exploratory analysis. |
52-
| [numpy](http://www.numpy.org) | Array and matrix operations (including math operations) at C speeds. |
54+
| [numpy](http://www.numpy.org) | Array and matrix operations (including math operations) at C speeds. |
5355
| [pandas](https://pandas.pydata.org) | A very elegant way to work with tabular data (i.e. ntuples) with in memory calculations. Especially good at time series. |
54-
[xarray](http://xarray.pydata.org/en/stable/why-xarray.html#core-data-structures) | Extension of pandas to N-Dim structures |
55-
| [h5py](http://www.h5py.org/) | Simple numpy to HDF5 bindings (backend for Keras saved models) |
56+
[xarray](http://xarray.pydata.org/en/stable/why-xarray.html#core-data-structures) | Extension of pandas to N-Dim structures. |
57+
| [h5py](http://www.h5py.org/) | Simple numpy to HDF5 bindings (backend for Keras saved models). |
5658
| [scipy](https://www.scipy.org) | Various scientific routines like minimization. |
5759
| [matplotlib](https://matplotlib.org) | Main Python plotting library. Start from [matplotlib gallery](https://matplotlib.org/gallery.html) then adapt to your application. |
5860
| [scikit-learn](http://scikit-learn.org/stable/index.html) | Very easy to use machine learning routines with great examples. |
5961

62+
Visualisation:
63+
64+
| Name | Use |
65+
| ------------ | --------------- |
66+
| [matplotlib](https://matplotlib.org) | Main Python plotting library. Start from [matplotlib gallery](https://matplotlib.org/gallery.html) then adapt to your application. |
67+
| [seaborn](https://seaborn.pydata.org) | Easier to use plotting library with some statistical routines. Builds on matplotlib, but annoying to customize. |
68+
| [vegascope](https://github.com/scikit-hep/vegascope) | View Vega/Vega-Lite plots in your web browser from local or remote Python processes. |
69+
6070
Notable mentions:
6171

62-
| Name | Use |
72+
| Name | Use |
6373
| ------------ | --------------- |
64-
| [seaborn](https://seaborn.pydata.org) | Easier to use plotting library with some statistical routines, builds on matplotlib, but annoying to customize. |
6574
| [tensorflow](http://scikit-learn.org/stable/index.html) | For deep neural networks. |
66-
| [pytorch](https://pytorch.org) | deep learning framework for fast, flexible experimentation with dynamic computational graphs |
67-
| [keras](https://keras.io) | Higher level neural network interfaces |
75+
| [pytorch](https://pytorch.org) | deep learning framework for fast, flexible experimentation with dynamic computational graphs. |
76+
| [keras](https://keras.io) | Higher level neural network interfaces. |
6877

6978
General information through talks tthat maybe useful on PyData (various conferences each year):
7079
* https://www.youtube.com/user/PyDataTV and other per-conference channels
7180
* Scipy conferences, e.g. https://www.youtube.com/playlist?list=PLYx7XA2nY5Gf37zYZMw6OqGFRPjB1jCy6
7281
* Enthought: https://www.youtube.com/user/EnthoughtMedia
7382
* Continuum Analytics: https://www.youtube.com/channel/UCND4vKhJssAtK8p1Blfj14Q
7483

84+
## Particle Physics packages
85+
| Name | Use |
86+
| ------------ | --------------- |
87+
| [numpythia](https://github.com/scikit-hep/numpythia) | Interface between FastJet and NumPy. |
88+
| [pyjet](https://github.com/scikit-hep/pyjet) | Interface between PYTHIA and NumPy. |
89+
7590
## Jupyter extensions
7691

7792
Jupyter has a wide ecosystem of extensions that can be used to extend the functionality. Some useful extensions for HEP data analysis are summarised here.
@@ -85,31 +100,31 @@ Jupyter has a wide ecosystem of extensions that can be used to extend the functi
85100

86101
See tutorials here and other resources collected by [IML HEP-ML Resources](https://github.com/iml-wg/HEP-ML-Resources#tutorials)
87102

88-
## ROOT
103+
## ROOT and interoperability with ROOT
89104

90105
For many particle physics experiments, a lot of data is stored within ROOT files. This means at very least one must have the ability to read ROOT files. ROOT also serves as a tool suite designed to solve many computational problems encountered in HEP, which means that one may want to access some of this tool suite. The following packages below are worth knowing for these situations:
91106

92107
| Package name | Use | Pro | Con | Further information |
93108
| ------------ | --- | --- | --- | ------------------- |
94-
| [uproot](https://github.com/scikit-hep/uproot) | Native Python ROOT I/O | Easy to install, fast, no dependence on C++ ROOT | Although can read all ROOT files, can only write ROOT files with specific objects | |
109+
| [uproot](https://github.com/scikit-hep/uproot) | Native Python ROOT I/O | Easy to install, fast, no dependence on C++ ROOT | Although can read all ROOT files, can only write ROOT files with specific objects. | |
95110
| root_numpy, root_pandas | ROOT to/from Numpy and Pandas, like uproot | full ROOT functionality, like TFormula | slower than uproot, binary incompatibilities with different versions of ROOT | |
96-
| [ROOT conda](https://nlesc.gitbooks.io/cern-root-conda-recipes/content/installing_root_via_anaconda.html) | Using ROOT within Anaconda | Easy to get ROOT installed with PyROOT support | Not all features of ROOT and getting dated (6.04 Py2.7/3.4 since XENON1T uses that) | [Recipes](https://github.com/NLeSC/root-conda-recipes) |
97-
| [PyROOT](https://root.cern.ch/pyroot) | Official ROOT Python bindings | Good support and many examples | Raw C++ wrapping results in weird Python code | |
98-
| [rootpy](http://www.rootpy.org) | Pythonic ROOT access | More logical for people who know Python | Smaller user base than PyROOT, abandoned? | [Repository](https://github.com/rootpy/rootpy/) |
99-
| [alphatwirl](https://github.com/alphatwirl/alphatwirl) | Summerizing ROOT data into categorical data as Pandas' data frames | Small output size. Easy one-function interface with [qtwirl](https://github.com/alphatwirl/qtwirl) | Not for data type conversion | [Repository](https://github.com/alphatwirl/alphatwirl) |
111+
| [ROOT conda](https://nlesc.gitbooks.io/cern-root-conda-recipes/content/installing_root_via_anaconda.html) | Using ROOT within Anaconda | Easy to get ROOT installed with PyROOT support | Not all features of ROOT and getting dated (6.04 Py2.7/3.4 since XENON1T uses that) | [Recipes](https://github.com/NLeSC/root-conda-recipes) |
112+
| [PyROOT](https://root.cern.ch/pyroot) | Official ROOT Python bindings | Good support and many examples | Raw C++ wrapping results in weird Python code | |
113+
| [rootpy](http://www.rootpy.org) | Pythonic ROOT access | More logical for people who know Python | Smaller user base than PyROOT, abandoned? | [Repository](https://github.com/rootpy/rootpy/) |
114+
| [alphatwirl](https://github.com/alphatwirl/alphatwirl) | Summerizing ROOT data into categorical data as Pandas' data frames | Small output size. Easy one-function interface with [qtwirl](https://github.com/alphatwirl/qtwirl) | Not for data type conversion | [Repository](https://github.com/alphatwirl/alphatwirl) |
100115
| [pyhf](https://github.com/diana-hep/pyhf) | statistical analysis / fitting | pure python implementation of HistFactory specification with auto-diff enabled backends in tensorflow, pytorch, and MXNet | not yet interoperable with ROOT-based RooFit models | [pyhf](https://github.com/diana-hep/pyhf) |
101116

102117

103118
## Speeding up code
104119

105120
Often, it is not needed anymore to write C++/C routines that get wrapped since there are other ways to speed up your Python code. Namely:
106121

107-
| Name | Use |
122+
| Name | Use |
108123
| ------------ | --------------- |
109124
| [numba](https://numba.pydata.org) | Tight loops are often the slow part of Python code, where this compiles them! |
110125
| Pythran | whole scripts |
111-
| [numpy](http://www.numpy.org) | Expressing your code as array options means you get native-C speeds. |
112-
| NumExpr | single pass "mapper" operations (one input one output |
126+
| [numpy](http://www.numpy.org) | Expressing your code as array options means you get native-C speeds. |
127+
| NumExpr | single pass "mapper" operations (one input → one output). |
113128

114129
## Binding C/C++ to Python
115130

@@ -136,4 +151,3 @@ Stealing code from other physicists is its own sign of flattery. Codes that are
136151

137152
| Name | Collaboration | Use | Further information | Date added to list |
138153
| ----- | ---------- | --- | ------------------- | --------------------- |
139-

0 commit comments

Comments
 (0)