QCOBJ Python Package Documentation

Foreword

QCOBJ has been developed by two programmers working in the Aerial Operations group of the IRI Research Section at OGS - Istituto Nazionale di Oceanografia e di Geofisica Sperimentale.

Python is their favourite programming language since 2006.

The authors:

Roberto Vidmar, Nicola Creati

_images/vidmar.jpg _images/creati.jpg

What is QCOBJ?

Scientists often use configuration files (cfg files) to set the parameters and initial conditions for their computer programs or simulations. When these parameters are not limited to numbers or strings but represent physical quantities their unit of measure must be taken into account. Researchers are used to convert derived physical quantities by hand or with the help of some computer program but this operation slows down the process and is inherently error prone.

QCOBJ tries to give an answer to this problem integrating unit of measure and hence dimensionality into parameters. This approach ensures that programs using this package will always get numbers in the requested range and in the correct unit of measure independently of the units used in the configuration file.

QCOBJ in short

  • create/edit configuration files with the power of ConfigObj

  • mix physical quantities at your pleasure: specify pressure parameter like

    • pressure = 300.0 Pa or

    • pressure = 0.03 N / cm**2 or

    • pressure = 2.842 kgf / ft**2

    and let QCOBJ handle the conversion for you.

  • create validation files with physical quantities and valid range for all parameters.

  • use the validation file to define the preferred physical quantities

  • use qcobj.cfggui.CfgGui to develop your own Qt based GUI to show/edit configuration files.

Dependencies

It relies on ConfigObj and Pint (PySide2/PySide6/PyQt5, are optional for the gui).

Installation

QCOBJ can be installed from PyPi:

pip3 install qcobj

but to take advantage of the GUI install it with

pip3 install qcobj[with_pyside2]

or

pip3 install qcobj[with_pyqt5]

For the bleeding edge install from bitbucket with the same options ([with..]):

pip3 install git+https://bitbucket.org/bvidmar/qcobj

Credits

This package was possible thanks to Hernan E. Grecco <hernan.grecco@gmail.com> who released and mantains Pint and helped in the integration.

Note

To use the cfggui module please install either PySide2 or PySide6 or PyQt5.

Contents

Warning

This code has been tested only on Linux Kubuntu 20.04.2LTS but should work also on Mac and Windows.

Warning

This is work in progress!

Indices and Tables