Python API

Christopher Werner
2019-01-07T15:40:54Z

S-01443

As a Tullow Geophysicist, I want to be able to call PIOL features from Python because I don't know or necessarily have experience with the language the PIOL is written in.

Pre-Dev Notes:

A number of operations are done in ExSeisDat during class destruction. This doesn't play well with Python lifetime management. Implicit operations in the destructor should be made available explicitly, either as a method, or done at the start of other write functions when the file metadata has been changes on the object.

SWIG can be used to automatically generate bindings from C++ to a number of languages, i.e. Python.

The SWIG based wrapping needs to be tested. The wraptests should cover this.

The C and C++ API names have become out-of-sync. These need to be updated.

Ideally, some mechanism could be put in place to confirm the coverage and naming schemes of the C wrapper, but this could prove difficult.

Ensure all destructors of exposed classes can also be called explicitly. This is needed to match the memory model of Python. Currently, some classes perform actions such as writing to file, or executing a pipeline, during destruction. Since Python is garbage collected, when this action is completed is a lot less clear than it is in C++.

Implementation Notes:

ADDME

System Test Changes:

ADDME

Bug Fixes:

ADDME

C++ API Changes:

ADDME

C API Changes:

ADDME

Success Criteria:

The full API is available through python calls

The Python API is documented

The user guide is updated to reflect python usage

At least one python API example is created

Tasks

Ensure all destructors of exposed classes can also be called explicitly

Refactor: Re-sync the C and C++ APIs

Add Python bindings

Test Python bindings

CREATED ON - 20/04/2016