Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A pythonic interface for the ROOT libraries on top of the PyROOT bindings.
tree: b69c2a081a

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
benchmarks/tree
bugs/csv
devscripts
docs
examples
logo
rootpy
scripts
tabulartext
.gitignore
.gitmodules
LICENSE
MANIFEST.in
README
README.DEVELOPERS
README.rst
distribute_setup.py
optional-requirements.txt
roosh-requirements.txt
setup.py

README.rst

rootpy

Documentation is hosted here: rootpy.org and mirrored here: rootpy.github.com/rootpy.

About

rootpy provides a more feature-rich and pythonic interface with the ROOT libraries on top of the existing PyROOT bindings.

More specifically, rootpy provides:

  • easier manipulation of trees, histograms, graphs, cuts, and TVector/TLorentzVectors. rootpy provides classes that inherit from these ROOT classes and implement the Python arithmetic operators.
  • an easy way to create and read ROOT TTrees and a mechanism for defining objects and collections of objects whose attributes are TTree branches. You may also decorate TTree objects with additional methods and attributes. See examples/tree.
  • easy navigation through TFiles. rootpy wraps TFile and implements the natural naming convention so that objects may be retrieved with myFile.someDirectory.treeName, for example.
  • an interface between ROOT and matplotlib. Don't like the way your plots look in ROOT? Simply use rootpy to plot your ROOT histograms or graphs with matplotlib instead.
  • conversion of ROOT TFiles containing TTrees into HDF5 format with PyTables.
  • conversion of TTrees into NumPy ndarrays and recarrays. Now take advantage of the many statistical and numerical packages that Python offers (NumPy, SciPy, StatsModels, use scikit-learn for machine learning instead of TMVA).
  • a framework for parallelizing processes that run over many TTrees.
  • roosh, a Bash-like shell environment for the ROOT TFile.
  • a collection of useful command line scripts: root-ls, root-cp, root-tree-ls, and others.

Have Questions or Found a Bug?

Post your questions on stackoverflow.com and use the tag rootpy (this tag does not exist yet, but if you have a reputation of at least 1500 then please created it).

Think you found a bug? Open a new issue here: github.com/rootpy/rootpy/issues.

Also feel free to post questions or follow discussion on the developers (rootpy-dev@googlegroups.com) or users (rootpy-users@googlegroups.com) lists.

Requirements

At least Python 2.6 and ROOT with PyROOT enabled are required. matplotlib, NumPy, PyTables, and PyYAML are optional.

Compatibility

TBA

Getting the Latest Source

Clone the repository with git:

git clone git://github.com/rootpy/rootpy.git

then clone any submodules:

cd rootpy
git submodule init
git submodule update

or checkout with svn:

svn checkout http://svn.github.com/rootpy/rootpy

Note: svn does not checkout git submodules so you will end up with an incomplete rootpy.

Still using svn? Watch this.

Manual Installation

If you have obtained a copy of rootpy yourself use the setup.py script to install.

To install in your home directory:

python setup.py install --user

To install system-wide (requires root privileges):

sudo python setup.py install

To install optional requirements (matplotlib, NumPy, etc.):

pip install -U -r optional-requirements.txt

To install roosh requirements:

pip install -U -r roosh-requirements.txt

To disable building the extension modules, do this before installing:

export ROOTPY_NO_EXT=1

Automatic Installation

The easiest way to install a released version of rootpy is with pip.

To install in your home directory:

pip install --user rootpy

To install system-wide (requires root privileges):

sudo pip install rootpy

Post-Installation

If you installed rootpy into your home directory with the --user option above, add ${HOME}/.local/bin to your ${PATH} if it is not there already (put this in your .bashrc):

export PATH=${HOME}/.local/bin${PATH:+:$PATH}

Examples

see examples/*

Developers Wanted

Please post on the rootpy-dev@googlegroups.com list if you have ideas or contributions. Feel free to fork rootpy on GitHub and later submit a pull request.

rootpy needs attention in these areas:

  • Documentation
  • Tutorials
  • A website displaying the above (currently under construction here: http://rootpy.github.com/rootpy)
  • Unit testing
  • Brenchmarking performance (i.e. Tree read/write)
  • Finishing the server/worker code for distributed computing across multiple nodes
  • Creation of a TBrowser alternative using PyGTK
  • Creation of a framework for managing datasets (using SQLite as a back-end? with revision control?)
  • Additional features anyone would like to implement
Something went wrong with that request. Please try again.