Overview

Lena is an architectural framework for data analysis. It is written in Python and works with Python versions 2, 3 and PyPy.

These are Lena features from programming point of view:

  • modularity, weak coupling. Algorithms can be easily added, replaced or reused.
  • performance. Lazy evaluation is good for memory and speed. Several analyses can be done reading data once. PyPy with just-in-time compiler can be used if needed.
  • code reuse. Logic is separated from presentation. One template can be used for several plots.
  • rapid development. One can run only those elements which already work. During development only a small subset of data can be analysed. Results of heavy calculations can be easily saved.
  • easy to understand, structured and beautiful code.

From data analysis perspective:

  • comparison of analyses with arbitrary changes (including different input data or algorithms).
  • algorithm reuse for a subset of data (for example, to see how an algorithm works at different coordinates in the detector).
  • analysis consistency. When we run several algorithms for same data or reuse an algorithm, we are sure that we use same data and algorithm.
  • algorithms can be combined into a more complex analysis.

Lena originated from experimental neutrino physics and is named after a great Siberian river.

Installation

From pip

Lena core modules depend only on Python standard libraries. Other python extensions can be installed from pip:

pip install lena
# if you plan to render LaTeX templates
pip install jinja2

From github

git clone https://github.com/ynikitenko/lena
# most of requirements are for development only
pip install -r lena/requirements.txt

Replace <path-to-lena> with the actual path to the directory lena and add

export PYTHONPATH=$PYTHONPATH:<path-to-lena>

to your profile (e.g. .profile or .bashrc on Linux).

Additional programs

To fully use all available tools, you may need the following programs:

  • pdflatex to produce pdf files from LaTeX.
  • pgfplots and TikZ to produce LaTeX plots.
  • pdftoppm to convert pdf files to png.

They are not necessary if you don’t need to make plots or want to provide your own tools for that.

Documentation

To get started, read the Tutorial.

Complete documentation on Lena classes and specific topics can be found in the Reference.

License

Lena is free software licensed under Apache software license (version 2). You can use it freely for your data analysis, read its source code and modify it.

It is intended to help people in their data analysis, but we don’t take responsibility if something goes wrong.

Alternatives

Ruffus is a Computation Pipeline library for python used in science and bioinformatics. It connects program components by writing and reading files.