Skip to content

Luna + Python = lunapi

lunapi is a Python module that provides an interface to Luna. It accesses the C/C++ Luna library directly, meaning all core Luna commands described here have similar syntax and performance; many of the fundamental concepts described here apply here too.

LunaScope

LunaScope is a standalone desktop viewer built on top of lunapi. For interactive visual review, it is generally the better and more full-featured tool; the scope utility described here is a smaller embedded viewer intended for use inside JupyterLab notebooks.

Luna In Your Browser

You can also try _lunapi_ in your browser, linked to example data and interactive notebooks, via this Binder-hosted cloud instance.

Installation

To obtain lunapi (macOS, Linux or Windows) use pip:

pip install lunapi

Alternatively, you can pull the lunapi Docker image which also provides a Jupyter lab environment (as well as the command-line Luna and R-based lunaR tools) in a single package.

Getting started

Known issues

  • Jupyter Lab is required for the scope viewer
  • For most interactive signal viewing tasks, LunaScope is a better choice than the notebook-embedded scope widget

  • Using ctrl-D or ctrl-C to escape from long-running Luna processes may be slow

  • On some platforms, commands may run more slowly under the Jupyter Lab environment compared to a plain Python environment (which gives comparable performance to the command-line Luna). This may be due to suboptimal configuration settings, but it is beyond the scope of this documentation to advise for specific cases. In general, the notebooks are best suited for smaller, interactive jobs rather than more intensive processing.