Giter Site home page Giter Site logo

wiso / rootpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rootpy/rootpy

1.0 3.0 0.0 8.08 MB

A feature-rich pythonic interface with the ROOT libraries on top of the PyROOT bindings.

Home Page: rootpy.org

License: GNU General Public License v3.0

Python 99.69% Shell 0.30% C++ 0.01%

rootpy's Introduction

https://travis-ci.org/rootpy/rootpy.png

rootpy: Pythonic ROOT

Python has become the language of choice for high-level applications where fast prototyping and efficient development are important, while glueing together low-level libraries for performance-critical tasks. The PyROOT bindings introduced ROOT into the Python arena, however, interacting with ROOT in Python should not "feel" like you are writing C++. Python also offers a multitude of powerful packages such as SciPy, NumPy, IPython, matplotlib, and PyTables, but a suitable interface between them and ROOT has been lacking.

The rootpy project is a community-driven initiative aiming to provide a more pythonic interface with ROOT on top of the existing PyROOT bindings. Several key features include:

  • Improvements to help you create and manipulate trees, histograms, cuts and vectors.
  • Colours and other style attributes can be referred to by descriptive strings.
  • Get and Set methods on ROOT objects are also properties.
  • Provides a way of mapping ROOT trees onto python objects and collections.
  • Easy navigation through ROOT files. You can now access objects with my_file.some_directory.tree_name, for example.
  • Dictionaries for STL types are compiled for you automatically.
  • Redirect ROOT's messages through Python's logging system.
  • Optionally turn ROOT errors into Python exceptions.
  • Plot your ROOT histograms or graphs with matplotlib.
  • Conversion of ROOT trees into NumPy ndarrays and recarrays through the related root_numpy package. Now take advantage of the many statistical and numerical packages that Python offers (NumPy, SciPy, StatsModels, and scikit-learn).
  • Conversion of ROOT files containing trees into HDF5 format with PyTables.
  • roosh, a Bash-like shell environment for the ROOT file
  • rootpy, a command for common tasks such as summing histograms or drawing tree expressions over multiple files, listing the contents of a file, or inspecting tree branches and their sizes and types.

Documentation

View the documentation at rootpy.org or (a possibly more up-to-date version) at rootpy.github.com/rootpy.

Also see an introductory presentation here: rootpy.org/intro.pdf

Requirements

  • Python 2.6 or 2.7 (Python 3 is currently not supported, but see this issue for progress)
  • ROOT 5.28+ with PyROOT enabled

The following dependencies are optional:

rootpy is developed and tested on Linux and Mac.

Getting the Latest Source

Clone the repository with git:

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

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.

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 requirements/[roosh|array|...].txt

Automatic Installation

To install a released version of rootpy use pip.

Note

This will install the latest version of rootpy on PyPI which may be lacking many new unreleased features.

To install in your home directory:

pip install --user rootpy

To install system-wide (requires root privileges):

sudo pip install rootpy

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

pip install --user rootpy[array,matplotlib,...]

This requires pip version 1.1 or later.

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}

Running the Tests

Testing requires the nose package. Once rootpy is installed, it may be tested (from outside the source directory) by running:

nosetests --exe -v -a '!slow' rootpy

rootpy can also be tested before installing by running this from inside the source directory:

make test

Development

Please post on the [email protected] list if you have ideas or contributions. Feel free to fork rootpy on GitHub and later submit a pull request.

IRC Channel

See #rootpy on freenode.

IRC is banned at CERN since it reveals your hostname to people in the chatroom, making you interesting to attackers. But you can safely access it through this web link:

http://webchat.freenode.net/?randomnick=1&channels=rootpy&prompt=1

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 create 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 rootpy-users or rootpy-dev Google groups.

rootpy's People

Contributors

ndawe avatar pwaller avatar ekfriis avatar cdeil avatar wiso avatar timelike avatar jhegeman avatar kreczko avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.