Menu

Python libraries

CMRP Software

Python libraries

A big part of GEOMS2 use the Python programming language. In this article are listed the Python libraries used in this software.

Python native and minor operations

This software was compiled in Python 2.7. The import "from future import divsion" is the first in every script where calculations are being made.

  • tempfile - "This module generates temporary files and directories. It works on all supported platforms.
  • win32api - "The canonical name for - Python for Windows extensions." (Notice that this library may be changed in Linux or OSX distributions).
  • os - "This module provides a portable way of using operating system dependent functionality."
  • subprocess - "The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes."
  • shutil - "The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal."
  • sys - "This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available."
  • itertools - "This module implements a number of iterator building blocks inspired by constructs from APL, Haskell, and SML. Each has been recast in a form suitable for Python."
  • webbrowser - "The webbrowser module provides a high-level interface to allow displaying Web-based documents to users."

Scientific analysis and object manipulation

  • Numpy - "NumPy is the fundamental package for scientific computing with Python."
  • Scipy - "SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering."
  • Scikit-learn - "Simple and efficient tools for data mining and data analysis."

Numpy is the base behind all GEOMS2 objects by using its powerful numpy arrays. Using numpy arrays is by far faster and more memory efficient than using the python native lists. Scipy and Scikit learn where used in several procedures within GEOMS2, namely array filters and atributes, and statistical analysis.

Graphical user interface

  • wxPython - "...a blending of the wxWidgets C++ class library with the Python programming language."

There were several options regarding the library used to build the GEOMS2 user interface. At the last point point, however, the choice was between wxPython and pyQT. Both beeing mazing libraries wxPython was chosen simply because our knowledge on this library was greater than on the alternative, and community support seemed to be better.

2D graphics

  • Matplotlib - "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms."

Again there were plenty of options regarding 2D plot libraries for GEOMS2 but matplotlib was simple to use, pretty and flexible. No big doubts here.

3D graphics

  • Mayavi - "Mayavi seeks to provide easy and interactive visualization of 3-D data."

This was a tough one. By one hand Mayavi functions were closer to what was intended of this software (meaning shorter development time), by the other scripting in this library to make a software of the complexity of GEOMS2 wasn't easy, mainly due to poor support. In the end this was chosen for the same reason wxPython was for GUI programming. We just knew it better.


Related

Wiki: Home

MongoDB Logo MongoDB